3 return [expr {!![string length
$text]}]
8 if {[string length
$text]} { error "too many parameters" }
13 if {![regexp {^
([^
]+) *(.
*)} $text dummy firstword
text]} {
14 error "too few parameters"
26 proc usererror
{emsg
} { error $emsg {} {BLIGHT USER
} }
28 proc go_usercommand
{p c n dest
text} {
29 regsub {^
! *} $text {} text
31 set procname ucmd
/[string tolower
$ucmd]
32 if {[catch { info body
$procname }]} {
33 usererror
"Unknown command; try help for help."
38 proc execute_usercommand
{p c n output dest
text} {
41 go_usercommand
$p $c $n $dest $text
43 if {"$errorCode" != "BLIGHT USER"} { set rv
"error: $rv" }
46 manyset
$rv priv_msgs pub_msgs priv_acts pub_acts
47 foreach {td val
} [list $n $priv_acts $output $pub_acts] {
48 foreach l
[split $val "\n"] {
49 sendaction_priority
0 $td $l
52 foreach {td val
} [list $n $priv_msgs $output $pub_msgs] {
53 foreach l
[split $val "\n"] {
60 proc def_ucmd
{cmdname body
} {
61 proc ucmd
/$cmdname {p dest
} " upvar 1 text text\n$body"
64 proc ucmdr
{priv pub args
} {
65 return -code return [concat [list $priv $pub] $args]
69 global errorInfo errorCode
72 catch { unset calling_nick
}