<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/10914" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2008-06-13T15:53:17-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/10914</id>

		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2008-06-13T15:53:17-04:00</updated>

		<published>2008-06-13T15:53:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83517#p83517</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83517#p83517"/>
		<title type="html"><![CDATA[[need help] TeamSpeak Info v2.0]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83517#p83517"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set users1 [regexp {\d\t(\d+?)\t[\d|\t]+?\t".+?"\t"(.+?)"\t"(.*?)"\t} [lindex $ts(plines) $i] {\1\2\3} input nik Name] </code></pre></div>This is your problem. Understanding how regexp works helps a bit. The regexp will compare it's pattern against $ts(plines). But not the entire contents of $ts(plines) only the lindex position represented by the variable $i.<br><br>If this lindex position matches the pattern within the regexp it will transpose these values into the variables input, nik, and name. If this regexp pattern is successful users1 will be set to 1 (which is stupid because this script never uses the users1 variable again). The values caught by the regexp patterns will be transposed to the variables.<br><br>If this regexp pattern fails users1 will be set to 0 (again for no reason). The values caught by the regexp patterns will not be transposed to the variables, if these variables existed prior to processing this regexp their values will remain what they were before. If these variables didn't exist prior to processing this regexp they shall not be created as well.<div class="codebox"><p>Code: </p><pre><code>[21:31] Tcl-Fehler [TS:control]: can't read "nik": no such variable</code></pre></div>Which is exactly why nik is not a variable, the regexp has failed and value transposition/variable creation did not take place...<br><br>To solve this requires doing as De Kus has already stated. Either fixing the  source text which this script parses, or fixing this script to parse altered source text.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Fri Jun 13, 2008 3:53 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Syntax1980]]></name></author>
		<updated>2008-06-13T15:37:46-04:00</updated>

		<published>2008-06-13T15:37:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83516#p83516</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83516#p83516"/>
		<title type="html"><![CDATA[[need help] TeamSpeak Info v2.0]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83516#p83516"><![CDATA[
Thanks,<br><br><br>I now have the error as above! How or what do I need to change so that it works my English is not so good<br><br><div class="codebox"><p>Code: </p><pre><code>[21:31] Tcl-Fehler [TS:control]: can't read "nik": no such variable</code></pre></div>Problem..<br><br>line: 352 //      <div class="codebox"><p>Code: </p><pre><code>set users1 [regexp {\d\t(\d+?)\t[\d|\t]+?\t".+?"\t"(.+?)"\t"(.*?)"\t} [lindex $ts(plines) $i] {\1\2\3} input nik Name] </code></pre></div>or<br><br>line 371/372/373<div class="codebox"><p>Code: </p><pre><code>lappend channeloutput  $nik $test14         incr i     }</code></pre></div>I must rename nik in nick ?<br><br><br>THx<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9990">Syntax1980</a> — Fri Jun 13, 2008 3:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2008-06-13T14:56:59-04:00</updated>

		<published>2008-06-13T14:56:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83514#p83514</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83514#p83514"/>
		<title type="html"><![CDATA[[need help] TeamSpeak Info v2.0]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83514#p83514"><![CDATA[
<blockquote class="uncited"><div>Hello,<br><br>i have similar mistake ! <br><div class="codebox"><p>Code: </p><pre><code>Tcl error [TS:start]: invalid command name "b"</code></pre></div>my tcl with my data (Thanks for Help)<br></div></blockquote>LMAO... it's php forum bbcode, that's supposed to make things bold (normally, but not within code tags). It's safe to remove the <strong class="text-strong">..heh</strong><div class="codebox"><p>Code: </p><pre><code>#changecontrol $sock [b]TS:control #intocontrol $sock TS:control </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Fri Jun 13, 2008 2:56 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Syntax1980]]></name></author>
		<updated>2008-06-13T14:43:16-04:00</updated>

		<published>2008-06-13T14:43:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83513#p83513</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83513#p83513"/>
		<title type="html"><![CDATA[[need help] TeamSpeak Info v2.0]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83513#p83513"><![CDATA[
Hello,<br><br>i have similar mistake ! <br><div class="codebox"><p>Code: </p><pre><code>Tcl error [TS:start]: invalid command name "b"</code></pre></div>my tcl with my data (Thanks for Help)<br><div class="codebox"><p>Code: </p><pre><code>###################################################  Teamspeak v2.0                                ##    Author: PezCore aka DieSucker               ##  Tested on Eggdrop v1.6.17                     ####################################################                                                ##                                                ##                                                ## This is a TCL Script designed to query a       ## TeamSpeak server and post the nick and their   ## time one the server into a channel.            ## 3/30/2005 v2.0 - Added channels list           ##                  Server info                   ##                  cleaned up some outputs       ## 3/20/2005 v1.2 - Added multi-server support    ## 3/11/2005 v1.1 - Fixed The server time out     ##                  it now gives an error if the  ##                  server is offline or you      ##                  give a BAD IP/PORT. It will   ##                  take a minute for the it to   ##                  time-out                      ## 2/23/2005 v1.0 - rewrote most of the script    ## 8/13/2004 v0.9 - Intial script by Vitto        ## Many THANKS goes to MC_8                       ## If you need me, #donuthole on irc.protium.org  ## or email me diesucker@kc.rr.com                ##                                                ## Things-To-Do: Maybe add an HTML setting        ##               Also add/delete servers          ###################################################array unset ts_server# Configuration:# Set here a list of TeamSpeak servers, and there information.# Specify as many ts_server(&lt;short_name&gt;)'s as you need.# Syntax:#   set ts_server(&lt;short_name&gt;) [list "&lt;full name&gt;" "&lt;ip&gt;" "&lt;port&gt;" "&lt;tcpquery&gt;"]#set ts_server(TEST) [list "TCTS" "84.201.42.164" "12819" "32800"]set ts_server(mxb) [list "TCTS" "84.201.42.164" "12819" "32800"]#####################################################################################################Coding, Please don't edit below##############################################################################################################################unset -nocomplain Nameunset -nocomplain Valueforeach {Name Value} [array get ts_server] {  array unset ts_server $Name  array set ts_server [list [string tolower $Name] $Value]}unset -nocomplain Nameunset -nocomplain Value#Public Bindingbind pub - !ts TS:startbind pub - !tsc TS:channelsbind pub - !tsi TS:serverinfobind pub - !tsservers TS:serversbind pub - !tshelp TS:helpproc TS:servers {nick uhost handle channel text} {  set list [array names ::ts_server]  if {![llength $list]} {    putserv "PRIVMSG $channel :\0034,0There are no TeamSpeak servers currently defined, sorry."  } else {    putserv "PRIVMSG $channel :\0034,0List of availble TeamSpeak servers:\0033,0 [join $list ", "]"  }}#######Grabbing Server Info#############proc TS:serverinfo {nick uhost handle channel text} {   global ts   set text [string tolower $text]   if {$text == ""} {     putserv "PRIVMSG $channel :\0034,0Sorry, please specify a valid server selection. Use !tsservers to find supported servers"     return 0   }   if {[lsearch -exact [array names ::ts_server] $text] == "-1"} {     putserv "PRIVMSG $channel :\0034,0 Sorry, '$text' isn't a valid server selection. Please us !tsservers to find supported servers"     return 0   }   foreach {ts(servername) ts(ip) ts(port) ts(tcpquery)} $::ts_server($text) break   set sock [connect $ts(ip) $ts(tcpquery)]   close [open "scripts/tsserverinfo.txt" w]   close [open "scripts/tsserverinfo2.txt" w]   set ts(user:$sock) "" ; set ts(count:$sock) 0   set ts(chan:$sock) "" ; set ts(arg:$sock) "$channel"   set ts(arg) "$channel"   set ts(players:$sock) 0   set ts(last:$sock) ""   control $sock TS:servercontrol}proc TS:servercontrol {sock input} {   global ts   if {$input == ""} {     putserv "PRIVMSG $ts(arg) :\0034,0 The TeamSpeak Server has timed-out. Either The TeamSpeak server is offline or an Invalid IP                                   was specified"     return 1   }   if {$ts(last:$sock) == ""} {     if {$input == {[TS]}} {     putdcc $sock "sel $ts(port)"     set ts(last:$sock) sel     return 0    }   }   if {$ts(last:$sock) == "sel"} {     if {$input == "OK"} {       putdcc $sock "si"       set ts(last:$sock) si       return 0     }    }   if {$ts(last:$sock) == "si"} {     if {$input == "OK"} {       putdcc $sock "gi"       set ts(last:$sock) gi       return 0     }   set io2 [open "scripts/tsserverinfo.txt" a]    puts $io2 "$input"; close $io2; return 0   }   if {$ts(last:$sock) == "gi"} {     if {$input == "OK"} {       TS:serverend       return 1     }    set io3 [open "scripts/tsserverinfo2.txt" a]    puts $io3 "$input"    close $io3    return 0    } return 0}proc TS:serverend {} {    global ts    set info [open "scripts/tsserverinfo.txt" r]    set info1 [read -nonewline $info]     close $info    set vers [open "scripts/tsserverinfo2.txt" r]    set vers1 [read -nonewline $vers]    close $vers    file delete -force -- "scripts/tsserverinfo.txt"    set vers2 [split $vers1 "\n"]    set vers3 [lindex $vers2 1]    set vers4 [split $vers3 "="]    set vers5 [lindex $vers4 1]    set info2 [split $info1 "\n"]    set name1 [lindex $info2 1]    set name2 [split $name1 "="]    set name3 [lindex $name2 1]    set welcome1 [lindex $info2 3]    set welcome2 [lindex [split $welcome1 "="] 1]    set max1 [lindex $info2 9]    set max2 [lindex [split $max1 "="] 1]    set plat [lindex $info2 2]    set plat2 [lindex [split $plat "="] 1]    set users [lindex $info2 28]    set users2 [lindex [split $users "="] 1]    set channs [lindex $info2 29]    set channs2 [lindex [split $channs "="] 1]    set uptime [lindex $info2 27]    set uptime2 [lindex [split $uptime "="] 1]    set uptime3 [duration $uptime2]    set uptime5 [split $uptime3 " "]    set uptime4 [llength $uptime5]    if {$uptime4 == "10"} {      set test14 "[lindex $uptime5 0]w[lindex $uptime5 2]d[lindex $uptime5 4]h[lindex $uptime5 6]m"    }    if {$uptime4 == "8"} {      set test14 "[lindex $uptime5 0]d[lindex $uptime5 2]h[lindex $uptime5 4]m"    }    if {$uptime4 == "6"} {      set test14 "[lindex $uptime5 0]h[lindex $uptime5 2]m"    }    if {$uptime4 == "4"} {      set test14 "0h[lindex $uptime5 0]m"    }    if {$uptime4 == "2"} {      set test14 "[lindex $uptime5 0]s"    }    putserv "PRIVMSG $ts(arg) :\0034,0Server Info For\0033,0 $ts(servername)($ts(ip):$ts(port)) :\0031,0 \002Name:\002 $name3 \002Welcome Message:\002 $welcome2 \002Max Users:\002 $max2 \002Platform:\002 $plat2 \002Current users:\002 $users2 \002 Total Channels:\002 $channs2 \002Uptime:\002 $test14 \002Version:\002 $vers5"}#################End Of Server Info#################################################Server channels###################################proc TS:channels {nick uhost handle channel text} {    global ts    if {$text == ""} {      putserv "PRIVMSG $channel :\0034,0Sorry, please specify a valid server selection. Use !tsservers to find supported servers"      return 0    }    set text [string tolower $text]    if {[lsearch -exact [array names ::ts_server] $text] == "-1"} {      putserv "PRIVMSG $channel :\0034,0Sorry, '$text' isn't a valid server selection. Use !tsservers to find supported servers"      return 0    }    foreach {ts(servername) ts(ip) ts(port) ts(tcpquery)} $::ts_server($text) break    set sock [connect $ts(ip) $ts(tcpquery)]    close [open "scripts/tschannels.txt" w]    set ts(user:$sock) "" ; set ts(count:$sock) 0    set ts(chan:$sock) "" ; set ts(arg:$sock) "$channel"    set ts(arg) "$channel"    set ts(players:$sock) 0    set ts(last:$sock) ""    control $sock TS:chancontrol}proc TS:chancontrol {sock input} {    global ts    if {$input == ""} {      putserv "PRIVMSG $ts(arg) :\0034,0 The TeamSpeak Server has timed-out. Either The TeamSpeak server is offline or an Invalid IP                                   was specified"      return 1      }    if {$ts(last:$sock) == ""} {      if {$input == {[TS]}} {      putdcc $sock "sel $ts(port)"      set ts(last:$sock) sel      return 0      }    }    if {$ts(last:$sock) == "sel"} {      if {$input == "OK"} {        putdcc $sock "cl"        set ts(last:$sock) cl        return 0       }   }   if {$ts(last:$sock) == "cl"} {     if {$input == "OK"} {       TS:chanend       return 1       }   set io [open "scripts/tschannels.txt" a]   puts $io "/ $input"   close $io   return 0  } return 0}proc TS:chanend {} {   global ts   set ts(channels1) [open "scripts/tschannels.txt" r]   set ts(channels2) [read $ts(channels1)]   set ts(channels3) [split $ts(channels2) "\n"]   close $ts(channels1)   file delete -force -- "scripts/tschannels.txt"   set ts(channels3) [lreplace $ts(channels3) 0 0]   set ts(channels4) [llength $ts(channels3)]   set ts(channels4) [expr "$ts(channels4) - 1"]   set ts(ch1) [lindex $ts(channels3) 0]   set ts(ch2) [lindex [split $ts(ch1) \t] 5]   set ts(ch3) [lindex [split $ts(ch2) {"}] 1]   set ts(channelsoutput) ": $ts(ch3)"   set j 1   while {$j &lt; $ts(channels4)} {        set ts(channels6) [lindex $ts(channels3) $j]        set ts(channels7) [lindex [split $ts(channels6) \t] 5]        set ts(channels8) [split $ts(channels7) {"}]        set ts(channels9) [lindex $ts(channels8) 1]        append ts(channelsoutput) ", " $ts(channels9)        incr j        }   putserv "PRIVMSG $ts(arg) :\0034,0 Channels on\0033,0 $ts(servername)($ts(ip):$ts(port)):\0036,0($ts(channels4))\0031,0$ts(channelsoutput)"}#############End of channels##################################Users Connected#####################proc TS:start {nick uhost handle channel text} {    global ts    set text [string tolower $text]    if {$text == ""} {      putserv "PRIVMSG $channel :\0034,0Sorry, please specify a valid server selection. Use !tsservers to find supported servers"      return 0     }    if {[lsearch -exact [array names ::ts_server] $text] == "-1"} {      putserv "PRIVMSG $channel :\0034,0Sorry, '$text' isn't a valid server selection. Use !tsservers to find supported servers"      return 0     }    foreach {ts(servername) ts(ip) ts(port) ts(tcpquery)} $::ts_server($text) break    set sock [connect $ts(ip) $ts(tcpquery)]    close [open "scripts/tstester.txt" w]    set ts(user:$sock) "" ; set ts(count:$sock) 0    set ts(chan:$sock) "" ; set ts(arg:$sock) "$channel"    set ts(arg) "$channel"    set ts(players:$sock) 0    set ts(last:$sock) ""    control $sock [b]TS:control}proc TS:control {sock input} {    global ts    if {$input == ""} {      putserv "PRIVMSG $ts(arg) :\0034,0 The TeamSpeak Server has timed-out. Either The TeamSpeak server is offline or an Invalid IP was specified"      return 1    }    if {$ts(last:$sock) == ""} {      if {$input == {[TS]}} {        putdcc $sock "sel $ts(port)"        set ts(last:$sock) sel        return 0      }    }    if {$ts(last:$sock) == "sel"} {      if {$input == "OK"} {        putdcc $sock "pl"        set ts(last:$sock) pl        return 0      }    }    if {$ts(last:$sock) == "pl"} {      if {$input == "OK"} {         TS:end        return 1      }    set io [open "scripts/tstester.txt" a]    puts $io "/ $input"; close $io; return 0    }  return 0}proc TS:end {} {    global ts    set ts(players2) "scripts/tstester.txt"    set ts(players3) [open $ts(players2) r]    set ts(playerdata) [read $ts(players3)]    set ts(plines) [split $ts(playerdata) "\n"]    close $ts(players3)    file delete -force -- "scripts/tstester.txt"    set ltd 0    set ts(plines) [lreplace $ts(plines) $ltd $ltd]    set i [open $ts(players2) w]    puts $i [join $ts(plines) ""]    close $i    set ts(nlines) [llength $ts(plines)]    set ts(lines2) [expr "$ts(nlines) - 1"]    set channeloutput [list ":"]    set i 0    while {$i &lt; $ts(lines2)} {         set users2 [lindex $ts(plines) $i]         set users1 [regexp {\d\t(\d+?)\t[\d|\t]+?\t".+?"\t"(.+?)"\t"(.*?)"\t} [lindex $ts(plines) $i] {\1\2\3} input nik Name]         set test11 [duration [lindex [split $users2 \t] 8]]         set test12 [split $test11 " "]         set test13 [llength $test12]         if {$test13 == "10"} {           set test14 "([lindex $test12 0]w[lindex $test12 2]d[lindex $test12 4]h[lindex $test12 6]m)"         }         if {$test13 == "8"} {           set test14 "([lindex $test12 0]d[lindex $test12 2]h[lindex $test12 4]m)"         }         if {$test13 == "6"} {           set test14 "([lindex $test12 0]h[lindex $test12 2]m)"         }         if {$test13 == "4"} {           set test14 "(0h[lindex $test12 0]m)"         }         if {$test13 == "2"} {           set test14 "([lindex $test12 0]s)"         }         lappend channeloutput  $nik $test14         incr i    }   if {$ts(lines2) == 0} {     putserv "PRIVMSG $ts(arg) :\0034,0There Are NO Users Connected to\0033,0 $ts(servername)($ts(ip):$ts(port))"     } else {           putserv "PRIVMSG $ts(arg) :\0034,0Current Users Connected to \0033,0$ts(servername)($ts(ip):$ts(port)): \0036,0($ts(lines2))\0031,0 $channeloutput"     }}###########End of Users Connected#########################TS Script Help######################proc TS:help {nick uhost handle channel text} {     putserv "NOTICE $nick : TeamSpeak TCL v2.0 "     putserv "NOTICE $nick : Commands :"     putserv "NOTICE $nick : !ts (servername) - returns current users connected"     putserv "NOTICE $nick : !tsi (servername) - returns information for the given server"     putserv "NOTICE $nick : !tsc (servername) - returns channels from the server"     putserv "NOTICE $nick : !tsservers - returns list of supported servers"     }##########TS Script Help END######################putlog " TeamSpeak Info v2.0 " </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9990">Syntax1980</a> — Fri Jun 13, 2008 2:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2005-12-01T10:40:15-04:00</updated>

		<published>2005-12-01T10:40:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=57866#p57866</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=57866#p57866"/>
		<title type="html"><![CDATA[[need help] TeamSpeak Info v2.0]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=57866#p57866"><![CDATA[
obviously the regexp doesnt match the input string and therefor the var gets not created. you could use 'if $users1 {lappend...}' to prevent the TCL error to occur, however it won't display what it should until the regular expression or the source of the script is fixed.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Thu Dec 01, 2005 10:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[genti]]></name></author>
		<updated>2005-12-01T05:22:27-04:00</updated>

		<published>2005-12-01T05:22:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=57861#p57861</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=57861#p57861"/>
		<title type="html"><![CDATA[[need help] TeamSpeak Info v2.0]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=57861#p57861"><![CDATA[
<strong class="text-strong">ts.tcl: </strong><br><div class="codebox"><p>Code: </p><pre><code>###################################################  Teamspeak v2.0                                ##    Author: PezCore aka DieSucker               ##  Tested on Eggdrop v1.6.17                     # ###################################################                                                ##                                                ##                                                ## This is a TCL Script designed to query a       ## TeamSpeak server and post the nick and their   ## time one the server into a channel.            ## 3/30/2005 v2.0 - Added channels list           ##                  Server info                   ##                  cleaned up some outputs       ## 3/20/2005 v1.2 - Added multi-server support    ## 3/11/2005 v1.1 - Fixed The server time out     ##                  it now gives an error if the  ##                  server is offline or you      ##                  give a BAD IP/PORT. It will   ##                  take a minute for the it to   ##                  time-out                      ## 2/23/2005 v1.0 - rewrote most of the script    ## 8/13/2004 v0.9 - Intial script by Vitto        ## Many THANKS goes to MC_8                       ## If you need me, #donuthole on irc.protium.org  ## or email me diesucker@kc.rr.com                ##                                                ## Things-To-Do: Maybe add an HTML setting        ##               Also add/delete servers          ###################################################array unset ts_server# Configuration: # Set here a list of TeamSpeak servers, and there information. # Specify as many ts_server(&lt;short_name&gt;)'s as you need. # Syntax: #   set ts_server(&lt;short_name&gt;) [list "&lt;full name&gt;" "&lt;ip&gt;" "&lt;port&gt;" "&lt;tcpquery&gt;"] #set ts_server(TEST) [list "Servername" "127.2.0.0" "8767" "51234"]set ts_server(mxb) [list "###" "#######" "8767" "51234"]#####################################################################################################Coding, Please don't edit below##############################################################################################################################unset -nocomplain Name unset -nocomplain Valueforeach {Name Value} [array get ts_server] {   array unset ts_server $Name   array set ts_server [list [string tolower $Name] $Value] } unset -nocomplain Name unset -nocomplain Value #Public Bindingbind pub - !ts TS:startbind pub - !tsc TS:channelsbind pub - !tsi TS:serverinfobind pub - !tsservers TS:serversbind pub - !tshelp TS:helpproc TS:servers {nick uhost handle channel text} {   set list [array names ::ts_server]   if {![llength $list]} {     putserv "PRIVMSG $channel :\0034,0There are no TeamSpeak servers currently defined, sorry."   } else {     putserv "PRIVMSG $channel :\0034,0List of availble TeamSpeak servers:\0033,0 [join $list ", "]"   } } #######Grabbing Server Info#############proc TS:serverinfo {nick uhost handle channel text} {   global ts   set text [string tolower $text]    if {$text == ""} {     putserv "PRIVMSG $channel :\0034,0Sorry, please specify a valid server selection. Use !tsservers to find supported servers"     return 0   }    if {[lsearch -exact [array names ::ts_server] $text] == "-1"} {      putserv "PRIVMSG $channel :\0034,0 Sorry, '$text' isn't a valid server selection. Please us !tsservers to find supported servers"      return 0    }    foreach {ts(servername) ts(ip) ts(port) ts(tcpquery)} $::ts_server($text) break   set sock [connect $ts(ip) $ts(tcpquery)]   close [open "scripts/tsserverinfo.txt" w]   close [open "scripts/tsserverinfo2.txt" w]   set ts(user:$sock) "" ; set ts(count:$sock) 0   set ts(chan:$sock) "" ; set ts(arg:$sock) "$channel"   set ts(arg) "$channel"   set ts(players:$sock) 0   set ts(last:$sock) ""   control $sock TS:servercontrol}proc TS:servercontrol {sock input} {   global ts   if {$input == ""} {     putserv "PRIVMSG $ts(arg) :\0034,0 The TeamSpeak Server has timed-out. Either The TeamSpeak server is offline or an Invalid IP                                   was specified"     return 1   }   if {$ts(last:$sock) == ""} {     if {$input == {[TS]}} {     putdcc $sock "sel $ts(port)"     set ts(last:$sock) sel     return 0    }   }   if {$ts(last:$sock) == "sel"} {     if {$input == "OK"} {       putdcc $sock "si"       set ts(last:$sock) si       return 0     }    }   if {$ts(last:$sock) == "si"} {     if {$input == "OK"} {       putdcc $sock "gi"       set ts(last:$sock) gi       return 0     }   set io2 [open "scripts/tsserverinfo.txt" a]    puts $io2 "$input"; close $io2; return 0   }   if {$ts(last:$sock) == "gi"} {     if {$input == "OK"} {       TS:serverend       return 1     }    set io3 [open "scripts/tsserverinfo2.txt" a]    puts $io3 "$input"    close $io3    return 0    } return 0}proc TS:serverend {} {    global ts    set info [open "scripts/tsserverinfo.txt" r]    set info1 [read -nonewline $info]      close $info    set vers [open "scripts/tsserverinfo2.txt" r]    set vers1 [read -nonewline $vers]    close $vers    file delete -force -- "scripts/tsserverinfo.txt"    set vers2 [split $vers1 "\n"]    set vers3 [lindex $vers2 1]    set vers4 [split $vers3 "="]    set vers5 [lindex $vers4 1]    set info2 [split $info1 "\n"]    set name1 [lindex $info2 1]    set name2 [split $name1 "="]    set name3 [lindex $name2 1]    set welcome1 [lindex $info2 3]    set welcome2 [lindex [split $welcome1 "="] 1]    set max1 [lindex $info2 9]    set max2 [lindex [split $max1 "="] 1]    set plat [lindex $info2 2]    set plat2 [lindex [split $plat "="] 1]    set users [lindex $info2 28]    set users2 [lindex [split $users "="] 1]    set channs [lindex $info2 29]    set channs2 [lindex [split $channs "="] 1]    set uptime [lindex $info2 27]    set uptime2 [lindex [split $uptime "="] 1]    set uptime3 [duration $uptime2]    set uptime5 [split $uptime3 " "]    set uptime4 [llength $uptime5]    if {$uptime4 == "10"} {      set test14 "[lindex $uptime5 0]w[lindex $uptime5 2]d[lindex $uptime5 4]h[lindex $uptime5 6]m"    }    if {$uptime4 == "8"} {      set test14 "[lindex $uptime5 0]d[lindex $uptime5 2]h[lindex $uptime5 4]m"    }    if {$uptime4 == "6"} {       set test14 "[lindex $uptime5 0]h[lindex $uptime5 2]m"     }     if {$uptime4 == "4"} {       set test14 "0h[lindex $uptime5 0]m"    }     if {$uptime4 == "2"} {       set test14 "[lindex $uptime5 0]s"     }     putserv "PRIVMSG $ts(arg) :\0034,0Server Info For\0033,0 $ts(servername)($ts(ip):$ts(port)) :\0031,0 \002Name:\002 $name3 \002Welcome Message:\002 $welcome2 \002Max Users:\002 $max2 \002Platform:\002 $plat2 \002Current users:\002 $users2 \002 Total Channels:\002 $channs2 \002Uptime:\002 $test14 \002Version:\002 $vers5"} #################End Of Server Info#################################################Server channels###################################proc TS:channels {nick uhost handle channel text} {    global ts    if {$text == ""} {      putserv "PRIVMSG $channel :\0034,0Sorry, please specify a valid server selection. Use !tsservers to find supported servers"      return 0    }     set text [string tolower $text]     if {[lsearch -exact [array names ::ts_server] $text] == "-1"} {       putserv "PRIVMSG $channel :\0034,0Sorry, '$text' isn't a valid server selection. Use !tsservers to find supported servers"      return 0     }     foreach {ts(servername) ts(ip) ts(port) ts(tcpquery)} $::ts_server($text) break    set sock [connect $ts(ip) $ts(tcpquery)]    close [open "scripts/tschannels.txt" w]    set ts(user:$sock) "" ; set ts(count:$sock) 0    set ts(chan:$sock) "" ; set ts(arg:$sock) "$channel"    set ts(arg) "$channel"    set ts(players:$sock) 0    set ts(last:$sock) ""    control $sock TS:chancontrol}proc TS:chancontrol {sock input} {    global ts    if {$input == ""} {      putserv "PRIVMSG $ts(arg) :\0034,0 The TeamSpeak Server has timed-out. Either The TeamSpeak server is offline or an Invalid IP                                   was specified"       return 1      }    if {$ts(last:$sock) == ""} {       if {$input == {[TS]}} {       putdcc $sock "sel $ts(port)"      set ts(last:$sock) sel       return 0       }    }     if {$ts(last:$sock) == "sel"} {       if {$input == "OK"} {        putdcc $sock "cl"        set ts(last:$sock) cl        return 0       }   }   if {$ts(last:$sock) == "cl"} {     if {$input == "OK"} {       TS:chanend       return 1       }   set io [open "scripts/tschannels.txt" a]   puts $io "/ $input"   close $io   return 0  } return 0 }proc TS:chanend {} {   global ts   set ts(channels1) [open "scripts/tschannels.txt" r]   set ts(channels2) [read $ts(channels1)]   set ts(channels3) [split $ts(channels2) "\n"]   close $ts(channels1)   file delete -force -- "scripts/tschannels.txt"   set ts(channels3) [lreplace $ts(channels3) 0 0]   set ts(channels4) [llength $ts(channels3)]   set ts(channels4) [expr "$ts(channels4) - 1"]   set ts(ch1) [lindex $ts(channels3) 0]   set ts(ch2) [lindex [split $ts(ch1) \t] 5]   set ts(ch3) [lindex [split $ts(ch2) {"}] 1]   set ts(channelsoutput) ": $ts(ch3)"   set j 1    while {$j &lt; $ts(channels4)} {        set ts(channels6) [lindex $ts(channels3) $j]        set ts(channels7) [lindex [split $ts(channels6) \t] 5]        set ts(channels8) [split $ts(channels7) {"}]        set ts(channels9) [lindex $ts(channels8) 1]        append ts(channelsoutput) ", " $ts(channels9)        incr j        }   putserv "PRIVMSG $ts(arg) :\0034,0 Channels on\0033,0 $ts(servername)($ts(ip):$ts(port)):\0036,0($ts(channels4))\0031,0$ts(channelsoutput)"}#############End of channels##################################Users Connected#####################proc TS:start {nick uhost handle channel text} {     global ts    set text [string tolower $text]    if {$text == ""} {      putserv "PRIVMSG $channel :\0034,0Sorry, please specify a valid server selection. Use !tsservers to find supported servers"      return 0     }     if {[lsearch -exact [array names ::ts_server] $text] == "-1"} {       putserv "PRIVMSG $channel :\0034,0Sorry, '$text' isn't a valid server selection. Use !tsservers to find supported servers"       return 0      }     foreach {ts(servername) ts(ip) ts(port) ts(tcpquery)} $::ts_server($text) break     set sock [connect $ts(ip) $ts(tcpquery)]     close [open "scripts/tstester.txt" w]     set ts(user:$sock) "" ; set ts(count:$sock) 0     set ts(chan:$sock) "" ; set ts(arg:$sock) "$channel"     set ts(arg) "$channel"     set ts(players:$sock) 0    set ts(last:$sock) ""    control $sock [b]TS:control}proc TS:control {sock input} {     global ts    if {$input == ""} {      putserv "PRIVMSG $ts(arg) :\0034,0 The TeamSpeak Server has timed-out. Either The TeamSpeak server is offline or an Invalid IP was specified"      return 1    }     if {$ts(last:$sock) == ""} {       if {$input == {[TS]}} {         putdcc $sock "sel $ts(port)"         set ts(last:$sock) sel         return 0       }    }     if {$ts(last:$sock) == "sel"} {       if {$input == "OK"} {         putdcc $sock "pl"         set ts(last:$sock) pl         return 0       }    }    if {$ts(last:$sock) == "pl"} {       if {$input == "OK"} {          TS:end        return 1       }     set io [open "scripts/tstester.txt" a]     puts $io "/ $input"; close $io; return 0     }  return 0 }proc TS:end {} {    global ts    set ts(players2) "scripts/tstester.txt"    set ts(players3) [open $ts(players2) r]    set ts(playerdata) [read $ts(players3)]    set ts(plines) [split $ts(playerdata) "\n"]    close $ts(players3)    file delete -force -- "scripts/tstester.txt"    set ltd 0     set ts(plines) [lreplace $ts(plines) $ltd $ltd]    set i [open $ts(players2) w]    puts $i [join $ts(plines) ""]    close $i    set ts(nlines) [llength $ts(plines)]    set ts(lines2) [expr "$ts(nlines) - 1"]    set channeloutput [list ":"]    set i 0     while {$i &lt; $ts(lines2)} {         set users2 [lindex $ts(plines) $i]         set users1 [regexp {\d\t(\d+?)\t[\d|\t]+?\t".+?"\t"(.+?)"\t"(.*?)"\t} [lindex $ts(plines) $i] {\1\2\3} input nik Name]          set test11 [duration [lindex [split $users2 \t] 8]]         set test12 [split $test11 " "]         set test13 [llength $test12]         if {$test13 == "10"} {           set test14 "([lindex $test12 0]w[lindex $test12 2]d[lindex $test12 4]h[lindex $test12 6]m)"         }         if {$test13 == "8"} {           set test14 "([lindex $test12 0]d[lindex $test12 2]h[lindex $test12 4]m)"         }         if {$test13 == "6"} {            set test14 "([lindex $test12 0]h[lindex $test12 2]m)"          }          if {$test13 == "4"} {            set test14 "(0h[lindex $test12 0]m)"          }          if {$test13 == "2"} {            set test14 "([lindex $test12 0]s)"          }          lappend channeloutput  $nik $test14         incr i     }   if {$ts(lines2) == 0} {      putserv "PRIVMSG $ts(arg) :\0034,0There Are NO Users Connected to\0033,0 $ts(servername)($ts(ip):$ts(port))"     } else {           putserv "PRIVMSG $ts(arg) :\0034,0Current Users Connected to \0033,0$ts(servername)($ts(ip):$ts(port)): \0036,0($ts(lines2))\0031,0 $channeloutput"      }}###########End of Users Connected#########################TS Script Help######################proc TS:help {nick uhost handle channel text} {     putserv "NOTICE $nick : TeamSpeak TCL v2.0 "     putserv "NOTICE $nick : Commands :"     putserv "NOTICE $nick : !ts (servername) - returns current users connected"     putserv "NOTICE $nick : !tsi (servername) - returns information for the given server"     putserv "NOTICE $nick : !tsc (servername) - returns channels from the server"     putserv "NOTICE $nick : !tsservers - returns list of supported servers"      }##########TS Script Help END######################putlog " TeamSpeak Info v2.0 "</code></pre></div>The only error message is:<br><blockquote class="uncited"><div>"Tcl error [TS:control]: can't read "nik": no such variable" </div></blockquote>when i write in my channel !ts mxb, to know if someone is connected to the ts server.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7049">genti</a> — Thu Dec 01, 2005 5:22 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[]Kami[]]></name></author>
		<updated>2005-11-30T18:10:45-04:00</updated>

		<published>2005-11-30T18:10:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=57846#p57846</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=57846#p57846"/>
		<title type="html"><![CDATA[[need help] TeamSpeak Info v2.0]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=57846#p57846"><![CDATA[
Copy whole script here and output of .tcl set errorInfo / .set errorInfo<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3559">]Kami[</a> — Wed Nov 30, 2005 6:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[genti]]></name></author>
		<updated>2005-11-30T17:36:47-04:00</updated>

		<published>2005-11-30T17:36:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=57845#p57845</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=57845#p57845"/>
		<title type="html"><![CDATA[[need help] TeamSpeak Info v2.0]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=57845#p57845"><![CDATA[
Hi all! I've a problem with a script downloaded from egghelp.org. <br><br>If ther's no user on my ts server the script works fine, but with someone connected if I try to retrieve info about ts server, in the telnet window to the eggdrop i have this error:<br><br>"Tcl error [TS:control]: can't read "nik": no such variable"<br><br>in "ts.tcl" the only line with "TS:control" are:<br><br>-bash-2.05b$ cat ts.tcl |grep TS:control<br>   control $sock TS:control<br>proc TS:control {sock input} {<br><br>can you help me?<br><br>thx a lot <br><br>(sorry for my english <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_redface.gif" width="15" height="15" alt=":oops:" title="Embarassed">   )<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7049">genti</a> — Wed Nov 30, 2005 5:36 pm</p><hr />
]]></content>
	</entry>
	</feed>
