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

	<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-02-05T16:08:07-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Longbow]]></name></author>
		<updated>2005-02-05T16:08:07-04:00</updated>

		<published>2005-02-05T16:08:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=46288#p46288</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=46288#p46288"/>
		<title type="html"><![CDATA[Simple socket script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=46288#p46288"><![CDATA[
Thanks.<br><br>I just found another small problem....<br><br>HTML code:<div class="codebox"><p>Code: </p><pre><code>&lt;!--START--&gt;qwe&lt;br /&gt;asd&lt;br /&gt;zxc&lt;br /&gt;&lt;!--END--&gt;</code></pre></div>TCL snippet code:<div class="codebox"><p>Code: </p><pre><code>regexp {&lt;!--START--&gt;(.*?)&lt;br /&gt;} $html - firstregexp {&lt;br /&gt;(.*?)&lt;br /&gt;} $html - secondregexp {&lt;br /&gt;(.*?)&lt;br /&gt;&lt;!--END--&gt;} $html - thirdputserv "PRIVMSG $chan :$first"putserv "PRIVMSG $chan :$second"putserv "PRIVMSG $chan :$third"</code></pre></div>My bot says:<blockquote class="uncited"><div>qwe<br>asd<br>asd&lt;br /&gt;zxc</div></blockquote>As you can see the third line is saying "asd&lt;br /&gt;" when it shouldn't be. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_confused.gif" width="15" height="15" alt=":?" title="Confused"><br><br>And "qwe / asd / zxc" change each time by the way.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5887">Longbow</a> — Sat Feb 05, 2005 4:08 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[greenbear]]></name></author>
		<updated>2005-02-05T11:47:10-04:00</updated>

		<published>2005-02-05T11:47:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=46284#p46284</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=46284#p46284"/>
		<title type="html"><![CDATA[Simple socket script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=46284#p46284"><![CDATA[
Use <a href="http://tcl.tk/man/tcl8.5/TclCmd/expr.htm" class="postlink">expr</a>.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=24">greenbear</a> — Sat Feb 05, 2005 11:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Longbow]]></name></author>
		<updated>2005-02-05T11:37:41-04:00</updated>

		<published>2005-02-05T11:37:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=46283#p46283</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=46283#p46283"/>
		<title type="html"><![CDATA[Simple socket script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=46283#p46283"><![CDATA[
Ah, I was able to get it to work with another script, but whilst i'm here...<br><br>How do I calculate something in tcl?<br><br>I need $mem + $anon<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5887">Longbow</a> — Sat Feb 05, 2005 11:37 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2005-02-04T18:18:11-04:00</updated>

		<published>2005-02-04T18:18:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=46269#p46269</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=46269#p46269"/>
		<title type="html"><![CDATA[Simple socket script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=46269#p46269"><![CDATA[
hmm, the google script im using uses the commands in the order:<br>package require http<br>...<br>set token [http::config -useragent $agent]<br>set token [http::geturl $query]<br>set html  [http::data $token]<br><br>except the egghttp -&gt; http they seem very alike, maybe it helps.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Fri Feb 04, 2005 6:18 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Longbow]]></name></author>
		<updated>2005-02-04T17:46:01-04:00</updated>

		<published>2005-02-04T17:46:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=46268#p46268</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=46268#p46268"/>
		<title type="html"><![CDATA[Simple socket script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=46268#p46268"><![CDATA[
<blockquote class="uncited"><div>body =</div></blockquote> lol  <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=5887">Longbow</a> — Fri Feb 04, 2005 5:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[DragnLord]]></name></author>
		<updated>2005-02-04T17:12:01-04:00</updated>

		<published>2005-02-04T17:12:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=46267#p46267</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=46267#p46267"/>
		<title type="html"><![CDATA[Simple socket script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=46267#p46267"><![CDATA[
your code isn't parsing the webpage correctly<br><br>this will get messy, but at least it'll tell you if there is anything in $body to read:<br><br>putlog "body = $body"<br><br>that will show you everything in the $body variable at that point<br><br>from there it's a matter of tuning the regexps<br>such as:<blockquote class="uncited"><div>putlog "body = $body"<br>regexp {(.*?) Total} $body match ptotal</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4461">DragnLord</a> — Fri Feb 04, 2005 5:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Longbow]]></name></author>
		<updated>2005-02-04T14:29:00-04:00</updated>

		<published>2005-02-04T14:29:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=46259#p46259</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=46259#p46259"/>
		<title type="html"><![CDATA[Simple socket script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=46259#p46259"><![CDATA[
<blockquote class="uncited"><div>Well, one thing that jumps out at me is that in your callback, $nick is undefined.<br><br>Also, who knows if your regexp is actually working. There are many ways the html could be formatted to show the text you've given. If you gave the actual url it might help.</div></blockquote>Mm... true. Since it was originally a DCC command, i'll look into that.<br><br>As far as the web page, I did some server side coding to make it easyier for me.<br><br>It shows the amount of people online only in text. No extra html tags or anything are in the source code.<br><br>Edit: Ok I used putlog instead of privhelp, but still doesn't work. I used..<br><div class="codebox"><p>Code: </p><pre><code>putlog "test"</code></pre></div> And it worked, so something works, but when using<br><div class="codebox"><p>Code: </p><pre><code>  putlog "$ptotal Total, $pguests Guests, $pmemb Members, $panon Anonymous users online" </code></pre></div> Nothing happens.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5887">Longbow</a> — Fri Feb 04, 2005 2:29 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[DragnLord]]></name></author>
		<updated>2005-02-04T14:27:43-04:00</updated>

		<published>2005-02-04T14:27:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=46258#p46258</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=46258#p46258"/>
		<title type="html"><![CDATA[Simple socket script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=46258#p46258"><![CDATA[
Since your_callbackproc is called from pub:on, wouldn't $nick have been defined by pub:on?<br><br>The best way to "debug" a tcl script such as this is the use of putlog statements to show if the variables actually contain information.<br><br>example:<blockquote class="uncited"><div>regexp {(.*?) Total} $body match ptotal<br>putlog "total members = $ptotal"</div></blockquote>The script will then show the variable $ptotal in telnet/dcc chat.<br><br>Without having the actual url to check the source coding, it's nearly impossible to give further aid in parsing the information.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4461">DragnLord</a> — Fri Feb 04, 2005 2:27 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2005-02-04T13:48:22-04:00</updated>

		<published>2005-02-04T13:48:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=46256#p46256</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=46256#p46256"/>
		<title type="html"><![CDATA[Simple socket script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=46256#p46256"><![CDATA[
Well, one thing that jumps out at me is that in your callback, $nick is undefined.<br><br>Also, who knows if your regexp is actually working. There are many ways the html could be formatted to show the text you've given. If you gave the actual url it might help.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Fri Feb 04, 2005 1:48 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Longbow]]></name></author>
		<updated>2005-02-04T13:29:04-04:00</updated>

		<published>2005-02-04T13:29:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=46254#p46254</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=46254#p46254"/>
		<title type="html"><![CDATA[Simple socket script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=46254#p46254"><![CDATA[
Thanks, but your_callbackproc still isn't doing anything <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_eek.gif" width="15" height="15" alt=":shock:" title="Shocked"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5887">Longbow</a> — Fri Feb 04, 2005 1:29 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[DragnLord]]></name></author>
		<updated>2005-02-04T12:11:37-04:00</updated>

		<published>2005-02-04T12:11:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=46245#p46245</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=46245#p46245"/>
		<title type="html"><![CDATA[Simple socket script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=46245#p46245"><![CDATA[
this might work better for you:<br><blockquote class="uncited"><div>  proc your_callbackproc {sock} { <br>    global url <br>    set headers [egghttp:headers $sock] <br>    set body [egghttp:data $sock] <br>  <br>    regsub -all "\n" $body "" body <br>    regsub -all -nocase {&lt;br&gt;} $body "&lt;br&gt;\n" body <br><br>    regexp {(.*?) Total} $body match ptotal<br>    regexp {(.*?) guests} $body match pguests<br>    regexp {(.*?) members} $body match pmemb<br>    regexp {(.*?) anonymous} $body match panon<br><br>    puthelp "NOTICE $nick :$ptotal Total, $pguests Guests, $pmemb Members, $panon Anonymous users online" <br><br>  }</div></blockquote>I've never had much luck using more then one (.*?) per regexp.[/quote]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4461">DragnLord</a> — Fri Feb 04, 2005 12:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Longbow]]></name></author>
		<updated>2005-02-04T10:10:30-04:00</updated>

		<published>2005-02-04T10:10:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=46241#p46241</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=46241#p46241"/>
		<title type="html"><![CDATA[Simple socket script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=46241#p46241"><![CDATA[
Ok so....<br><div class="codebox"><p>Code: </p><pre><code># egghttp_example.tcl# Configset url "http://www.mysite.com/page.php?get=online"# End of configif {![info exists egghttp(version)]} {  putlog "egghttp.tcl was NOT successfully loaded."  putlog "egghttp_example.tcl has not been loaded as a result."} else {  proc your_callbackproc {sock} {    global url    set headers [egghttp:headers $sock]    set body [egghttp:data $sock]      regsub -all "\n" $body "" body    regsub -all -nocase {&lt;br&gt;} $body "&lt;br&gt;\n" body    regexp {(.*?) Total, (.*?) guests, (.*?) members, (.*?) anonymous members} $body - online    putserv "NOTICE $nick :$online"  }bind pub - !online pub:onproc pub:on {nick uhost hand chan text} {    global url     set sock [egghttp:geturl $url your_callbackproc]    return 1  }    putlog "egghttp_example.tcl has been successfully loaded."}</code></pre></div>the .php page contains the following....<br><div class="codebox"><p>Code: </p><pre><code>70 Total, 11 guests, 59 members, 0 anonymous members</code></pre></div>I'm not getting any error message now, however, when doing the command (!online) I got don't anything either.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5887">Longbow</a> — Fri Feb 04, 2005 10:10 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2005-02-04T09:24:34-04:00</updated>

		<published>2005-02-04T09:24:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=46240#p46240</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=46240#p46240"/>
		<title type="html"><![CDATA[Simple socket script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=46240#p46240"><![CDATA[
Part 1 from the tutorial: Loading and Checking for egghttp.tcl<br><br>If it can't find that command, maybe you left that part out!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Fri Feb 04, 2005 9:24 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2005-02-04T09:23:18-04:00</updated>

		<published>2005-02-04T09:23:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=46239#p46239</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=46239#p46239"/>
		<title type="html"><![CDATA[Simple socket script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=46239#p46239"><![CDATA[
look true this forum there is a sample on how you can use a async socket and a regular socket so.. search <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Fri Feb 04, 2005 9:23 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Longbow]]></name></author>
		<updated>2005-02-04T06:31:30-04:00</updated>

		<published>2005-02-04T06:31:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=46231#p46231</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=46231#p46231"/>
		<title type="html"><![CDATA[Simple socket script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=46231#p46231"><![CDATA[
<blockquote class="uncited"><div>if all else fails, you can check out StrikeLight's egghttp.tcl script and tutorial that can be found on <a href="http://www.tclscript.com" class="postlink">www.tclscript.com</a><br><br>you can get the script from <a href="http://www.tclscript.com/scripts.shtml" class="postlink">here</a><br><br><a href="http://www.tclscript.com/egghttp_tut.shtml" class="postlink">tutorial</a></div></blockquote>Thats what I said I used, but always get errors.<br><blockquote class="uncited"><div>Tcl error [pub:on]: invalid command name "egghttp:geturl"</div></blockquote><div class="codebox"><p>Code: </p><pre><code>set sock [egghttp:geturl $url your_callbackproc]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5887">Longbow</a> — Fri Feb 04, 2005 6:31 am</p><hr />
]]></content>
	</entry>
	</feed>
