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.

Notice Flood Protection for Channel and Users

Old posts that have not been replied to for several years.
Locked
e
evansmith

Notice Flood Protection for Channel and Users

Post by evansmith »

Hi Guys,

can anyone help me change or modify Modreds script to include individual users too. I think it currently bans for notice floods to the channel only. Would really appreciate it as my channel is under attack by these notice nutz.

thanks



set channels "#chan1 #chan2"

bind notc - "*" notice

proc notice {nick host hand text dest} {
global channels botnick
foreach chan $channels {
if {$chan == $dest} {
set x [split $host @]
newchanban $chan *!*@[lindex $x 1] $botnick "Another noticing dickhead bites the dust.." 60
}
}
}

[ This Message was edited by: Mordred on 2002-04-12 03:35 ]
User avatar
z_one
Master
Posts: 269
Joined: Mon Jan 14, 2002 8:00 pm
Location: Canada

Post by z_one »

The only logical targets for a notice from the Bot's point of view can be the channel it's monitoring or the bot itself.
If I am not mistaken, you can simply remove the "IF condition" that checks if the notice target is a channel ... thus allowing the code to be processed always. And you should make sure that the $dest is not an empty string.

Code: Select all

set channels "#chan1 #chan2" 

bind notc - "*" notice 

proc notice {nick host hand text dest} { 
 global channels botnick 

 if {$dest == ""} {set dest $botnick}
 set x [split $host @]
 foreach chan $channels { 
   newchanban $chan *!*@[lindex $x 1] $botnick "Another noticing dickhead bites the dust.." 60 
 } 
} 
Here's the explanation found in the Eggdrop helpfile (for further references)
(7) NOTC (stackable)
bind notc <flags> <mask> <proc>
procname <nick> <user@host> <handle> <text> <dest>

Description: dest will be a nickname (the bot's nickname,
obviously) or a channel name. mask is matched against the entire
notice and can contain wildcards. It is considered a breach of
protocol to respond to a /notice on IRC, so this is intended for
internal use (logging, etc.) only. Note that server notices do not
trigger the NOTC bind.

New Tcl procs should be declared as
proc notcproc {nick uhost hand text {dest ""}} {
global botnick; if {$dest == ""} {set dest $botnick}
...
}
for compatibility.
Locked