All pastes #276006 Raw Edit

Someone

public text v1 · immutable
·published 2006-12-11 23:09 UTC
rendered paste body
proc new:user {nick uhost hand chan text} {
 set arg [lindex [split $text] 0]
 set rank [lindex [split $text] 1]
 switch -- $arg {
  "" { putserv "PRIVMSG $chan : Syntax is: .new <handle> <rank>"; return }
  default { adduser $arg; putserv "PRIVMSG $chan : Added user $arg" }
 }

 switch -- $rank {
  A - 10 { set flag A }
  B - 09 - 9 { set flag B }
  C - 08 - 8 { set flag C }
  D - 07 - 7 { set flag D }
  E - 06 - 6 { set flag E }
  default { putserv "PRIVMSG $chan :$rank didn't match any ranks !"; return }
 }

 chattr $arg +$flag
 putserv "PRIVMSG $chan :Set flag $rank for user $arg"

}