Bonjour ici.
Je tente de faire un système qui connectera un pseudo-bot via un socket. Sauf que j'ai un bug vraiment étrange avec la variable de configuration:
Voici l'erreur:
Je tente de faire un système qui connectera un pseudo-bot via un socket. Sauf que j'ai un bug vraiment étrange avec la variable de configuration:
tcl
namespace eval sockegg {
set egg(clone1) {
nick "clone1"
realname "I am a clone"
identd "bwaaa"
serv "irc.zeolia.net"
port 6667
host "I.am.a.clone"
idx 0
}
variable bot
bind dcc - "clone" [namespace current]::come
proc come { i f a } {
[namespace current]::connect clone1 $a
}
proc connect {nick chan} {
array set ::sockegg::bot $::sockegg::egg($nick)
putlog "Going to $::sockegg::bot(serv)"
set mserver $::sockegg::bot(serv)
set mport $::sockegg::bot(port)
putlog "Connection to $mserver $mport"
set ::sockegg::bot(idx) [connect $mserver $mport]
control $::sockegg::bot(idx) $chan
putdcc $::sockegg::bot(idx) "USER $::sockegg::bot(nick) 0 0 :$::sockegg::bot(realname)"
putdcc $::sockegg::bot(idx) "NICK $::sockegg::bot(nick)"
}
bind dcc - "unclone" [namespace current]::go
proc go {i f a} {
array set ::sockegg::bot $::sockegg::egg($nick)
killdcc $::sockegg::bot(idx)
set ::sockegg::bot(idx) 0
}
}
Voici l'erreur:
Citation :.clone #testDonc, d'où me sort-il ce ::sockegg::egg(irc.zeolia.net) ?
[15:46:56] Going to irc.zeolia.net
[15:46:56] Connection to irc.zeolia.net 6667
[15:46:56] Tcl error [::sockegg::come]: can't read "::sockegg::egg(irc.zeolia.net)": no such element in array
.set errorInfo
[15:47:12] tcl: builtin dcc call: *dcc:set CrazyCat 24 errorInfo
[15:47:12] #CrazyCat# set errorInfo
Currently: can't read "::sockegg::egg(irc.zeolia.net)": no such element in array
Currently: while executing
Currently: "array set ::sockegg::bot $::sockegg::egg($nick)"
Currently: (procedure "connect" line 2)
Currently: invoked from within
Currently: "connect $mserver $mport"
Currently: (procedure "::sockegg::connect" line 7)
Currently: invoked from within
Currently: "[namespace current]::connect clone1 $a"
Currently: (procedure "::sockegg::come" line 2)
Currently: invoked from within
Currently: "::sockegg::come $_dcc1 $_dcc2 $_dcc3"