bind mode - "* +b" channel:ban
proc channel:ban {nick uhost hand chan mc ban} {
if {[string match "$ban" "$::botname"] && [botisop $chan]} {
putquick "MODE $chan -b $ban"
if {[matchattr $hand mn|mn $chan] == 0} {
set mask "*!*@[lindex [split $uhost @] 1]"
newchanban $chan $mask Moron "don't ban me moron!" 1440
}
}
}
It will just unban itself if the users who sets an ban that matches him is an known master or owner globaly or on channel. Also you may try/use it's "needs" with something like:
well doesn't the "newchanban" set a global ban? like for example if the user who banned the bot rejoins the channel, the bot will kick it again by the reason "Banned: don't ban me moron!" ?
all i want it to do is unban itself, deop the user and msg chanserv@services.dal.net deop #channel $nick ; no global bans only channel bans can u do that for me please ?
if {[matchattr $hand mn|mn $chan] == 0} {
set mask "*!*@[lindex [split $uhost @] 1]"
newchanban $chan $mask Moron "don't ban me moron!" 1440
}
dose a check to see if the one that places an ban that matches his host is not an known user to it with friend or op flags. You may remove them if you don't want this feature. Also you may replace this line:
bind mode - "* +b" channel:ban
proc channel:ban {nick uhost hand chan mc ban} {
if {[string match "$ban" "$::botname"] && [botisop $chan]} {
putquick "MODE $chan -bo $ban $nick"
putserv "PRIVMSG Chanserv@Services.dal.net :deop $chan $nick"
if {[matchattr $hand mn|mn $chan] == 0} {
set mask "*!*@[lindex [split $uhost @] 1]"
putkick $chan $nick "Don't Ban me, You know that's not a good idea."
putquick "MODE $chan +b $mask"
}
}
}[code]
this should work correctly righ ?
sorry for being annoying, but this is the last request, I don't want the bot to apply those triggers on itself (incase the bot bans himself). what's the solution ?
Well; there was this notice from the server once which said : Server Flood Protection Activated on #Channel
and the bot sets mode to +b *!*@*
then he sets mode -ob $botnick *!*@*
-----------------------------
so I want that code just incase it does it again.
also this script doesn't work when a person bans *!*@host, it only works when a person bans *!*@* or $botnick!*@* or *!bot-ident@*, i couldn't figure it out..
and also one more question, if I put putquick "PRIVMSG...." instead of putserv "PRIVMSG...." it will function faster right ?