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

	<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>2010-09-21T05:59:50-04:00</updated>

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

		<entry>
		<author><name><![CDATA[game_over]]></name></author>
		<updated>2010-09-21T05:59:50-04:00</updated>

		<published>2010-09-21T05:59:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94459#p94459</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94459#p94459"/>
		<title type="html"><![CDATA[Run a proc delayed]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94459#p94459"><![CDATA[
And why not call your procedure again. I mean<div class="codebox"><p>Code: </p><pre><code>proc somename {args} {....::http::register https 443 ::tls::socketif {![catch {set http_handle [http::geturl $the_url -binary 1 -timeout $::check(timeout)]} error]} {   set http_status [http::status $http_handle]   if {$http_status == "ok"} {      if {[http::ncode $http_handle] == 200} {         set http_data [::http::data $http_handle]         ::http::cleanup $http_handle         set File [::mysql::escape $http_data]         ::mysql::encoding $db_handle binary         set sql [::mysql::sel $db_handle "INSERT INTO ...      }   } elseif {$http_status == "timeout"} {      sendmsg $channel "\002\00304\[ERROR\]\002\003 \002Connection timed out - $the_url ... Retrying ..."     somename $args; #you have already defined all that you need   } elseif {[http::ncode $http_handle] == 404} { ......}</code></pre></div>if you use you method you must re-define error like -timeout again and again <br><br>, and nml375 is right after block eggdrop for some time but -timeout option all so use after in http.tcl<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8946">game_over</a> — Tue Sep 21, 2010 5:59 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2010-09-19T15:13:56-04:00</updated>

		<published>2010-09-19T15:13:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94446#p94446</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94446#p94446"/>
		<title type="html"><![CDATA[Run a proc delayed]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94446#p94446"><![CDATA[
Elfriede,<br>What you need to do, is to split your proc up into several pieces, thus allowing you to call the second http-transaction separately from the first one using a timer.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sun Sep 19, 2010 3:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Elfriede]]></name></author>
		<updated>2010-09-19T09:52:07-04:00</updated>

		<published>2010-09-19T09:52:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94444#p94444</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94444#p94444"/>
		<title type="html"><![CDATA[Run a proc delayed]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94444#p94444"><![CDATA[
I really appreciate ur answer and im quite sure i do "understand", but im unsure how to use that on my proc. Actually it looks like:<br><div class="codebox"><p>Code: </p><pre><code>::http::register https 443 ::tls::socketif {![catch {set http_handle [http::geturl $the_url -binary 1 -timeout $::check(timeout)]} error]} {set http_status [http::status $http_handle]if {$http_status == "ok"} {if {[http::ncode $http_handle] == 200} {set http_data [::http::data $http_handle]::http::cleanup $http_handleset File [::mysql::escape $http_data]::mysql::encoding $db_handle binaryset sql [::mysql::sel $db_handle "INSERT INTO ...}} elseif {$http_status == "timeout"} {sendmsg $channel "\002\00304\[ERROR\]\002\003 \002Connection timed out - $the_url ... Retrying ..."set http_data [::http::data $http_handle]::http::cleanup $http_handleset File [::mysql::escape [getPage $the_url]]::mysql::encoding $db_handle binaryset sql [::mysql::sel $db_handle "INSERT INTO...} elseif {[http::ncode $http_handle] == 404} {</code></pre></div>The first part, as shown here, uses a timeout of 3 seconds. In case of timeout, ur example code should retry xx seconds delayed, but i dunno the best way to use it. May u please help <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9204">Elfriede</a> — Sun Sep 19, 2010 9:52 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2010-09-18T12:14:48-04:00</updated>

		<published>2010-09-18T12:14:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94440#p94440</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94440#p94440"/>
		<title type="html"><![CDATA[Run a proc delayed]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94440#p94440"><![CDATA[
I would not recommend using the <strong class="text-strong">after</strong> command in blocking mode, as eggdrop is single-threaded, and blocking behavior prevents the eggdrop from taking any actions at all during the block.<br><br>I'd rather recommend using the utimer command to schedule a piece of code to be executed at a later time, or if possible, use the -command option with your http-request to use an event-driven mode:<br><div class="codebox"><p>Code: </p><pre><code>::http::register https 443 ::tls::socket ::http::geturl "http://www.example.com/" -binary 1 -command handle_responseproc handle_response {token} {  if {[::http::status $token] == "ok"} {    set File [::mysql::escape [::http::data $token]]    utimer 20 [list handle_final $File]  }  ::http::cleanup}proc handle_final {File} {  #this is called 20 seconds after the http-transaction is completed...  putlog "The MySQL-escaped filename was $File"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sat Sep 18, 2010 12:14 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[doggo]]></name></author>
		<updated>2010-09-18T10:55:19-04:00</updated>

		<published>2010-09-18T10:55:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94439#p94439</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94439#p94439"/>
		<title type="html"><![CDATA[Run a proc delayed]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94439#p94439"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>} elseif {$http_status == "timeout"} {    sendmsg # "\002\00304\[ERROR\]\002\003 \002Connection timed out - $the_url ... Retrying ..."    set http_data [::http::data $http_handle]    ::http::cleanup $http_handle    set File [::mysql::escape [getPage $the_url]]    ..... proc getPage { the_url } { putlog "wait"after 3000 ;# Simulates deep thoughtputlog "now"   ::http::register https 443 ::tls::socket    set token [::http::geturl $the_url -binary 1 -timeout 10000]    set data [::http::data $token]    ::http::cleanup $token    return $data } </code></pre></div>you could give this a go <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11046">doggo</a> — Sat Sep 18, 2010 10:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Elfriede]]></name></author>
		<updated>2010-09-17T03:05:59-04:00</updated>

		<published>2010-09-17T03:05:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94421#p94421</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94421#p94421"/>
		<title type="html"><![CDATA[Run a proc delayed]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94421#p94421"><![CDATA[
Hi : Its me again ^^<br><br>Here's my code:<br><div class="codebox"><p>Code: </p><pre><code>} elseif {$http_status == "timeout"} {sendmsg # "\002\00304\[ERROR\]\002\003 \002Connection timed out - $the_url ... Retrying ..."set http_data [::http::data $http_handle]::http::cleanup $http_handleset File [::mysql::escape [getPage $the_url]].....proc getPage { the_url } {::http::register https 443 ::tls::socketset token [::http::geturl $the_url -binary 1 -timeout 10000]set data [::http::data $token]::http::cleanup $tokenreturn $data}</code></pre></div>As u can see i have a timeout of 10s in the getPage proc. What i'm looking for is that this part:<br>set File [::mysql::escape [getPage $the_url]]<br>would be called for eg lets say 20 seconds later, instead of needing/using such a high timeout in my getPage proc. Everything ive tried till yet ended up in errors :/<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9204">Elfriede</a> — Fri Sep 17, 2010 3:05 am</p><hr />
]]></content>
	</entry>
	</feed>
