Ban and kick protection v1.1

By Kiritsu on Mar 19, 2016

Hello there !

I mad this script just for fun. I wanted to know if there is an easier script.

Thanks!

/// Edit: Solved all the problems with event on ban

; Copy paste the script in your remote (alt+r)

; Script made by Kiritsu on network OnlineGamesNet
; Simple script to unban, reop/voice, reinvite with bots ChanServ and Centravi
; How to use: /protection <total/ban/kick> <on/off>
; If something is missing, it will just send the actual config

alias -l echo.mode { return -at }
alias -l timer.rejoin { return 3 }
;timer.rejoin in seconds

alias protection {
  if (!$1) { 
    echo $echo.mode Actual parameters: (1 means enabled, 0 means disabled)
    echo $echo.mode Total: %protection.total
    echo $echo.mode Ban: %protection.ban
    echo $echo.mode Kick: %protection.kick
    halt
  }
  if ($1 == total) && ($2) {
    if ($2 == on) || ($2 == 1) {
      set %protection.total 1
      set %protection.kick 1
      set %protection.ban 1
      echo $echo.mode Total protection enabled
      echo $echo.mode Total: %protection.total
    }
    if ($2 == off) || ($2 == 0) {
      set %protection.total 0
      set %protection.kick 0
      set %protection.ban 0
      echo $echo.mode Total protection disabled
      echo $echo.mode Total: %protection.total
    }
  }
  elseif ($1 == total) && (!$2) { 
    echo $echo.mode Actual parameters: (1 means enabled, 0 means disabled)
    echo $echo.mode Total: %protection.total
  }
  if ($1 == ban) && ($2) {
    if ($2 == on) || ($2 == 1) {
      set %protection.ban 1
      echo $echo.mode Ban protection enabled
      echo $echo.mode Ban: %protection.ban
    }
    if ($2 == off) || ($2 == 0) {
      set %protection.total 0
      set %protection.ban 0
      echo $echo.mode Ban protection disabled
      echo $echo.mode Ban: %protection.ban
    }
  }
  elseif ($1 == ban) && (!$2) { 
    echo $echo.mode Actual parameters: (1 means enabled, 0 means disabled)
    echo $echo.mode Ban: %protection.ban
  }
  if ($1 == kick) && ($2) {
    if ($2 == on) || ($2 == 1) {
      set %protection.kick 1
      echo $echo.mode Kick protection enabled
      echo $echo.mode Kick: %protection.kick
    }
    if ($2 == off) || ($2 == 0) {
      set %protection.total 0
      set %protection.kick 0
      echo $echo.mode Kick protection disabled
      echo $echo.mode Kick: %protection.kick
    }
  }
  elseif ($1 == kick) && (!$2) { 
    echo $echo.mode Actual parameters: (1 means enabled, 0 means disabled)
    echo $echo.mode Kick: %protection.kick
  }
  if (%protection.kick == 1) && (%protection.ban == 1) {
    echo $echo.mode Protection of bans and kicks are enabled, protection total is enabled
    set %protection.total 1
  }
}

on *:ban:#:{
  if (%protection.total == 1) || (%protection.ban == 1) {
    if ($me isin $banmask) {
      if (ChanServ ison $chan) {
        ChanServ UP $chan
        ChanServ DELBAN $chan $me
      }
      if (Centravi ison $chan) {
        msg Centravi UP $chan
        msg Centravi DELBAN $chan $me
      }
    }
  }
}

on *:kick:#:{
  if (%protection.total == 1) || (%protection.kick == 1) {
    if ($knick == $me) {
      if (ChanServ ison $chan) {
        ChanServ INVITEME $chan
        timer 1 $timer.rejoin raw JOIN $chan
      }
      if (Centravi ison $chan) {
        msg Centravi INVITEME $chan
        timer 1 $timer.rejoin raw JOIN $chan
      }
    }
  }
}

Comments

Sign in to comment.
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.