Guest User

Untitled

a guest
Jun 26th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 1.08 KB | None | 0 0
  1. # Test d'egg socket
  2.  
  3. namespace eval sockegg {
  4.    
  5.     set egg(clone1) {
  6.         nick "clone1"
  7.         realname "I am a clone"
  8.         identd "bwaaa"
  9.         serv    "irc.zeolia.net"
  10.         port    6667
  11.         host    "I.am.a.clone"
  12.         idx 0
  13.     }
  14.    
  15.     variable bot
  16.    
  17.     bind dcc - "clone" [namespace current]::come
  18.     proc come { i f a } {
  19.         [namespace current]::connect clone1 $a
  20.     }
  21.    
  22.     proc connect {nick chan} {
  23.         array set ::sockegg::bot $::sockegg::egg($nick)
  24.         putlog "Going to $::sockegg::bot(serv)"
  25.         set ::sockegg::bot(idx) [connect $::sockegg::bot(serv) $::sockegg::bot(port)]
  26.         control $::sockegg::bot(idx) $chan
  27.         putdcc $::sockegg::bot(idx) "USER $::sockegg::bot(nick) 0 0 :$::sockegg::bot(realname)"
  28.         putdcc $::sockegg::bot(idx) "NICK $::sockegg::bot(nick)"
  29.     }
  30.    
  31.     bind dcc - "unclone" [namespace current]::go
  32.     proc go {i f a} {
  33.         array set ::sockegg::bot $::sockegg::egg($nick)
  34.         killdcc $::sockegg::bot(idx)
  35.         set ::sockegg::bot(idx) 0
  36.     }
  37.    
  38. }
  39.  
  40. # .clone #test
  41. # [14:32:26] Going to irc.zeolia.net
  42. # [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