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"
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!