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 - bind server notice

Old posts that have not been replied to for several years.
Locked
J
JudgeFred

help - bind server notice

Post by JudgeFred »

Hi all,

I want a script that detect server notice and get the nick from that notice then do certain cmd. Here what I got so far and it doesn't work, please help (don't laught on my script cuz i'm trying to learn:-) ):

#here is example of server notice string: "-NOTICE- *** Network-Global -- from irc.server.com : Failed OPER attempt by: Nick (ident@ip) using UID opernick [---]"

bind raw - "*Failed OPER attempt by:*" failed:oper:notc

proc failed:oper:notc { from keyword arg } {
set nick = [lindex [split $arg] end-5]
if { $keyword == "*Failed*" } {
putserv "kill $nick Nice Try!"
return 0
}
}
putlog "Fail oper killed - Loaded"

thanks
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

the RAW bind only matches against one word of the message, the command. If you want to catch a notice, then you match against the word "NOTICE". Inside the proc itself, you check to make sure the message has whatever other words you want. Hope this helps!
J
JudgeFred

got it working...

Post by JudgeFred »

I got it workings. Thanks for the hint.

JF
Locked