This scrip intention is a kickban and msg to any nick obtains op from my channel, the nick obtain @ is different to nick access op, for example:
Nick access op official is Jagger, but the boy entry on chan using other nick then bot baned this nick. This is the code:
set chanservices "ChanServ@services.dal.net"
set commandwhy "WHY"
set nickchans "Chanserv"
set nickaops {
"nick1"
"nick2"
"nick3"
"nicknn"
}
bind mode - "#iquitos +o" bot:checkop
bind notc - "*" bot:checkwhy
proc bot:checkop {nick host hand chan mode target} {
global chanservices commandwhy nickchans
if {[string compare -nocase $::botnick $target] == 0} {return}
if {[string compare -nocase $nickchans $nick] != 0} {return}
putserv "PRIVMSG $chanservices :$commandwhy $chan $target"
}
proc bot:checkwhy {nick host hand text dest} {
global nickaops
foreach nickaop $nickaops { if {([string match -nocase *$nickaop* $nick])} {return}
if {[string compare -nocase "ChanServ" $nick] !=0} {return}
foreach nickaop $nickaops { if {([string match -nocase *$nickaop* $nick])} {return}
puthelp "PRIVMSG $nick :You are using a nick no equal to nick access on the chan"
putquick "MODE $chan +b $nick"
putquick "KICK $chan $nick :Change your nick and rejoin"
}
}
set chans_bop "*"
set chanservices "ChanServ@services.dal.net"
set commandwhy "WHY"
set nickchans "Chanserv"
set nickaops {
"nick1"
"nick2"
"nick3"
"nicknn"
}
bind mode - "*+*o*" bot:checkop
bind notc - "*" bot:checkwhy
proc bot:checkop:checkop {nick host hand chan mode target} {
if {[string compare -nocase $::botnick $target] == 0} {return}
if {[string compare -nocase "ChanServ" $nick] != 0} {return}
putserv "CHANSERV WHY $chan $target"
}
proc bot:checkwhy {nick host hand text dest} {
global botnick nickaops nickchans
if {(([lsearch -exact [string tolower $chans_bop] [string tolower $chan]] != -1) || ($chans_bop == "*"))} {
foreach nickaop $nickaops { if {([string match -nocase *$nickaop* $botnick])} {return}
foreach nickaop $nickaops { if {([string match -nocase *$nickaop* $nickchans])} {return}
foreach nickaop $nickaops { if {([string match -nocase *$nickaop* $nick])} {return}
puthelp "PRIVMSG $nick :Ud, no esta usando su nick de AOP/SOP no esta permitido, se le dio el acceso a un nick determinado, por favor cambiese de nick"
putquick "MODE $chan +b $nick"
putquick "KICK $chan $nick :Pongase su nick de OP"
}
}
}
}
Nick has AOp access to #Channel. Reason: Identification to the nickname Nick.
The above is the DALnet ChanServ response to a "why" trigger. You do not appear to be checking this, instead a procedure is triggered on any response from ChanServ.