All pastes #400903 Raw Edit

Stuff

public text v1 · immutable
·published 2007-03-19 00:05 UTC
rendered paste body
on *:TEXT:*:?:{
  if ($1 == @login) {
    if ($readini(users.ini,users,$2)) && ($3 == $gettok($readini(users.ini,users,$2),1,32)) {
      if ($gettok($readini(users.ini,users,$2),2,32) == 1) {
        msg $nick Welcome $2 Your commands are %ownercommands
      }
      if ($gettok($readini(users.ini,users,$2),2,32) == 2) {
        msg $nick Welcome $2 Your commands are %admincommands
      }
      if ($gettok($readini(users.ini,users,$2),2,32) == 3) {
        msg $nick Welcome $2 Your commands are %nobodycommands
      }
    }
  }
  elseif ($1 == @register) && ($3) && (!$readini(users.ini,users,$2)) {
    writeini users.ini users $2 $3 3
    msg $nick You are now registered with username $2 password $3 and you are a nobody
  }
  elseif (!$3) {
    msg $nick The correct syntax is @register username password
  }
  elseif ($readini(users.ini,users,$2)) {
    msg $nick You are already registered
  }
}
elseif ($1 == @addcmd) && ($gettok($readini(users.ini,users,$nick),2,32) == 1) && ($4) {
  if ($2 == 1) {
    set %ownercommands $iif(%ownercommands,$v1 $3,$3) 
  }
  if ($2 == 2) {
    set %admincommands $iif(%admincommands,$v1 $3,$3)
  }
  if ($2 == 3) {
    set %nobodycommands $iif(%nobodycommands,$v1 $3, $3)
  }
  set % $+ $2 $+ . $+ $3 $4-
  msg $nick I have set $3 to $4- for $2
}
elseif ($gettok($readini(users.ini,users,$nick),2,32) != 1) {
  msg $nick You do not have enough access Your access is $iif($gettok($readini(users.ini,users,$2),2,32),$v1,0)
}
elseif (!$4) {
  msg $nick The correct syntax is @addcmd (1,2,3) command text
}
var %tmp1 1
while (%tmp1 <= $var(%1.*,0)) {

  if ($1 == $right($var(%1.*,%tmp1),-3)) {

    msg $nick $var($eval($eval(%1.,0) $+ $1,1),1).value
  }
  inc %tmp1
}
var %tmp2 1
while (%tmp1 <= $var(%2.*,0)) {

  if ($1 == $right($var(%2.*,%tmp1),-3)) {

    msg $nick $var($eval($eval(%2.,0) $+ $1,1),1).value
  }
  inc %tmp2
}