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.

Spam Notice Detector - Urgent

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

Spam Notice Detector - Urgent

Post by Nexus6 »

#This script is supposed to send a msg to a #Nospam channel when it #gets #notice which contains some forbidden strings.

# It actually works, but I would like it to react on chan notices in all #channels bot is in but it reacts not only on chan notices in chan "#".

#I would also like to make a lil stats, after sending msg about spammer #bot should add it stats, so when i type !spammers number of caught #spammers is displayed. Thanks a lot

bind NOTC - "*www.*" spamn
bind NOTC - "*http//*" spamn
bind NOTC - "*/server*" spamn

set chanz "#"

proc spamn { nick uhost handle text {dest ""} } {
global botnick chanz spammermask
if {[matchattr $nick m] || [isop $nick $chanz] || [matchattr $chanz f] || [isvoice $nick $chanz] || [matchattr $nick f|f $chanz]} {return 0}
if {$nick == $botnick} {return 0}
if {$nick == "ChanServ"} {return 0}
set spammermask "*!*[string range $uhost [string first "@" $uhost] end]"
putquick "PRIVMSG NoSpam :$nick address $spammermask was spamming"
return 1
}
putlog "! Loaded Spam Notice Detector !"
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Just a note, this script would have nto worked, and looks like it has been cut from a larger script, due tot he fact, that there are extra }'s for no reason. There is also checks to see if a channel has the +f flag.

Code: Select all

bind NOTC - "*www.*" spamn
bind NOTC - "*http//*" spamn
bind NOTC - "*/server*" spamn

set chanz "#"

proc spamn {nick uhost handle text dest} {
  global botnick
  if {[validchan $dest]} {
    if {[matchattr $nick mf|mf $dest] || [isop $nick $dest] || [isvoice $nick $dest] || [matchattr $nick f|f $dest]} {return 0}
  } else {
    if {[matchattr $nick mf]} { return 0 }
  }
  if {([isbotnick $nick]) || ([string tolower $nick] == "chanserv")} {return 0}
  set spammermask "*!*[lindex [split $uhost @] 1]"
  putquick "PRIVMSG NoSpam :$nick address $spammermask was spamming"
  return 1
}
}
putlog "! Loaded Spam Notice Detector !"
This will check both channel and private notces. Channel notices are checked to see if the user is a op or voice in the channel, or they have the global or channel m or f flags, for provate notices, if they have the m or f global flags, the messgae is stoped.

This script below will only send messages regarding channel notices.

Code: Select all

bind NOTC - "*www.*" spamn
bind NOTC - "*http//*" spamn
bind NOTC - "*/server*" spamn

set chanz "#"

proc spamn {nick uhost handle text dest} {
  global botnick
  if {![validchan $dest]} { retrun 0 }
  if {[matchattr $nick mf|mf $dest] || [isop $nick $dest] || [isvoice $nick $dest] || [matchattr $nick f|f $dest]} {return 0}
  if {([isbotnick $nick]) || ([string tolower $nick] == "chanserv")} {return 0}
  set spammermask "*!*[lindex [split $uhost @] 1]"
  putquick "PRIVMSG NoSpam :$nick address $spammermask was spamming"
  return 1
}
}
putlog "! Loaded Spam Notice Detector !"
N
Nexus6
Op
Posts: 114
Joined: Mon Sep 02, 2002 4:41 am
Location: Tuchola, Poland

Post by Nexus6 »

First of all thanks :))

TCL error: invalid command name "}"
removed one } from the bottom and works

and how could I make it record number of users caught spamming?
it should add them after msging to file and when i typed !spammers it should tell me number of spammers caught (read from file)

thanks in advance :))
Locked