I seem to be haveing trouble on this switch command, I'm not real good at them, so i thought maybe someone could point out my mistake.
This script is just setup to send a file on a trigger but this is the error form the bot
Tcl error [dbzxsf:!tcl]: wrong # args: should be "switch ?switches? string pattern body ... ?default body?"
now here's the code
#set commands
set dbzx_sf(!tcl) doc/tcl-commands.doc
#Routines
#This Sends helpful files
foreach buffer [array names dbzx_sf] {
set buffer2 [string tolower $buffer]
set dbzx_sf($buffer2) $dbzx_sf($buffer)
set buffer $buffer2
bind pubm - "% $buffer" dbzxsf:$buffer
proc dbzxsf:$buffer {nick uhost hand chan args} {
global dbzx_sf
switch -- [dccsend $dbzx_sf([set trigger [string tolower [lindex [lindex $args 0] 0]]]) $nick]
0 {putnot $nick ":Sending $trigger's info to you."}
1 {putnot $nick ":dcc table is full (too many connections)."}
2 {putnot $nick ":can't open a socket for the transfer."}
3 {putnot $nick ":file doesn't exsist."}
4 {putnot $nick ":$trigger's info was queued for last transfer."}
}
}
I'm uesing the tcl comamnds.doc file for testing i get an error saying the switch is [censored] up ( bascily ) but when i change it from Switch -- to Switch --- it sends the file, but i get this error
Tcl error [dbzxsf:!tcl]: bad option "---": must be -exact, -glob, -regexp, or --
any suggestions on where i messed up ?