Easy antispam script

By xelent on Sep 04, 2008

This is a very simple antispam script.

As you can see the script will punish all form for adverising.

Copy/paste (ALT+R)

;Advert
on *:TEXT:#*:#:{ 
  if ($nick isop #) || ($nick == $me) { halt }
  inc %kicked
  timer 1 0 raw -q MODE $chan +b $address($nick,2)
  timer 1 1 raw -q KICK $chan $nick : Dont advertise here! tempban «10 min» ID: %kicked
  timer 1 600 raw -q MODE $chan -b $address($nick,2)
}

on *:TEXT:¤*:#:{ 
  if ($nick isop #) || ($nick == $me) { halt }
  inc %kicked
  timer 1 0 raw -q MODE $chan +b $address($nick,2)
  timer 1 1 raw -q KICK $chan $nick : Dont advertise here! tempban «10 min» ID: %kicked
  timer 1 600 raw -q MODE $chan -b $address($nick,2)
}

on *:TEXT:www*:#:{ 
  if ($nick isop #) || ($nick == $me) { halt }
  inc %kicked
  timer 1 0 raw -q MODE $chan +b $address($nick,2)
  timer 1 1 raw -q KICK $chan $nick : Dont advertise here! tempban «15 min» ID: %kicked
  timer 1 900 raw -q MODE $chan -b $address($nick,2)
}

on *:TEXT:http://*:#:{ 
  if ($nick isop #) || ($nick == $me) { halt }
  inc %kicked
  timer 1 0 raw -q MODE $chan +b $address($nick,2)
  timer 1 1 raw -q KICK $chan $nick : Dont advertise here! tempban «15 min» ID: %kicked
  timer 1 900 raw -q MODE $chan -b $address($nick,2)
}

on *:TEXT:join*:#:{ 
  if ($nick isop #) || ($nick == $me) { halt }
  inc %kicked
  timer 1 0 raw -q MODE $chan +b $address($nick,2)
  timer 1 1 raw -q KICK $chan $nick : Dont advertise here! tempban «30 min» ID: %kicked
  timer 1 3600 raw -q MODE $chan -b $address($nick,2)
}

on *:TEXT:idle*:#:{ 
  if ($nick isop #) || ($nick == $me) { halt }
  inc %kicked
  timer 1 0 raw -q MODE $chan +b $address($nick,2)
  timer 1 1 raw -q KICK $chan $nick : Dont advertise here! tempban «30 min» ID: %kicked
  timer 1 3600 raw -q MODE $chan -b $address($nick,2)
}

Comments

Sign in to comment.
IFHTT   -  Sep 05, 2008

lol also a good point, still a much cleaner code nonetheless

 Respond  
napalm`   -  Sep 05, 2008

Actually, you're right, it wasn't needed. Not because $me would have ops, but because 'on :TEXT::*:' does not trigger when $me types anyway. Minor oversight.

 Respond  
IFHTT   -  Sep 05, 2008

DangerOfFate, Your recommendation is rather pointless

The original if statement says if the nick is op'ed on the channel OR the nick is me then halt the script.

Your first if statement says if i'm an op on the channel then halt the script which would result in the script not working period if you were op'ed

Your second recommendation says if the nick is op'ed on the channel AND the nick is me then halt the script.

This would do the exact same thing as your first recommendation and would render the script useless. In this case || is the correct way to combine the comparisons.

napalm`s code is closer to ideal. Only "&& ($nick != $me)" isn't necessary since it will only trigger if you have ops in the channel anyway, so "if ($nick !isop #)" would cover it, though it will still work just fine.

 Respond  
DangerOfFate   -  Sep 04, 2008

if ($nick isop #) || ($nick == $me) { halt }

 if ($me isop #) { halt } 

Wouldn't that work better? It is less code and in yours I though it would be:

 if ($nick isop #) && ($nick == $me) { halt } 

&& not ||.

 Respond  
napalm`   -  Sep 04, 2008
on @$1:TEXT:/^(#|www|¤|http|join|idle)/i:#:{
  if ($nick !isop #) { 
    inc %kicked 
    ban -ku3600 # $nick Dont advertise here! tempban «30 min» ID: %kicked
  }
}
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.