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.

Action Trigger

Old posts that have not been replied to for several years.
Locked
H
Hazim

Post by Hazim »

I'm working on a script that will be triggered by a particular action in a channel, however I have NO scripting skill whatsoever. I have managed to piece together what I THINK may work, but I'd like someone to check it out if that's at all possible.

----- Script Begins ------

bind ctcp - "ACTION" bind:slap

proc bind:slap {nick uh hand dest kw arg} {
if {[isbotnick $dest]} {
return
}
if ($arg =~ /slaps ZeemBot/i) {
if ($nick =~ /qgz/i) {
if ($arg =~ /harder/i) {
puthelp "PRIVMSG $dest :oh yeah $nick, that's the way I like it!"
}
else {
puthelp "PRIVMSG $dest :oh yeah baby, harder!"
}
}
else {
puthelp "PRIVMSG $dest :01ACTION nut-punches $nick01"
}
}
}
}

----- Script Ends ------

Basically, anyone who slaps the bot and DOESN'T have qgz in their name will get a nutpunch, whereas if they have qgz in their name the bot will respond accordingly. if they have qgz in their name AND harder is in the action from the user, the bot responds with "That's the way I like it". I would also like all the triggers to be case insensitive.

Any help/input would be greatly appreciated for this first time poster :wink:

Thanks

<font size=-1>[ This Message was edited by: Hazim on 2002-04-25 17:18 ]</font>
P
Petersen
Owner
Posts: 685
Joined: Thu Sep 27, 2001 8:00 pm
Location: Blackpool, UK

Post by Petersen »

read the tcl manual for the command 'string' (specifically 'string match', and 'string tolower'). Also tcl doesnt use () in its if constucts like that, use {}
Locked