bind ctcp F "*DCC*" fd:chataccept
proc fd:chataccept { nick uhost hand dest key text } {
if {[string match "*chat*" [string tolower $text]]} {
set idx [hand2idx $hand]
# -- why $idx is -1 ???? How can I take the idx of this connection?
# Here is my problem
set fd(_$hand) 1
# How can I set a variable which has another variable in it and how
# can I call this?
# putlog "${fd(_$hand)" returns error
set a [connect [lindex [split $uhost @] 1] [lindex [split $text] 3]]
control $a fd:chat_control
}
}
$idx is -1 since idx does not exist yet, $idx is an "indetificator" of a dcc/telenet connection, and since the user is not connected through dcc/telenet in you script idx will always return -1
the format var(something) is known as arrays in tcl, see more about arrays here