lo, I wanted to write a simple tcl which would kick for public flood, based on .chanset #channel flood-chan settings, 'cause without tcl bot kicks channel ops who are not bot users.
return 0 in this case causes that bot acts normally so kicks with reason "flood" even if user is channel op (but doesn't exist in bot userfile) I want it to do nothing if user is channel voice or op.
Hi. Quote from the tcl-commands.doc file: "If the proc returns 1, no further action is taken on the flood; if the proc returns 0, the bot will do its normal "punishment" for the flood."
Instead of checking his flags, why don't you test if he is an user, for this use [validuser $handle] and return 1 at the end. Here is an tcl that I use, it dosen't kick/ban users and channel operators.
bind flud - * flud_ban
proc flud_ban {nick host hand type channel {dest ""}} {
global botnick reasons
set mask "*!*@[lindex [split $host @] 1]"
if {$dest == ""} { set dest $botnick; return 0 }
if {[isop $nick $channel]} { return 1 }
if {[validchan $channel] && [botisop $channel]} {
putserv "KICK $channel $nick :Channel flood."
putserv "MODE $channel +b $mask"
return 1 }
}
If you would like to make it not kick/ban the voiced users just add this line in the script: if {[isvoice $nick $channel]} { return 1 }
Hope this helps.
PS: I guess the problem with your's is that you haven't set the destination of the flud, to channel or to the bot. Use in your proc this: {nick host hand type channel {dest ""}} {
Once the game is over, the king and the pawn go back in the same box.