| View previous topic :: View next topic |
| Author |
Message |
BhasIRC Voice
Joined: 02 Jan 2010 Posts: 27 Location: south africa
|
Posted: Fri Feb 05, 2010 5:54 pm Post subject: what am i doing wrong |
|
|
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: | 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 |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Fri Feb 05, 2010 6:38 pm Post subject: |
|
|
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: | 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, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
BhasIRC Voice
Joined: 02 Jan 2010 Posts: 27 Location: south africa
|
Posted: Sat Feb 06, 2010 7:30 am Post subject: |
|
|
| thank alot works great |
|
| Back to top |
|
 |
|