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.

bind flud

Old posts that have not been replied to for several years.
Locked
N
Nexus6
Op
Posts: 114
Joined: Mon Sep 02, 2002 4:41 am
Location: Tuchola, Poland

bind flud

Post by Nexus6 »

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.

Code: Select all

bind flud - pub chanflud
proc chanflud {nick uhost handle pub chan} {
if {[matchattr $nick mo|mo $chan] || [isop $nick $chan] || [isvoice $nick $chan] || [matchattr $nick o|o $chan] || ([string tolower $nick] == "someexemptnick")} {return 0}
putserv "KICK $chan $nick :public flood detected!"
return 1
}
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.

Code: Select all

if {(![matchattr $nick mo|mo $chan]) && (![isop $nick $chan]) && (![isvoice $nick $chan]) && (![matchattr $nick o|o $chan]) && ([string tolower $nick] != "exempt")} {...proc 
doesn't work neither.
Any ideas?
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

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.
N
Nexus6
Op
Posts: 114
Joined: Mon Sep 02, 2002 4:41 am
Location: Tuchola, Poland

Post by Nexus6 »

thx but i prefer my code :P

Code: Select all

bind flud - pub chanflud
proc chanflud {nick uhost handle pub chan} {
if {[matchattr $nick mo|mo $chan] || [isop $nick $chan] || [isvoice $nick $chan] || [matchattr $nick o|o $chan] || ([string tolower $nick] == "someexemptnick")} {return 1}
putserv "KICK $chan $nick :public flood detected!"
}
it works! It doesn't kick for public msg flood channel ops/channel voices even if they don't exist in bot userfile :)

cheers
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

I've figured out my question :D
Once the game is over, the king and the pawn go back in the same box.
Locked