All pastes #506042 Raw Edit

insul;t

public text v1 · immutable
·published 2007-05-23 20:30 UTC
rendered paste body
; Only reacts on trigger in specified channel(s).
on *:TEXT:*:%Insulter.Channels:{
  if (%Insulter.Status == On) {  
    if (%Insulter.Trigger isin $1) && (!$2) {
      msg $chan Hey $nick $+ , $rndinsult
    }
    elseif (%Insulter.Trigger isin $1) && ($2) {
      if ($2 == $me) {
        msg $chan Hey $nick $+ , $rndinsult and you can't insult me.
      }
      elseif ($2 ison $chan) {
        msg $chan Hey $2 $+ , $rndinsult
      }
      elseif ($2 !ison $chan) {
        msg $chan Hey $nick $+ , $rndinsult and $2 isn't here.
      }
    }
  }
  else { halt }
}

; Commandline support, /insult <nick> to insult specified nick.
; Will return insult without nick if nick not in active channel
; or nothing after /insult
alias insult {
  if ($1) && ($1 ison $active) {
    msg $active $1 $+ , $rndinsult
  }
  elseif (!$1) || ($1 !ison $active) {
    msg $active $rndinsult
  }
}

menu menubar,channel {
  Insulter
  .Settings { insulter }
  .Unload {
    var %x = $?!="Really unload Insulter?"
    if ($!) { unload -rs $insulterfn }
  }
}

menu nicklist {
  .Insult { msg $active $$1 $+ , $rndinsult }
}

on *:LOAD:{
  echo -ta * Insulter has been loaded.
  echo -ta * Type /insulter to activate.
  set %Insulter.Channels $chr(35)
  set %Insulter.Trigger !insult
  set %Insulter.Status On
}

on *:UNLOAD:{
  echo -a Insulter has been unloaded.
  unset %Insulter.*
}


; EOF