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.
Help for those learning Tcl or writing their own scripts.
BhasIRC
Voice
Posts: 27 Joined: Sat Jan 02, 2010 7:05 am
Location: south africa
Contact:
Post
by BhasIRC » Fri Feb 05, 2010 5:54 pm
Hi..
ok i need the following code to kick users who slap the bot with a slap msg maybe if it can be done were the slap msg is diff for each kick
here is my code
Code: Select all
bind ctcp - ACTION slap:back
proc slap:back {nick uhost hand chan kw arg} {
if {![validchan $chan]} {return 0}
if {[string match "*slap* $botnick *" $arg]} {
puthelp "KICK $chan $nick :test"
}
}
Thanks in advance
Zainul
nml375
Revered One
Posts: 2860 Joined: Fri Aug 04, 2006 2:09 pm
Post
by nml375 » Fri Feb 05, 2010 6:38 pm
First off, you are accessing $botnick as a local variable (which does not exist at that point of execution), rather than access the global $::botnick.
Secondly, you probably intended the match to be case insensitive. String match cares 'bout case by default, but you can use the -nocase option to instruct it to not care for case:
Code: Select all
bind ctcp - ACTION slap:back
proc slap:back {nick uhost hand chan kw arg} {
if {![validchan $chan]} {return 0}
if {[string match -nocase "*slap* $::botnick *" $arg]} {
puthelp "KICK $chan $nick :test"
}
}
NML_375
BhasIRC
Voice
Posts: 27 Joined: Sat Jan 02, 2010 7:05 am
Location: south africa
Contact:
Post
by BhasIRC » Sat Feb 06, 2010 7:30 am
thank alot works great