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 ta_interval_optional {min def} {
29 return [parse_interval [ta_word] $min]
35 proc usererror {emsg} { error $emsg {} {BLIGHT USER} }
37 proc go_usercommand {p c n dest text} {
38 regsub {^! *} $text {} text
40 set procname ucmd/[string tolower $ucmd]
41 if {[catch { info body $procname }]} {
42 usererror "Unknown command; try help for Help."
47 proc execute_usercommand {p c n output dest text} {
50 go_usercommand $p $c $n $dest $text
52 if {"$errorCode" != "BLIGHT USER"} { set rv "error: $rv" }
55 manyset $rv priv_msgs pub_msgs priv_acts pub_acts
56 foreach {td val} [list $n $priv_acts $output $pub_acts] {
57 foreach l [split $val "\n"] {
58 sendaction_priority 0 $td $l
61 foreach {td val} [list $n $priv_msgs $output $pub_msgs] {
62 foreach l [split $val "\n"] {
69 proc def_ucmd {cmdname body} {
70 proc ucmd/$cmdname {p dest} " upvar 1 text text\n$body"
73 proc ucmdr {priv pub args} {
74 return -code return [concat [list $priv $pub] $args]
78 global errorInfo errorCode
81 catch { unset calling_nick }