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

	<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>2004-01-28T20:37:21-04:00</updated>

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

		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2004-01-28T20:37:21-04:00</updated>

		<published>2004-01-28T20:37:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=33051#p33051</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=33051#p33051"/>
		<title type="html"><![CDATA[The cut'n'paste-force is strong with this one]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=33051#p33051"><![CDATA[
<blockquote class="uncited"><div>it worked</div></blockquote>Cool <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_mrgreen.gif" width="15" height="15" alt=":mrgreen:" title="Mr. Green"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Wed Jan 28, 2004 8:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cvanmeer]]></name></author>
		<updated>2004-01-28T20:25:07-04:00</updated>

		<published>2004-01-28T20:25:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=33048#p33048</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=33048#p33048"/>
		<title type="html"><![CDATA[ServerCheck script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=33048#p33048"><![CDATA[
thank you!<br>it worked<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4215">cvanmeer</a> — Wed Jan 28, 2004 8:25 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2004-01-28T14:26:51-04:00</updated>

		<published>2004-01-28T14:26:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=33030#p33030</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=33030#p33030"/>
		<title type="html"><![CDATA[ServerCheck script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=33030#p33030"><![CDATA[
Did you check the thread i refered to? I'd use an array (in case they add new values, so you don't risk overwriting existing variables)...or create the output directly in the foreach...<br>example 1 (creating the a string for output):<div class="codebox"><p>Code: </p><pre><code>set out {}foreach {server server status} [regexp -all -nocase -inline {&lt;tr&gt;&lt;td&gt;([^&lt;]+)&lt;/td&gt;&lt;td&gt;&lt;img [^&gt;]+&gt;([^&lt;]+)&lt;/td&gt;&lt;/tr&gt;} $html] {lappend out "$server is $status"}set out [join $out ", "]</code></pre></div>example 2 (storing the values in an array):<div class="codebox"><p>Code: </p><pre><code>foreach {server server status} [regexp -all -nocase -inline {&lt;tr&gt;&lt;td&gt;([^&lt;]+)&lt;/td&gt;&lt;td&gt;&lt;img [^&gt;]+&gt;([^&lt;]+)&lt;/td&gt;&lt;/tr&gt;} $html] {set onoroff($server) $status}</code></pre></div>..then loop through [array names onoroff] or access onoroff(Name) directly (check if {[info exists ...] first to avoid errors)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Wed Jan 28, 2004 2:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cvanmeer]]></name></author>
		<updated>2004-01-28T14:08:01-04:00</updated>

		<published>2004-01-28T14:08:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=33029#p33029</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=33029#p33029"/>
		<title type="html"><![CDATA[ServerCheck script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=33029#p33029"><![CDATA[
<blockquote class="uncited"><div>This will make it fairly robust I hope. Clue: the first variable in the foreach will be overwritten by the second one by the same name (making it discard the first reported value in each match, which is the entire match)</div></blockquote>I don't get it, sorry.<br><br>And how do I put the right values in the right one of the 5 variables?<br><br>could you write some code to help me?<br><br>thx.<br><br>Chris<br>PS. Sorry I don't understand what you mean. I'm not that an expert <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4215">cvanmeer</a> — Wed Jan 28, 2004 2:08 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2004-01-28T13:56:17-04:00</updated>

		<published>2004-01-28T13:56:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=33028#p33028</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=33028#p33028"/>
		<title type="html"><![CDATA[ServerCheck script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=33028#p33028"><![CDATA[
Try the method provided in <a href="http://forum.egghelp.org/viewtopic.php?t=6690" class="postlink">this</a> thread with the following regexp rule:<div class="codebox"><p>Code: </p><pre><code>{&lt;tr&gt;&lt;td&gt;([^&lt;]+)&lt;/td&gt;&lt;td&gt;&lt;img [^&gt;]+&gt;([^&lt;]+)&lt;/td&gt;&lt;/tr&gt;}</code></pre></div>This will make it fairly robust I hope. Clue: the first variable in the foreach will be overwritten by the second one by the same name (making it discard the first reported value in each match, which is the entire match)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Wed Jan 28, 2004 1:56 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cvanmeer]]></name></author>
		<updated>2004-01-28T13:27:44-04:00</updated>

		<published>2004-01-28T13:27:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=33026#p33026</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=33026#p33026"/>
		<title type="html"><![CDATA[ServerCheck script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=33026#p33026"><![CDATA[
Hi,<br><br>I'm stuck with creating a TCL script. I have a webpage that I get with http::geturl etc. the output of that file is in $data<br><br>let's say the content of $data is:<div class="codebox"><p>Code: </p><pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;&lt;html&gt;  &lt;body&gt;      &lt;div id="maindiv" &gt;      &lt;div id="ServerCheckDiv"&gt;    &lt;table id="ServerCheckTable"&gt;      &lt;tr&gt;&lt;th&gt;Server&lt;/th&gt;&lt;th&gt;Status&lt;/th&gt;&lt;tr&gt;      &lt;tr&gt;&lt;td&gt;Account&lt;/td&gt;&lt;td&gt;&lt;img SRC="dot_green.gif"/&gt;Online&lt;/td&gt;&lt;/tr&gt;      &lt;tr&gt;&lt;td&gt;Character&lt;/td&gt;&lt;td&gt;&lt;img SRC="dot_green.gif"/&gt;Online&lt;/td&gt;&lt;/tr&gt;      &lt;tr&gt;&lt;td&gt;Interact&lt;/td&gt;&lt;td&gt;&lt;img SRC="dot_green.gif"/&gt;Online&lt;/td&gt;&lt;/tr&gt;      &lt;tr&gt;&lt;td&gt;Zone&lt;/td&gt;&lt;td&gt;&lt;img SRC="dot_green.gif"/&gt;Online&lt;/td&gt;&lt;/tr&gt;      &lt;tr&gt;&lt;td&gt;Proxy&lt;/td&gt;&lt;td&gt;&lt;img SRC="dot_green.gif"/&gt;Online&lt;/td&gt;&lt;/tr&gt;    &lt;/table&gt;&lt;/div&gt;&lt;/div&gt;  &lt;/body&gt;&lt;/html&gt;</code></pre></div>In this file you see 5 types of servers: Account, Character, Interact, Zone and Proxy. Behind that is says if it's on- or offline<br><br>Now I want to make a script that will retrieve every server status and post it on the chan (the account server status goes to $account, character status goes to $character, etc.)<br><br>So I want to parse the file and select only row nrs. 8 till 13.<br>Then it has to search in those rows of it says ONLINE or OFFLINE<br>And than put that in the right variable (account status in $account, etc)<br><br>Could someone help me? I'm really stuck...been trying to make this for over a month now<br><br>thx.<br><br>Chris<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4215">cvanmeer</a> — Wed Jan 28, 2004 1:27 pm</p><hr />
]]></content>
	</entry>
	</feed>
