| View previous topic :: View next topic |
| Author |
Message |
uffs Voice
Joined: 17 Apr 2008 Posts: 14 Location: 6°10.5S-106°49.7E
|
Posted: Sat Jan 17, 2009 1:33 am Post subject: need help change dcc to pub command |
|
|
hi..
I found small script to check tcl script before we running "rehash" command.. (to known the scripts error or no)
here's the code | Code: | bind dcc n chk script:load
proc script:load { handle idx text } {
if { [catch { uplevel #0 [list source scripts/$text.tcl] } error] } {
putlog "Error While Loading $text -- Errormsg: $error"
putlog "script: $text -- ::errorInfo: $::errorInfo"
return
}
putlog "script: <$text> -- Loaded Without Error.."
return
} |
how I make those code so it will be running on public command and display the result on the room chan.
Thanks for your help  |
|
| Back to top |
|
 |
tomekk Master

Joined: 28 Nov 2008 Posts: 255 Location: Oswiecim / Poland
|
Posted: Tue Jan 20, 2009 7:44 am Post subject: |
|
|
try:
| Code: | bind pub -|- chk script_check
proc script_check { nick uhost hand chan arg } {
set the_name [lindex [split $arg] 0]
if {[catch {uplevel #0 [list source scripts/$the_name.tcl]} error]} {
putquick "PRIVMSG $chan :Error While Loading $the_name -- Errormsg: $error"
putquick "PRIVMSG $chan :script: $the_name -- ::errorInfo: $::errorInfo"
return
}
putquick "PRIVMSG $chan :script: <$the_name> -- Loaded Without Error.."
}
putlog "chk-script.tcl loaded"
|
| Quote: | 12:43:11 <@tomekk> chk chk-script
12:43:13 < botty> script: <chk-script> -- Loaded Without Error..
|
| Quote: | 12:43:36 <@tomekk> chk chk-script
12:43:36 < botty> Error While Loading chk-script -- Errormsg: invalid command name "}"
12:43:36 < botty> script: chk-script -- ::errorInfo: invalid command name "}"
|
|
|
| Back to top |
|
 |
|