All pastes #92088 Raw Edit

Untitled

public text v1 · immutable
#92088 ·published 2006-07-19 05:49 UTC
rendered paste body
on *:TEXT:@adduser*:#:{ 
 if ($3 >= 500) { notice $nick You cannot give users access greater than or equal to your own. | halt }
  if ($level($address($2,2)) > 1) { notice $nick $2 is already on the user list (with $level($address($2,2)) access). | halt }
  if ($3 >= $ulevel) { notice $nick You cannot give users access greater than or equal to your own. | halt }
  if ($2 == $nick) { notice $nick You cannot change your own access. | halt }
  if ($2 == $null) { notice $nick $1 requires more parameters. | halt }
  if ($3 == $null) { notice $nick $1 requires more parameters. | halt }
  if ($3 == 0) { notice $nick 0 is an invalid access level. | halt }
   guser $3 $2 2 | notice $nick Added $2 to the user list with $3 access. }

on *:TEXT:@clvl*:#:{ 
 if ($3 >= 500) { notice $nick You cannot give users access greater than or equal to your own. | halt }
  if ($3 >= $ulevel) { notice $nick You cannot give users access greater than or equal to your own. | halt }
  if ($2 == $nick) { notice $nick You cannot change your own access. | halt }
  if ($2 == $null) { notice $nick $1 requires more parameters. | halt }
  if ($3 == $null) { notice $nick $1 requires more parameters. | halt }
  if ($3 == 0) { notice $nick 0 is an invalid access level. | halt }
   guser $3 $2 2 | notice $nick $2 now has $3 access. }
    
on *:TEXT:@deluser*:#:{
   if ($2 == $null) { notice $nick $1 requires more parameters. | halt }
   if ($2 == $nick) { notice $nick You cannot remove your own access. | halt }
   if ($level($address($2,2)) >= $ulevel) { notice $nick You cannot delete users with access greater than or equal to your own. | halt }
     ruser $2 2 | notice $nick Deleted $2 from the user list. }

on *:TEXT:@delme*:#:{
  if ($ulevel == 1) { notice $nick You are not on the user list. | halt }
    ruser $nick 2 | notice $nick You have deleted yourself from the user list. }

on 2:TEXT:@resync*:#:{ saveini | notice $nick Synchronized users with the user list. }

 
on *:TEXT:@users:#:{
 notice $nick Access Account
 var %i = 1
 while ($readini(remote.ini,users,$ini(remote.ini,users,%i))) {
 var %a = $gettok($readini(remote.ini,users,$ini(remote.ini,users,%i)),1,$asc(:))
 var %b = $gettok($readini(remote.ini,users,$ini(remote.ini,users,%i)),2-,$asc(:))
 notice $nick %a - %b $iif($ial(%b).nick != $null,$ial(%b).nick)
 inc %i
 }
}
on *:TEXT:@a*:#:{
 if ($1 == @a) || ($1 == @access) {
 if ($2 == $null) {
  notice $nick $nick ( $+ $address($nick,2) $+ ) $iif($ulevel == 1,lacks,has $ulevel) access.
  halt
 }
 if (* !isin $2) {
 if ($ial($2) == $null) {
  notice $nick User with nick $2 does not exist.
 }
 else notice $nick $2 ( $+ $address($2,2) $+ ) $iif($level($address($2,2)) == 1,lacks, has $v1) access.
 }
 if (* isin $2) {
 notice $nick $2 $iif($ial($2).nick,$chr(40) $+ $v1 $+ $chr(41)) $iif($level($2) == 1,lacks,has $v1) access.
}
}