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 

what am i doing wrong

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
BhasIRC
Voice


Joined: 02 Jan 2010
Posts: 27
Location: south africa

PostPosted: Fri Feb 05, 2010 5:54 pm    Post subject: what am i doing wrong Reply with quote

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
View user's profile Send private message Visit poster's website
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Fri Feb 05, 2010 6:38 pm    Post subject: Reply with quote

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
View user's profile Send private message
BhasIRC
Voice


Joined: 02 Jan 2010
Posts: 27
Location: south africa

PostPosted: Sat Feb 06, 2010 7:30 am    Post subject: Reply with quote

thank alot works great
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
Page 1 of 1

 
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