;@@@
;@@@ DreamBot IRC Bot 5.4
;@@@ File description: kick protection
;@@@ Design & coding: DreamBot development team
;@@@ (C) Copyright 2004-2006 DreamBot development team. All rights reserved. 
;@@@

on 500:text:*kp*:#: {
  if ($1 == %c $+ kp) {
    if ($2 == $null) { .msg $nick Command incomplete. Syntax: %c $+ kp <on|off>. | halt }
    if ($2 !== $null) {
      if ($2 == on) { .enable #kick | .msg $nick The Kick protection is now on. | halt }
      if ($2 == off) { .disable #kick | .msg $nick The Kick protection is now off. | halt }
      else { .msg $nick $cl Error: Invalid parameters. Available parameters: ON/OFF. | halt }
    }
  }
}
on 500:text:kp*:?: {
  if ($2 == $null) { .msg $nick Command incomplete. Syntax: /msg $me kp <on|off>. | halt }
  if ($2 !== $null) {
    if ($2 == on) { .enable #kick | .msg $nick The Kick protection is now on. | halt }
    if ($2 == off) { .disable #kick | .msg $nick The Kick protection is now off. | halt }
    else { .msg $nick $cl Error: Invalid parameters. Available parameters: ON/OFF. | halt }
  }
}
#kick on
on @1:kick:#: {
  if ($nick == $me) { halt }
  if ($level($mask($address($nick,2),2)) < $level($mask($address($knick,2),2))) { .mode $chan -o+b $nick $mask($address($nick,2),2) | kick $chan $nick >>> Illegal kick. | .invite $knick $chan }
  else { halt }
}
#kick end
