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.

Anti advertise

Old posts that have not been replied to for several years.
Locked
B
BeerMaN
Voice
Posts: 11
Joined: Fri Apr 18, 2003 5:50 pm
Location: Roskilde, Denmark
Contact:

Anti advertise

Post by BeerMaN »

Hi!

I was here looking arround, and I saw a anti advertise script - but the one I found have to many bad words, and counter and stuff, that is unusefull for me. ( sorry, but it gotta be simple) :)

I was wondering, if some of you have a anti advertise script, with only one function .. it's kick on a badword #

Anyone, help me out :)
-0wned.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Code: Select all

# binds #
bind ctcp * ACTION spam:action
bind pubm - {* *#*} spam:pub

# action spam #
proc spam:action {nick uhost hand dest keyword text} {
  if {[lindex [split $dest "@"] 0] == $::botnick || [lindex [split $dest "@"] 1] != ""} { return }
  if {[matchattr $hand of|fo $dest] || [isop $nick $dest] || ![string match "*#*" $text]} {
    return
  }
  set mask "*!*@[lindex [split $uhost @] 1]"
  newchanban $dest $mask Spam "\00224\002 hours ban for spaming within $dest" 1440
}

# channel spam #
proc spam:pub {nick uhost hand chan text} {
  if {[matchattr $hand of|fo $chan] || [isop $nick $chan] || ![string match "*#*" $text]} {
    set mask "*!*@[lindex [split $uhost @] 1]"
    newchanban $chan $mask Spam "\00224\002 hours ban for spaming within $chan" 1440
  }
}
Notice that I've made it to skip the channel op's (regular users with @ in there) and bot's known users, dosen't matter if he/she is oped, voiced or regular.
Once the game is over, the king and the pawn go back in the same box.
B
BeerMaN
Voice
Posts: 11
Joined: Fri Apr 18, 2003 5:50 pm
Location: Roskilde, Denmark
Contact:

Post by BeerMaN »

yeah, that works exellent .. but it dosen't kick the user who has written the # :)
-0wned.
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Probably because of your channel settings...the script adds a ban but does nothing to kick the user unless you set the channel +enforcebans
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

The # is not considered an spam, #something is.
Once the game is over, the king and the pawn go back in the same box.
B
BeerMaN
Voice
Posts: 11
Joined: Fri Apr 18, 2003 5:50 pm
Location: Roskilde, Denmark
Contact:

Post by BeerMaN »

nicest, it works .. thx alot guys :)
-0wned.
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

caesar wrote:

Code: Select all

proc spam:action {nick uhost hand dest keyword text} {
  if {[lindex [split $dest "@"] 0] == $::botnick ||... 
What's the purpose of this split?
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

None by the looks of it.

1: The ident isn't the botnick

2: Eggdrop will never see messages from itself, as IRC server don't sned them.
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

ppslim wrote:None by the looks of it.
1: The ident isn't the botnick
2: Eggdrop will never see messages from itself, as IRC server don't sned them.
Well...he's splitting the destination of the ctcp, not the userhost like you seem to base your reply on :)

The only time that 'if' containing the split would be 'true' is if the channel name contains a @ + one or more chars after it....and I don't see the point of that :P
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

is a channel op notice (onotice).
Once the game is over, the king and the pawn go back in the same box.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Actualy is an action on the bot's private msg.
Once the game is over, the king and the pawn go back in the same box.
Locked