This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Trigger script

Old posts that have not been replied to for several years.
Locked
F
FiskerEnDK
Voice
Posts: 17
Joined: Thu Jan 16, 2003 7:18 am

Trigger script

Post by FiskerEnDK »

i made this script. I want it to take the last from a trigger and put it into the putserv line

e.g.
I write !slap Nick

proc tud { nick mask hand chan text args } {
set msg [lindex $args 0]
putserv "PRIVMSG $chan :Slaps $msg Bigtime"
}

but the code dosent display the nick on the line.. properly a little args error can anyone help!
D
Darkj
Halfop
Posts: 86
Joined: Sun Jul 06, 2003 9:58 pm

Post by Darkj »

Code: Select all

proc tud { nick mask hand chan text args } { 
set msg [lindex $args 0] 
putserv "PRIVMSG $chan :Slaps $msg Bigtime" 
} 
First of all your proc has too many args in it, and you should split your lindex for those nicks with weird chars in them. This should do it...

Code: Select all

proc tud {nick uhost chan hand args}
set msg [lindex [split $args] 0] 
putserv "PRIVMSG $chan :Slaps $msg Bigtime" 
} 
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

you've forgot one { :)

Code: Select all

proc tud {nick uhost chan hand args} {
is correct.
Once the game is over, the king and the pawn go back in the same box.
F
FiskerEnDK
Voice
Posts: 17
Joined: Thu Jan 16, 2003 7:18 am

Post by FiskerEnDK »

Now it just dont say anything in the chan even not the first of putserv!
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

FiskerEnDK wrote:Now it just dont say anything in the chan even not the first of putserv!
did you include a binding to the PUB !slap?
F
FiskerEnDK
Voice
Posts: 17
Joined: Thu Jan 16, 2003 7:18 am

Post by FiskerEnDK »

ya

bind pub - !slap tud
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

well, not sure what you are trying, but the usual way most people would write this script is:

Code: Select all

bind PUB - !slap tud

proc tud { nick uhost hand chan text } {
   set msg [lindex [split $text] 0]
   puthelp "PRIVMSG $chan :Slaps $msg Bigtime"
}
Note that your code used the keyword "args", which does have a special meaning.

Note that you need to add some checking in case someone simply types "!slap".
F
FiskerEnDK
Voice
Posts: 17
Joined: Thu Jan 16, 2003 7:18 am

Post by FiskerEnDK »

Thanks for the help ppl!
Locked