egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

notice script
Goto page Previous  1, 2
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
iamdeath
Master


Joined: 11 Feb 2005
Posts: 323
Location: *HeLL*

PostPosted: Sat Apr 28, 2007 8:52 am    Post subject: Reply with quote

Sir_Fz wrote:
So you didn't apply anything we told you here in your script. Before asking how to output the info, learn how to write eggdrop Tcl scripts that won't choke on special characters.

Tip: when using [lindex] on a string, [split] the string (e.g. lindex [split $arg] 0) same for [lrange] (e.g. lrange [split $arg] 0 2) and then apply join to convert it back to a string (e.g. join [lrange [split $arg] 0 2]).


Look Fz I did'nt use it because I did'nt understand it more, don't take every user like you guys are. Everyone is not professional you think with a different way don't think that everyone is perfect and knows about TCL programming. I am trying to write a code and I had problems I asked for help here, I did'nt understand the points you mentioned so I ignored them. If I ask again and again you would shout more. It's not good to accuse someone it's bettter to help him more in detail in he does'nt understand.

Ok if still you guys can help me my question is not about lindex or lrange it's all solved and output is coming problem. All I want to ask you is how can I continue in the end part of the script how do I make it output.


Ok 1 more thing, the tcl is working fine but it has 1 issue which bothers alot. If i use my script like this it's works:

Code:
proc script:notices11 {nick uhost hand text dest} {
global scriptchannel rusername rdate lastseen infoline email rflags Epithet lastquit rnicknames rhost rchannels currentnick
set currentnick [lrange $text 2 end]
regsub -all {\{\}} $rflags "" rflags
regsub -all {\{\}} $rdate "" rdate
regsub -all {\{\}} $infoline "" infoline
regsub -all {\{\}} $Epithet "" Epithet
regsub -all {\{\}} $rnicknames "" rnicknames
regsub -all {\{\}} $rhost "" rhost
regsub -all {\{\}} $rchannels "" rchannels
regsub -all {\{\}} $currentnick "" currentnick
regsub -all {\{\}} $lastquit "" lastquit
regsub -nocase {Registered on:} $rdate "\00303Registered on:\003" rdate
regsub -nocase {Last seen:} $lastseen "\00303Last Seen:\003" lastseen
regsub -nocase {Infoline:} $infoline "\00303Infoline:\003" infoline
regsub -nocase {Email address:} $email "\00303Email Address:\003" email
regsub -nocase {Flags:} $rflags "\00303Flags:\003" rflags
regsub -nocase {Epithet:} $Epithet "\00303Epithet:\003" Epithet
regsub -nocase {Last quit hostmask:} $lastquit "\00303Last quit hostmask:\003" lastquit
regsub -nocase {Nickname\(s\):} $rnicknames "\00303Nickname(s):\003" rnicknames
regsub -nocase {Hostmask\(s\):} $rhost "\00303Hostmask(s):\003" rhost
regsub -nocase {Channel\(s\):} $rchannels "\00303Channel(s):\003" rchannels
regsub -nocase {Current nickname\(s\):} $currentnick "\00303Current nickname(s):\003" currentnick
putserv "PRIVMSG $scriptchannel :\00303Account information for:\003 \00307$rusername\003"
putserv "PRIVMSG $scriptchannel :\00303Registered on:\003 \00314$rdate\003"
putserv "PRIVMSG $scriptchannel :\00303Last Seen:\003 \00314$lastseen\003"
putserv "PRIVMSG $scriptchannel :\00303Infoline:\003 \00314$infoline\003"
putserv "PRIVMSG $scriptchannel :\00303Email Address:\003 \00314$email\003"
putserv "PRIVMSG $scriptchannel :\00303Flags:\003 \00314$rflags\003"
putserv "PRIVMSG $scriptchannel :\00303Epithet:\003 \00314$Epithet\003"
putserv "PRIVMSG $scriptchannel :\00303Last quit hostmask:\003 \00310$lastquit\003"
putserv "PRIVMSG $scriptchannel :\00303Nickname(s):\003 \00307$rnicknames\003"
putserv "PRIVMSG $scriptchannel :\00303Hostmask(s):\003 \00314$rhost\003"
putserv "PRIVMSG $scriptchannel :\00303Channel(s):\003 \00314$rchannels\003"
putserv "PRIVMSG $scriptchannel :\00303Current nickname(s):\003 \00307$currentnick\003"
}

