<?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/10004" />

	<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>2005-07-26T11:54:48-04:00</updated>

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

		<entry>
		<author><name><![CDATA[deadite66]]></name></author>
		<updated>2005-07-26T11:54:48-04:00</updated>

		<published>2005-07-26T11:54:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=53323#p53323</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=53323#p53323"/>
		<title type="html"><![CDATA[qstat map change notify]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=53323#p53323"><![CDATA[
last version + added to tcl archive<br><br>multi-game,mutli-server and mutli-irc-channel.<br>lot of it is overkill but it gave me something to do during my holiday<br><div class="codebox"><p>Code: </p><pre><code>##########################################################################                   qstat map change notify script                      ##                  this is a TCL script for eggdrop                     ##         written by Lee (Moonunit) Donaghy lee295012@yahoo.com         ##               Titan Internet 32 Player Onslaught server               ##  ut2004://217.77.176.198:7777 http://ut2004.titaninternet.co.uk/vbb/  ########################################################################### set your qstatpathset qstatpath "/usr/local/bin/qstat"# number of servers to checkset server_number 1# edit the mapchangenotify.serverlist file# ie.# -ut2s# 123.123.123.123:7777# now running on myonslaught server# #myirchannel# -ut2s# etc...set mcn_version "v0.1.1"################################################################ TCL code begins, don't edit unless you know what your doing ################################################################putlog "mapchangenotify $mcn_version loaded"# read server list set slname "mapchangenotify.serverlist"set slct [open $slname "r"]set sdlist [split [read $slct] \n]close $slct#---------------------------------------------------------------------# create server files if they don't existset cfc 0while { $cfc != $server_number } {if {![file exists mapchange]} {set fname "mapchangenotify$cfc.output"set fp [open $fname "w"]close $fpincr cfc}}#---------------------------------------------------------------------bind time - * qstatrun ;# runs every minuteproc qstatrun {m h d mo y} {global qstatpathglobal server_numberglobal slctglobal slglobal sdlistset server_count 0set slcount 0while {$server_count != $server_number} {# read old map nameset fname "mapchangenotify$server_count.output"set fp [open $fname "r"]set qstatxmlfile [split [read $fp] \n]close $fp#-------------------------------------------------------------------------# using regex to find the right lines, yeah i know 50 lines is over kill.set qstatxmlgameline 50set qstatxmlmapline 50set findrightlines 0set findrightlinesmax 50while { $findrightlines != $findrightlinesmax } {set poon [lindex $qstatxmlfile $findrightlines]if { [regexp "&lt;map&gt;(.*)&lt;/map&gt;" $poon] == 1} {set qstatxmlmapline $findrightlines} incr findrightlines}#-------------------------------------------------------------------------set mapline [lindex $qstatxmlfile $qstatxmlmapline]# strip out &lt;map&gt; and &lt;\map&gt;set oldmap [string range $mapline 7 [expr [string length $mapline] - 7]]#-------------------------------------------------------------------------# set server list set qstatgametype [lindex $sdlist $slcount] ; incr slcountset qstatserverip [lindex $sdlist $slcount] ; incr slcountset qstataddedtext [lindex $sdlist $slcount] ; incr slcountset qstatircchan [lindex $sdlist $slcount] ; incr slcount#-------------------------------------------------------------------------exec $qstatpath $qstatgametype $qstatserverip -xml -of mapchangenotify$server_count.output# read new map nameset fname "mapchangenotify$server_count.output"set fp [open $fname "r"]set qstatxmlfile [split [read $fp] \n]close $fp#-------------------------------------------------------------------------# using regex to find the right lines, yeah i know 50 lines is over kill.set qstatxmlgameline 50set qstatxmlmapline 50set findrightlines 0set findrightlinesmax 50while { $findrightlines != $findrightlinesmax } {set poon [lindex $qstatxmlfile $findrightlines]if { [regexp "&lt;map&gt;(.*)&lt;/map&gt;" $poon] == 1} {set qstatxmlmapline $findrightlines} if { [regexp "&lt;gametype&gt;(.*)&lt;/gametype&gt;" $poon] == 1} {set qstatxmlgameline $findrightlines} incr findrightlines}#-------------------------------------------------------------------------set gametypeline [lindex $qstatxmlfile $qstatxmlgameline]set mapline [lindex $qstatxmlfile $qstatxmlmapline]# strip out &lt;map&gt; and &lt;\map&gt;set newmap [string range $mapline 7 [expr [string length $mapline] - 7]]# strip out &lt;gametype&gt; and &lt;\gametype&gt;set gametype [string range $gametypeline 12 [expr [string length $gametypeline] - 12]]#--------------------------------------------------------------------------# if qstat hit the server at the wrong time nothing is returned so having another crack at itset recheckbreak 0set mlbroken 0while {[string length $mapline] &lt; 1} {exec /usr/local/bin/qstat $qstatgametype $qstatserverip -xml -of mapchangenotify$server_count.output# read new map nameset fname "mapchangenotify$server_count.output"set fp [open $fname "r"]set qstatxmlfile [split [read $fp] \n]close $fp#------------------------------------------------------------------------# using regex to find the right lines, yeah i know 50 lines is over kill.set qstatxmlgameline 50set qstatxmlmapline 50set findrightlines 0set findrightlinesmax 50while { $findrightlines != $findrightlinesmax } {set poon [lindex $qstatxmlfile $findrightlines]if { [regexp "&lt;map&gt;(.*)&lt;/map&gt;" $poon] == 1} {set qstatxmlmapline $findrightlines} if { [regexp "&lt;gametype&gt;(.*)&lt;/gametype&gt;" $poon] == 1} {set qstatxmlgameline $findrightlines} incr findrightlines}#------------------------------------------------------------------------set gametypeline [lindex $qstatxmlfile $qstatxmlgameline]set mapline [lindex $qstatxmlfile $qstatxmlmapline]# strip out &lt;map&gt; and &lt;\map&gt;set newmap [string range $mapline 7 [expr [string length $mapline] - 7]]# strip out &lt;gametype&gt; and &lt;\gametype&gt;set gametype [string range $gametypeline 12 [expr [string length $gametypeline] - 12]]incr recheckbreakif {$recheckbreak == 10} { set mlbroken 1 ; break }}#-----------------------------------------------------------------------------------------------------------------------------------------incr server_countif {$newmap != $oldmap &amp;&amp; $mlbroken == 0 }  {     puthelp "PRIVMSG $qstatircchan :$newmap $qstataddedtext ($gametype)"   }}}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6296">deadite66</a> — Tue Jul 26, 2005 11:54 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[deadite66]]></name></author>
		<updated>2005-07-22T17:37:20-04:00</updated>

		<published>2005-07-22T17:37:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=53045#p53045</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=53045#p53045"/>
		<title type="html"><![CDATA[qstat map change notify]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=53045#p53045"><![CDATA[
hopefully working better this time, moved unneeded stuff out of the proc.<br>should close all open files now, removed after command.<br>better leave it working for a few days before i add this one to the tcl archive <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><br><div class="codebox"><p>Code: </p><pre><code>##########################################################################                qstat UT2004 map change notify script                  ##                  this is a TCL script for eggdrop                     ##              written by Lee Donaghy lee295012@yahoo.com               ##               Titan Internet 32 Player Onslaught server               ##  ut2004://217.77.176.198:7777 http://ut2004.titaninternet.co.uk/vbb/  ########################################################################### set your qstatpathset qstatpath "/usr/local/bin/qstat"# number of servers to checkset server_number 3# edit the mapchangenotify.serverlist file# ie.# -ut2s# 123.123.123.123:7777# now running on myonslaught server# #myirchannel# -ut2s# etc...set mcn_version "v0.1.0"################################################################ TCL code begins, don't edit unless you know what your doing ################################################################putlog "mapchangenotify $mcn_version loaded"# read server list set slname "mapchangenotify.serverlist"set slct [open $slname "r"]set sdlist [split [read $slct] \n]close $slct# create server files if they don't existset cfc 0while { $cfc != $server_number } {if {![file exists mapchange]} {set fname "mapchangenotify$cfc.output"set fp [open $fname "w"]close $fpincr cfc}}#---------------------------------------------------------------------bind time - * qstatrun ;# runs every minuteproc qstatrun {m h d mo y} {global qstatpathglobal server_numberglobal slctglobal slglobal sdlistset server_count 0set slcount 0while {$server_count != $server_number} {# read old map nameset fname "mapchangenotify$server_count.output"set fp [open $fname "r"]set blank [gets $fp] ;set blank [gets $fp] ;set blank [gets $fp];set blank [gets $fp];set blank [gets $fp]set gametypeline [gets $fp]set mapline [gets $fp]close $fp# strip out &lt;map&gt; and &lt;\map&gt;set oldmap [string range $mapline 7 [expr [string length $mapline] - 7]]#-------------------------------------------------------------------------------------------------------------------------------------------# set server list set qstatgametype [lindex $sdlist $slcount] ; incr slcountset qstatserverip [lindex $sdlist $slcount] ; incr slcountset qstataddedtext [lindex $sdlist $slcount] ; incr slcountset qstatircchan [lindex $sdlist $slcount] ; incr slcount#-------------------------------------------------------------------------------------------------------------------------------------------exec $qstatpath $qstatgametype $qstatserverip -xml -of mapchangenotify$server_count.output# read new map nameset fname "mapchangenotify$server_count.output"set fp [open $fname "r"]set blank [gets $fp] ;set blank [gets $fp] ;set blank [gets $fp];set blank [gets $fp];set blank [gets $fp]set gametypeline [gets $fp]set mapline [gets $fp]close $fp# strip out &lt;map&gt; and &lt;\map&gt;set newmap [string range $mapline 7 [expr [string length $mapline] - 7]]set gametype [string range $gametypeline 12 [expr [string length $gametypeline] - 12]]#------------------------------------------------------------------------------------------------------------------------------------------# if qstat hit the server at the wrong time nothing is returned so having another crack at itset recheckbreak 0set mlbroken 0while {[string length $mapline] &lt; 1} {exec /usr/local/bin/qstat $qstatgametype $qstatserverip -xml -of mapchangenotify$server_count.output# read new map nameset fname "mapchangenotify$server_count.output"set fp [open $fname "r"]set blank [gets $fp] ;set blank [gets $fp] ;set blank [gets $fp];set blank [gets $fp];set blank [gets $fp]set gametypeline [gets $fp]set mapline [gets $fp]close $fp# strip out &lt;map&gt; and &lt;\map&gt;set newmap [string range $mapline 7 [expr [string length $mapline] - 7]]# strip out &lt;gametype&gt; and &lt;\gametype&gt;set gametype [string range $gametypeline 12 [expr [string length $gametypeline] - 12]]incr recheckbreakif {$recheckbreak == 10} { set mlbroken 1 ; break }}#-----------------------------------------------------------------------------------------------------------------------------------------incr server_countif {$newmap != $oldmap &amp;&amp; $mlbroken == 0 }  {     puthelp "PRIVMSG $qstatircchan :$newmap $qstataddedtext ($gametype)"   }}}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6296">deadite66</a> — Fri Jul 22, 2005 5:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[deadite66]]></name></author>
		<updated>2005-07-22T11:58:54-04:00</updated>

		<published>2005-07-22T11:58:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=53013#p53013</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=53013#p53013"/>
		<title type="html"><![CDATA[qstat map change notify]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=53013#p53013"><![CDATA[
thanks guys<br>well think i had 2 different problems<br>1. after command (will have to change bits to stop hammering the server if its down)<br>2. a missing close statement in a loop which must have kept opening new hooks on the file everytime it looped,supprised TCL didn't flag a warning<br><br>i'll leave it a few hours and see how its goes.<br><br>thanks MeTroiD and Sir_Fz<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6296">deadite66</a> — Fri Jul 22, 2005 11:58 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2005-07-22T11:46:16-04:00</updated>

		<published>2005-07-22T11:46:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=53011#p53011</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=53011#p53011"/>
		<title type="html"><![CDATA[qstat map change notify]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=53011#p53011"><![CDATA[
If you mean that your bot is freezing, or lagging when executing the shell command, then I suggest you use <strong class="text-strong">open</strong> or bgexec.tcl (not sure if I got the name right) by strikelight from <a href="http://www.tclscript.com" class="postlink">tclscript.com</a>.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Fri Jul 22, 2005 11:46 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[deadite66]]></name></author>
		<updated>2005-07-22T03:05:28-04:00</updated>

		<published>2005-07-22T03:05:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=53000#p53000</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=53000#p53000"/>
		<title type="html"><![CDATA[qstat map change notify]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=53000#p53000"><![CDATA[
if you mean the program i'm using in exec it should return server details then terminate..<br><br>edit..<br>perhaps i used the wrong word, what ment to say was the eggdrop memory footprint keeps slowly increasing.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6296">deadite66</a> — Fri Jul 22, 2005 3:05 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[metroid]]></name></author>
		<updated>2005-07-22T03:00:37-04:00</updated>

		<published>2005-07-22T03:00:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=52999#p52999</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=52999#p52999"/>
		<title type="html"><![CDATA[qstat map change notify]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=52999#p52999"><![CDATA[
From what i see, your not closing qstat<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5078">metroid</a> — Fri Jul 22, 2005 3:00 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[deadite66]]></name></author>
		<updated>2005-07-22T00:23:20-04:00</updated>

		<published>2005-07-22T00:23:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=52995#p52995</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=52995#p52995"/>
		<title type="html"><![CDATA[qstat map change notify]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=52995#p52995"><![CDATA[
can anyone see what may be causing a memory leak?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6296">deadite66</a> — Fri Jul 22, 2005 12:23 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[deadite66]]></name></author>
		<updated>2005-07-21T21:16:18-04:00</updated>

		<published>2005-07-21T21:16:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=52988#p52988</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=52988#p52988"/>
		<title type="html"><![CDATA[qstat map change notify]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=52988#p52988"><![CDATA[
re-wrote 1/2 of it to make it multi-server and multi irc channel<br><a href="http://ghostpilot.org/mcn/mapchangenotify_v0.1.0.tar.gz" class="postlink">http://ghostpilot.org/mcn/mapchangenotify_v0.1.0.tar.gz</a><br><br><div class="codebox"><p>Code: </p><pre><code>##########################################################################                qstat UT2004 map change notify script                  ##                  this is a TCL script for eggdrop                     ##              written by Lee Donaghy lee295012@yahoo.com               ##               Titan Internet 32 Player Onslaught server               ##  ut2004://217.77.176.198:7777 http://ut2004.titaninternet.co.uk/vbb/  ########################################################################### set your qstatpathset qstatpath "/usr/local/bin/qstat"# number of servers to checkset server_number 3# edit the mapchangenotify.serverlist file# ie.# -ut2s# 123.123.123.123:7777# now running on myonslaught server# #myirchannel# -ut2s# etc...set mcn_version "v0.1.0"################################################################ TCL code begins, don't edit unless you know what your doing ################################################################putlog "mapchangenotify $mcn_version loaded"set scan_delay 30000bind time - * qstatrun ;# runs every minuteproc qstatrun {m h d mo y} {global qstatpathglobal server_numberglobal scan_delayset server_count 0set slcount 0while {$server_count != $server_number} {# if the files don't exist then create themif {![file exists mapchangenotify$server_count.output]} {# read the serverlistset slname "mapchangenotify.serverlist"set sl [open $slname "r"]set sdlist [split [read $sl] \n]set qstatgametype [lindex $sdlist $slcount] ; incr slcountset qstatserverip [lindex $sdlist $slcount] ; incr slcountset qstataddedtext [lindex $sdlist $slcount] ; incr slcountset qstatircchan [lindex $sdlist $slcount] ; incr slcountexec $qstatpath $qstatgametype $qstatserverip -xml -of mapchangenotify$server_count.output }incr server_count}set server_count 0set slcount 0while {$server_count != $server_number} {# read old map nameset fname "mapchangenotify$server_count.output"set fp [open $fname "r"]set blank [gets $fp] ;set blank [gets $fp] ;set blank [gets $fp];set blank [gets $fp];set blank [gets $fp]set gametypeline [gets $fp]set mapline [gets $fp]close $fp# strip out &lt;map&gt; and &lt;\map&gt;set oldmap [string range $mapline 7 [expr [string length $mapline] - 7]]#-------------------------------------------------------------------------------------------------------------------------------------------# read the serverlistset slname "mapchangenotify.serverlist"set sl [open $slname "r"]set sdlist [split [read $sl] \n]set qstatgametype [lindex $sdlist $slcount] ; incr slcountset qstatserverip [lindex $sdlist $slcount] ; incr slcountset qstataddedtext [lindex $sdlist $slcount] ; incr slcountset qstatircchan [lindex $sdlist $slcount] ; incr slcount#-------------------------------------------------------------------------------------------------------------------------------------------#puts "$qstatircchan $qstatgametype $qstatserverip $qstataddedtext"exec $qstatpath $qstatgametype $qstatserverip -xml -of mapchangenotify$server_count.output# read new map nameset fname "mapchangenotify$server_count.output"set fp [open $fname "r"]set blank [gets $fp] ;set blank [gets $fp] ;set blank [gets $fp];set blank [gets $fp];set blank [gets $fp]set gametypeline [gets $fp]set mapline [gets $fp]close $fp# strip out &lt;map&gt; and &lt;\map&gt;set newmap [string range $mapline 7 [expr [string length $mapline] - 7]]set gametype [string range $gametypeline 12 [expr [string length $gametypeline] - 12]]#------------------------------------------------------------------------------------------------------------------------------------------# if qstat hit the server at the wrong time nothing is returned so having another crack at itwhile {[string length $mapline] &lt; 1} {#after $scan_delayexec /usr/local/bin/qstat $qstatgametype $qstatserverip -xml -of mapchangenotify$server_count.output# read new map nameset fname "mapchangenotify$server_count.output"set fp [open $fname "r"]set blank [gets $fp] ;set blank [gets $fp] ;set blank [gets $fp];set blank [gets $fp];set blank [gets $fp]set gametypeline [gets $fp]set mapline [gets $fp]close $fp# strip out &lt;map&gt; and &lt;\map&gt;set newmap [string range $mapline 7 [expr [string length $mapline] - 7]]# strip out &lt;gametype&gt; and &lt;\gametype&gt;set gametype [string range $gametypeline 12 [expr [string length $gametypeline] - 12]]}#-----------------------------------------------------------------------------------------------------------------------------------------incr server_countif {$newmap != $oldmap}  {     puthelp "PRIVMSG $qstatircchan :$newmap $qstataddedtext ($gametype)"   }}close $sl}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6296">deadite66</a> — Thu Jul 21, 2005 9:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[deadite66]]></name></author>
		<updated>2005-07-22T17:40:14-04:00</updated>

		<published>2005-07-18T18:06:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=52819#p52819</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=52819#p52819"/>
		<title type="html"><![CDATA[qstat map change notify]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=52819#p52819"><![CDATA[
and we have a winner, had to change how the file was read that line split thing messed it up.<br>its a bit belt and braces but it works<div class="codebox"><p>Code: </p><pre><code>bind time - * qstat ;# runs every minuteproc qstat {m h d mo y} {# read old map nameset fname "/home/lee/documents/tclmapchange.output"set fp [open $fname "r"]set blank [gets $fp]set blank [gets $fp]set blank [gets $fp]set blank [gets $fp]set blank [gets $fp]set blank [gets $fp]set mapline [gets $fp]close $fp# strip out &lt;map&gt; and &lt;\map&gt;set maplinelength [string length $mapline]set maplineend [expr $maplinelength - 7]set oldmap [string range $mapline 7 $maplineend]# run qstatset blank [exec /usr/local/bin/qstat -ut2s 217.77.176.198:7777 -xml -of /home/lee/documents/tclmapchange.output]# read new map nameset fname "/home/lee/documents/tclmapchange.output"set fp [open $fname "r"]set blank [gets $fp]set blank [gets $fp]set blank [gets $fp]set blank [gets $fp]set blank [gets $fp]set blank [gets $fp]set mapline [gets $fp]close $fp# strip out &lt;map&gt; and &lt;\map&gt;set maplinelength [string length $mapline]set maplineend [expr $maplinelength - 7]set mapname [string range $mapline 7 $maplineend]# if old map different from new map name then print change message.if {$mapname != $oldmap}  {   puthelp "PRIVMSG #titanonslaught :$mapname now running on Titan 32Player Onslaught"   }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6296">deadite66</a> — Mon Jul 18, 2005 6:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[deadite66]]></name></author>
		<updated>2005-07-18T13:06:39-04:00</updated>

		<published>2005-07-18T13:06:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=52800#p52800</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=52800#p52800"/>
		<title type="html"><![CDATA[qstat map change notify]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=52800#p52800"><![CDATA[
ok someone online suggested reading the qstat output file before running exec qstat to get the olmap name<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6296">deadite66</a> — Mon Jul 18, 2005 1:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[deadite66]]></name></author>
		<updated>2005-07-18T11:21:59-04:00</updated>

		<published>2005-07-18T11:21:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=52785#p52785</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=52785#p52785"/>
		<title type="html"><![CDATA[qstat map change notify]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=52785#p52785"><![CDATA[
are variables reset at the start of the proc running?<br>if so $oldmap will always be different to $mapname every time the proc runs.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6296">deadite66</a> — Mon Jul 18, 2005 11:21 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[LtPhil]]></name></author>
		<updated>2005-07-18T03:29:52-04:00</updated>

		<published>2005-07-18T03:29:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=52765#p52765</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=52765#p52765"/>
		<title type="html"><![CDATA[qstat map change notify]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=52765#p52765"><![CDATA[
well since you've figured out how to extract the mapname, what you need to do is create a variable at the beginning of the script, like "oldmap" or something, then right after <div class="codebox"><p>Code: </p><pre><code>set mapname [string range $mapline 7 $maplineend]</code></pre></div> add<div class="codebox"><p>Code: </p><pre><code>  if {$mapname != $oldmap} {    puthelp "PRIVMSG #channel :New map: $mapname"  }  set oldmap $mapname</code></pre></div>... see how that works?  (someone correct me if i'm wrong)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3577">LtPhil</a> — Mon Jul 18, 2005 3:29 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[deadite66]]></name></author>
		<updated>2005-07-17T23:40:02-04:00</updated>

		<published>2005-07-17T23:40:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=52759#p52759</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=52759#p52759"/>
		<title type="html"><![CDATA[qstat map change notify]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=52759#p52759"><![CDATA[
well i had a go at writing a tcl script, i had problems getting to grips with catch and lindex so i went the external file bit again.<br>though i'm having problems with the map change bit.<br><br>-----------------------------------------------------------------------------------------<br>bind time - * qstat ;# runs every minute<br>proc qstat {m h d mo y} {<br><br>set blank [exec /usr/local/bin/qstat -ut2s 217.77.176.198:7777 -xml -of /home/lee/documents/tclmapchange.output]<br><br># File name to read.<br>set fname "/home/lee/documents/tclmapchange.output"<br><br># Open file for read access (note we're not catching errors, you might<br># want to use catch {} if the file might not exist.<br>set fp [open $fname "r"]<br><br># Here we read in all of the data.<br>set data [read -nonewline $fp]<br><br># Close the file, since we're done reading.<br>close $fp<br><br># Now we split the data into lines.<br>set lines [split $data "\n"]<br><br># Get the map line from the list!<br>set mapline [lindex $lines 6]<br># get the string length of the line<br>set maplinelength [string length $mapline]<br># get end of map name by trimming 7 characters off mapline<br>set maplineend [expr $maplinelength - 7]<br># cut out &lt;map&gt; and &lt;/map&gt; leaving only the map name<br>set mapname [string range $mapline 7 $maplineend]<br>}<br>---------------------------------------------------------------------------------------<br><br>how can i display the map name in irc if it changed since the last time the procedure ran?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6296">deadite66</a> — Sun Jul 17, 2005 11:40 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2005-07-18T18:33:47-04:00</updated>

		<published>2005-07-17T21:01:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=52739#p52739</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=52739#p52739"/>
		<title type="html"><![CDATA[qstat map change notify]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=52739#p52739"><![CDATA[
I assume<div class="codebox"><p>Code: </p><pre><code>lindex [split $res] 8</code></pre></div>would be the map name, try to do some tests and see.<br><br>Edit: it shouldn't be [split $res \n]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Sun Jul 17, 2005 9:01 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2005-07-17T17:00:37-04:00</updated>

		<published>2005-07-17T17:00:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=52722#p52722</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=52722#p52722"/>
		<title type="html"><![CDATA[qstat map change notify]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=52722#p52722"><![CDATA[
again, congratulations for your creativity <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> seriously<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Sun Jul 17, 2005 5:00 pm</p><hr />
]]></content>
	</entry>
	</feed>
