Jump to content
coders-irc_Bot

No Spam Chan v1.1

Recommended Posts

  • Administrators

he script monitors the communication on the channel in order to search for the " # " symbol in the strings to detect advertising from other channels. If detected, it checks the real existence of such a channel by executing the " /WHO " command, and if it is on the list, it performs a "Kick+Ban" on the violator's nickname.

################################################### ####################
# Name: No Spam Chan v1.1
# Author: Epic (epicnet@mail.ru, http://epicnet.ru)
# Description: The script monitors the communication on the channel in order to search for the symbol "#" in the strings to identify advertisements from other channels.
################################################### ####################

alias -l nospamchan {
  ;# You can enable or disable options by changing the value to <yes> or <no>
  ;---------------------
  ;# Type 1 = nick!ident@host
  ;# Type 2 = nick!*@host
  ;# Type 3 = *!ident@host
  ;# Type 4 = nick!*@*
  ;# Type 5 = *!ident@*
  ;# Type 6 = *!*@host
  ;# Type 7 = *!*@subnet*
  ;---------------------
  .hadd -m nospamchan type-ban 6
  .hadd -m nospamchan kick yes
  .hadd -m nospamchan ban yes
  .hadd -m nospamchan kick-text No channel ads!
}
-------------------------------------------------- --------------------
on *:TEXT:*#*:#: nospamchan_check $nick $chan $strip($1-)
on *:ACTION:*#*:#: nospamchan_check $nick $chan $strip($1-)
alias -l nospamchan_check {
  if ($1 == $server) halt | nospamchan
  .hadd -m nospamchan nick $1
  .hadd -m nospamchan chan $2
  .hadd -m nospamchan search $wildtok($3-,*#*,1,32)
  .who $hget(nospamchan,search)
}
raw 352:*: if ($2 == $hget(nospamchan,search)) { .hadd -m nospamchan found $2 | halt} | haltdef
raw 315:*:{
  if ($2 == $hget(nospamchan,found) && $hget(nospamchan,nick)) {
    ;---------------------
    if ($hget(nospamchan,ban) == yes) {
      if ($hget(nospamchan,type-ban) == 1) .mode $hget(nospamchan,chan) +b $address($hget(nospamchan,nick),5)
      if ($hget(nospamchan,type-ban) == 2) .mode $hget(nospamchan,chan) +b $address($hget(nospamchan,nick),7)
      if ($hget(nospamchan,type-ban) == 3) .mode $hget(nospamchan,chan) +b $address($hget(nospamchan,nick),0)
      if ($hget(nospamchan,type-ban) == 4) .mode $hget(nospamchan,chan) +b $+($hget(nospamchan,nick),!*@*)
      if ($hget(nospamchan,type-ban) == 5) .mode $hget(nospamchan,chan) +b $+($gettok($address($hget(nospamchan,nick),1),1,64) ,@*)
      if ($hget(nospamchan,type-ban) == 6) .mode $hget(nospamchan,chan) +b $address($hget(nospamchan,nick),2)
      if ($hget(nospamchan,type-ban) == 7) .mode $hget(nospamchan,chan) +b $+(*!*@,$gettok($gettok($address($hget(nospamchan,nick) .5),2.64),1-2.46),.*)
    }
    ;---------------------
    if ($hget(nospamchan,kick) == yes) .kick $hget(nospamchan,chan) $hget(nospamchan,nick) $hget(nospamchan,kick-text)
    if ($hget(nospamchan,nick)) .hdel -sw nospamchan nick
    if ($hget(nospamchan,chan)) .hdel -sw nospamchan chan
    if ($hget(nospamchan,search)) .hdel -sw nospamchan search
    if ($hget(nospamchan,found)) .hdel -sw nospamchan found
    halt
  }
  haltdef
}

 

NoSpamChan_v1.1.rar

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...