putlog "ns info script loaded by iamdeath.."


Code:
# -NS- Account information for hitshy:
## -NS- Registered on: Sat Jul 30 13:21:23 2005
## -NS- Last seen: Right now!
## -NS- Infoline: None
## -NS- Email address: hitshy@msn.com
## -NS- Flags: +hc
## -NS- Epithet: a Webmaster
## -NS- Last quit hostmask: hitshy@208.98.5.219
## -NS- Nickname(s): Hitshy dean
## -NS- Hostmask(s): *@*
## -NS- Channel(s): 100:#snoopy 300:#opers 499:#NutShells 499:#music 100:#monitor 500:#leb ## -498:#lady 2:#jabal 400:#gudy ## 100:#exempt 500:#Druze 300:#Beirut 499:#a7la3alam
## -NS- Current nickname(s): hitshy


Now the thing is that, this script will work fine only if all the notices are recieved from NS, some users don't have ## -NS- Channel(s): and ## -NS- Current nickname(s): .. so the script halts .. is there any good idea so that, if any notice is not recieved from Ns for any user the script should still go on and paste the data collected?..

Thanks nml and FZ you've been soo helpful.
Back to top
View user's profile Send private message Visit poster's website
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sat Apr 28, 2007 9:15 am    Post subject: Reply with quote

If something is unclear, ask us to clarify it. Otherwize we don't have any options then to assume you either understand it or have no interrest of learning it. Also, ignoring important suggestions (such as proper use of list-commands) really discourages us from putting much further effort into the thread.
We might tell you to read a manpage at times, as these often explain how a command works very well, and if we were to explain it ourself, we'd probably write almost the same text. Should something be unclear on a manpage, say so and we'll try to explain that part.
We do expect you to put some effort into trying to solve the problem, where at the same time we gladly throw hints and pointers to whats wrong or might be causing the error. However, if ones sole interrest is to find someone to write it for him/her, "Script Request" would be a better forum.

That said, to your last query;

  • Which proc?
    Any valid name would do
  • How do I? (How do I trigger that proc?)
    Use a binding to trigger that last proc. Figure out what is the last output from NS for a query, and do all that code when it triggers. I would also recommend cleaning up your variables at that time.

I do not know the specs for NS output, so I cannot say which notice to trigger on, you'll have to figure that one out.
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
iamdeath
Master


Joined: 11 Feb 2005
Posts: 323
Location: *HeLL*

PostPosted: Sat Apr 28, 2007 9:30 am    Post subject: Reply with quote

I think I can explain you more only if you come to that network. I feel it difficult to explain what exactly the problem is with the script here. If you visit I can explain to you more. Let me know so I'll PrivateMessage you the server details.

thank you
Back to top
View user's profile Send private message Visit poster's website
iamdeath
Master


Joined: 11 Feb 2005
Posts: 323
Location: *HeLL*

PostPosted: Sat Apr 28, 2007 9:27 pm    Post subject: Reply with quote

Ok I changed a few things and now it's working perfectly. Thanks alot guys for being soo helpfull..

iamdeath
Back to top
View user's profile Send private message Visit poster's website
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Apr 28, 2007 9:40 pm    Post subject: Reply with quote

Just a few tips for you to take into consideration:
Code:
set currentnick [lrange $text 2 end]

Here you're applying a list command on a string, to avoid problems with special characters use:
Code:
set currentnick [join [lrange [split $text] 2 end]]

[split] turns the string to a list and [join] turns the list to a string.

Also
Code:
set rusername [lindex $text 3]

you need to turn $text into a list, so you do
Code:
set rusername [lindex [split $text] 3]

Hope this was more understandable for you... just apply these tips all over your script and it should be fine Smile
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
iamdeath
Master


Joined: 11 Feb 2005
Posts: 323
Location: *HeLL*

PostPosted: Sun Apr 29, 2007 4:20 pm    Post subject: Reply with quote

Thanks alot FZ, I'll do it right now Very Happy

iamdeath
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber