All pastes #819055 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-12-16 19:13 UTC
rendered paste body
set vPubchar "."

proc pPubchar {} {
  global vPubchar
  return $vPubchar
}

bind PUB lo|lo [pPubchar]add pAdduser

proc pAdduser {nick uhost hand chan text} {
  set arguments [split [string trim $text]]
  switch -- [llength $arguments] {
    1 {
      set who [join [lindex $arguments 0]]
      if {[onchan $who]} {
        set host *!*@[join [lindex [split [getchanhost $who] @] 1]]
        adduser $who $host
      } else {putserv "PRIVMSG $chan :$nick is not on a bot channel"}
    }
    2 {
      set who [join [lindex $arguments 0]]
      set host [join [lindex $arguments 1]]
      adduser $who $host
    }
    default {putserv "PRIVMSG $chan :correct syntax is [pPubchar] <nick> ?hostmask?"}
  }
}