All pastes #577617 Raw Edit

Someone

public text v1 · immutable
·published 2007-06-20 00:08 UTC
rendered paste body
on $*:TEXT:/^[@!]join ?war?/Si:#mmd: {
  var %send = $iif(($left($1,1) == @) && (($nick isop #) || ($nick ishop #)),msg $chan,notice $nick) $+($chr(91),Wars,$chr(93))
  if (!$regex($hget(War,Total),$+(/\b $+ $nick $+ \b/Si))) {
    /hadd -m War Total $hget(War,Total) $nick
    %send You have been added to the current war list. Total of $numtok($hget(War,Total),32) people joined so far.
  }
  else {
    %send The nick $qt($nick) is already active in this war
  }
}

on $*:TEXT:/^[@!]war ?list?/Si:#mmd: {
  var %send = $iif(($left($1,1) == @) && (($nick isop #) || ($nick ishop #)),msg $chan,notice $nick) $+($chr(91),Wars,$chr(93))
  if ($hget(War)) {
    %send Total of $numtok($Hget(War,Total),32) signup $+ $iif($numtok($Hget(War,Total),32) == 1,s) $+ :
    %send $hget(War,Total)
  }
  Else {
    %send No logged nicks currently
  }
}
on $*:TEXT:/^[@!]clear/Si:#mmd: {
  var %send = $iif(($left($1,1) == @) && (($nick isop #) || ($nick ishop #)),msg $chan,notice $nick) $+($chr(91),Wars,$chr(93))
  if ($nick isop $chan) {
    if ($2) {
      if ($regex($hget(War,Total),$+(/\b $+ $2 $+ \b/Si))) {
        hadd -m War Total $remtok($hget(War,Total),$2,1,32)
        %send Successfully deleted $qt($2) from the list
      }
      else {
        %send The nick $qt($2) is not currently on the list
      }
    }
    else {
      hfree War
      %send The list has been cleared completly
    }
  }
}