alias -l con.trap return *kurt*@*,*kurt*!*@*,*Wisteso*@*,*@*
alias f5 $iif($group(#ontrap) == on,disable,enable) #ontrap
#ONTRAP off
alias con.match { 
  if ($2 !isnum $+(1-,$numtok($con.trap,44))) var %x = $2
  var %n = 1
  while ($gettok($con.trap,%n,44)) {
    var %m = $v1
    if (%m iswm $1) return $v1
    inc %n
  }
  return
}
#ONTRAP end

on ^*:snotice:*:{
  if (*connect* iswm $1-) {
    if ($($+(%,$network,.defaction),2)) {
      inc -u60 $+(%,$network,.defkills)
      kill $9 NIGGA, FUCK YOU. $+([,$($+(%,$network,.defkills),2),])
      halt
    }
    if ($group(#ontrap) == on) {
      var %nick = $9,%addy = $mid($10,2,$calc($len($10) - 2))
      if ($con.match(%nick)) || ($con.match(%addy)) { 
        if (!$istok(Dan termina animret ardnew steve steven,%nick,32)) {
          .timer 1 1 _trap %nick 250
        }
      }
    }
    inc -u10 $+(%,$network,.cons)
    if ($($+(%,$network,.cons),2) >= 5) {
      inc -u10 $+(%,$network,.defcon)
      ; echo Set defcon check to $($+(%,$network,.defcon),2) $+ /3
      if ($($+(%,$network,.defcon),2) >= 3) { 
        unset $+(%,$network,.*def*)
        set -u120 $+(%,$network,.defaction) $true
        echo 04 -a ! Defcon enabled on $+(,$network,) for 120 seconds!
      }     
    }
  }
}

alias cbar {
  if ($wildtok($1-,l=*,1,32)) var %length = $gettok($v1,2,61)
  if ($wildtok($1-,c1=*,1,32)) var %c1 = $gettok($v1,2,61)
  if ($wildtok($1-,c2=*,1,32)) var %c2 = $gettok($v1,2,61)
  if ($wildtok($1-,f=*,1,32)) var %fill = $gettok($v1,2,61)
  if ($calc(%length - %fill) <= 0) var %xfill = 0
  else var %xfill = $calc(%length - %fill)
  if (%fill) && (%c1) && (%c2) && (%xfill) {
    return  $+ $+(%c1,$chr(44),%c1) $+ $str(_,%fill) $+  $+ $+(%c2,$chr(44),%c2) $+ $str(_,%xfill)
  }
}
alias rev {
  var %n = $len($1-)
  while (%n) {
  }
}
