All pastes #588758 Raw Edit

Stuff

public text v1 · immutable
#588758 ·published 2007-06-25 17:52 UTC
rendered paste body
on $*:TEXT:/^[`!]warn/Si:#:{
  if ($me isop $chan && $Nick isop $chan) {
    if (on iswm $2) {
      if (%warn [ $+ [ $chan ] ] == $null) || (%warn [ $+ [ $chan ] ] == off) {
        set %warn [ $+ [ $chan ] ] on
        msg $chan Warning System is now turned to ON.
        msg $chan When a user joins the channel, they will be given a Warning Level of 0. When the user gets 3 warnings, they are kick-banned from the channel. An op must remove this ban in order for the user to return.
        msg $chan To deactivate the Warning System, simply type `warn off.
        halt
      }
      elseif (%warn [ $+ [ $chan ] ] == on) {
        .msg $chan The Warning System is already on.
        halt
      }
    }
    if (off iswm $2) {
      if (%warn [ $+ [ $chan ] ] == on) {
        set %warn [ $+ [ $chan ] ] off
        msg $chan Warning System is now turned to OFF.
        msg $chan To reactivate the Warning System, please type `warn on.
        halt
      }
      elseif (%warn [ $+ [ $chan ] ] == off) {
        .msg $chan The Warning System is already turned off.
        halt
      }
    }
    else {
      if (%warn [ $+ [ $chan ] ] == on) {
        if ($me isop $chan) && (($nick isop #) || ($nick ishop #)) {
          inc %warn [ $+ [ $2 ] ]
          if (%warn [ $+ [ $2 ] ] < 3) {
            msg $chan $2 has been warned. $2's current warning level is %warn [ $+ [ $2 ] ] $+ .
            msg $chan $2 has $calc( 3 - %warn [ $+ [ $2 ] ] ) more warns before they are banned.
            notice $2 You've been warned %warn [ $+ [ $2 ] ] times. 3 warns, and you're out.
          }
          if (%warn [ $+ [ $2 ] ] == 3) {
            msg $chan $2 has been warned enough times. Now for a kickban ^^
            .ban -k # $2 You've been warned enough. You're gone
            set %warn [ $+ [ $2 ] ] 0
          }
        }
      }
    }
  }
}
on $*:TEXT:/^[`!]clearwarn/Si:#:{
  if ($nick isop $chan || $nick ishop $chan) {
    if (%warn [ $+ [ $2 ] ] isnum) {
      set %warn [ $+ [ $2 ] ] 0
      msg $chan $2 $+ 's Warning Level has been reset. Current Warning Level is %warn [ $+ [ $2 ] ] $+ .
      notice $2 Your Warning Level has been reset. Current Warning Level is %warn [ $+ [ $2 ] ] $+ .
    }
  }
}
on *:JOIN:#:{
  if (%warn [ $+ [ $chan ] ] == on) {
    if ($nick == $me) { halt }
    if (%warn [ $+ [ $nick ] ] == $null) {
      set %warn [ $+ [ $nick ] ] 0
      notice $nick your current warning level is %warn [ $+ [ $nick ] ]
    }
    else {
      msg % $+ $chan $nick $+ 's current warn level is %warn [ $+ [ $nick ] ]
    }
  }
}
on $*:TEXT:/(shit|piss|fuck|fuk|damn|ass|bitch|whore|slut|skank)/Si:#:{
  if (%warn [ $+ [ $chan ] ] == on) {
    inc %warn [ $+ [ $nick ] ]
    msg $chan $nick has been warned for their language. Current warn level is %warn [ $+ [ $nick ] ] $+ . Warns to ban: $calc( 3 - %warn [ $+ [ $nick ] ] ) $+ .
    notice $nick You've been warned for your language.. You've $calc( 3 - %warn [ $+ [ $nick ] ] ) warns left until you are banned.
  }
}