Part/Hop Protection - Multi Channel

By Mushufasa on Jul 28, 2007

Okay! 1st of all I'd like to say I spent f***ing ages on this because the stuff confused my small mind. :( So I'm WELL proud of this. :D

What it is;

Well have you ever had people /part'ing your channel? /hop'ing your channel? Generally spamming your channel that way? Well with this you needn't worry about !kb'ing or trying to mode #chan +b nick etc. We all know how troublesome it can be to get the nick you need to ban, and with right clicking we can all make mistakes.

This is nearly fully customisable.

!sethop sets the amount of times a user can part a channel in 60 seconds.
!setban sets the amount of time the user will be banned for.

The rest is done automatically.

!sethop 0 turns off the protection. Any other number will set it.

!sethop 2
!setban 10

This will allow 2 parts per nick, on the 3rd it will ban, giving information on why s/he is banned. 10 seconds after the ban is placed, the ban will be removed. If anything is missing just say so and I will add it. (Y).

on *:TEXT:!sethop*:#: {
  if ($nick !isop #) && ($nick !ishop #) { notice $nick Only halfop's can set the hopping allowance for $chan $+ . }
  elseif ($nick isop #) || ($nick ishop #) && ($2 !isnum) { 
    notice $nick Please choose a number for the amount of timer a user can hop in 1 minute.
  }
  elseif ($nick isop #) || ($nick ishop #) && ($2 isnum) {
    if ($2 == 0) {
      set %hop.mode [ $+ [ $chan ] ] off
      msg $chan { Hop protection for $chan has been disabled. }
    }
    elseif ($2 > 0) {
      set %hop.mode [ $+ [ $chan ] ] on
      set %hop.allowance [ $+ [ $chan ] ] $2
      msg $chan { The hopping allowance for $chan has been set to $2 hop/s per user. }
    }
  }
  else { 
    notice $nick Unknown error. Please make sure you have followed the syntax; !sethop <number>. Remember you need to be a halfop or an op to use !sethop.
  }
}

on *:TEXT:!setban*:#: {
  if (%hop.mode [ $+ [ $chan ] ] == off) { 
    notice $nick Hop protection for $chan has been disabled. A ban length will not be set.
    halt
  }
  elseif (%hop.mode [ $+ [ $chan ] ] == on) && ($nick isop #) || ($nick ishop #) && ($2 !isnum) { 
    notice $nick Please chose a number (In seconds) to hold a ban on a banned user for hop protection.
  }
  elseif (%hop.mode [ $+ [ $chan ] ] == on) && ($nick isop #) || ($nick ishop #) && ($2 isnum) {
    set %ban.timer $2
    msg $chan The amount of time a user will remain banned on $chan for hopping is $2 seconds.
  }
}

on *:PART:#: {
  if (%hop.mode [ $+ [ $chan ] ] == off) { halt }
  elseif (%hop.mode [ $+ [ $chan ] ] == on) && (%hop.allowance [ $+ [ $chan ] ] == %hop.check [ $+ [ $nick ] ]) {
    ban $+(-,ku,$calc(%ban.timer * 1)) $chan $nick Hop protection for $chan is on. You are only allowed to hop %hop.allowance [ $+ [ $chan ] ] time/s per 60 seconds.
    unset %hop.check [ $+ [ $nick ] ]
    halt
  }
  elseif (%hop.mode [ $+ [ $chan ] ] == on) && (%hop.check [ $+ [ $nick ] ] == $null) {
    set %hop.check [ $+ [ $nick ] ] 0
    inc %hop.check [ $+ [ $nick ] ]
    timerunset $+ $nick $+ $chan 1 60 unset %hop.check [ $+ [ $nick ] ]
  }
  elseif (%hop.mode [ $+ [ $chan ] ] == on) && (hop.check [ $+ [ $nick ] ] != %hop.mode [ $+ [ $chan ] ]) {
    inc %hop.check [ $+ [ $nick ] ]
  }
}

Comments

Sign in to comment.
Mushufasa   -  Jul 29, 2007

Yeah...Working my way slowly to get a better scripter. :p Ahuno...Spose it aint all that bad for a 16 year old kid that doesn\'t have too much time for this sort of thing although I do love the stuff. mIRC help directory...Here I come. xD

 Respond  
Noutrious   -  Jul 28, 2007

Nice, like it, just i would use ini\'s instead of variables.

 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.