Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Test d'egg socket
- 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 ::sockegg::bot(idx) [connect $::sockegg::bot(serv) $::sockegg::bot(port)]
- 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
- }
- }
- # .clone #test
- # [14:32:26] Going to irc.zeolia.net
- # [14:32:26] Tcl error [::sockegg::come]: can't read "::sockegg::egg(irc.zeolia.net)": no such element in array
Add Comment
Please, Sign In to add comment