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

	<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-05-30T15:30:55-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Papillon]]></name></author>
		<updated>2004-05-30T15:30:55-04:00</updated>

		<published>2004-05-30T15:30:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=36768#p36768</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=36768#p36768"/>
		<title type="html"><![CDATA[Start automatic and re-execute]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=36768#p36768"><![CDATA[
there is some errors in your code, first of, when calling a proc from a timer or utimer they are beeing executed at once, unless handeled correctly. And when you call the proc, you have to make sure it has the right amount of arguments<br><div class="codebox"><p>Code: </p><pre><code>#this is wrongtimer 1 nicksql#while this would worktimer 1 [list nicksql Papillon *!bla@bla.com Papi #tcl bla]</code></pre></div>ofc you're gonna have some problem if you want the $nick and $chan varaibles to be different each time...  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=852">Papillon</a> — Sun May 30, 2004 3:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2004-05-29T17:57:08-04:00</updated>

		<published>2004-05-29T17:57:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=36740#p36740</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=36740#p36740"/>
		<title type="html"><![CDATA[This sucks]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=36740#p36740"><![CDATA[
Any help is really appreciated here.<br><br>I have just tried with<br><div class="codebox"><p>Code: </p><pre><code>#Ausgabescript#!/usr/bin/tclsh8.3package require mysqltcltimer 1 nicksql proc nicksql { nick uhost hand chan args } {putserv "PRIVMSG $chan :Bot is listening"set mysql_handler [mysqlconnect -host localhost -port 3306 -user XXX -password XXX -db XXX]putserv "PRIVMSG $chan :After Database connect"mysqlexec $mysql_handler "DELETE FROM irc_online"foreach nick [chanlist $chan] {putserv "PRIVMSG $chan :$nick"mysqlexec $mysql_handler "INSERT INTO irc_online (Nickname) VALUES ('$nick');"}putserv "PRIVMSG $chan :After Database insert" mysqlclose $mysql_handlertimer 1 nicksql}</code></pre></div>And it is not working. When I am doing a bind pub to some textstring, the script works perfectly. Only when I am trying to use the timer/bind time or similiar, the bot won´t do anything in the channel. However, there is no failure message. Maybe someone can help to find a way out of here.<br><br>Thanks<br><br>Kato<p>Statistics: Posted by Guest — Sat May 29, 2004 5:57 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2004-05-29T13:27:55-04:00</updated>

		<published>2004-05-29T13:27:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=36727#p36727</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=36727#p36727"/>
		<title type="html"><![CDATA[Start automatic and re-execute]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=36727#p36727"><![CDATA[
Ok, now I have figured out my first Script ( <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_mrgreen.gif" width="15" height="15" alt=":mrgreen:" title="Mr. Green"> ). What I now want it to do, is to start once in the channel and then restart the procedure every 5 minutes.<br><br>I have tried to merge my script with this instruction <br><div class="codebox"><p>Code: </p><pre><code>if {![info exists myproc_running]} {       timer 20 myproc                          set myproc_running 1                   }                                                                                 proc myproc {} {                             # your stuff here ...                    # ...                                    timer 20 myproc                          return 1                             }          </code></pre></div>But I cannot get it to work. The bot will not start nor reexecute the procedure. I guess I am missing something. Now here is my script, which is currently bound to the trigger .test. Is there a way to remove the trigger, so that the procedure starts automatically for the first time and then reexecute the procedure nicksql every 5 minutes?<br> <div class="codebox"><p>Code: </p><pre><code>#Ausgabescript#!/usr/bin/tclsh8.3bind pub - .test nicksqlproc nicksql {nick uhost hand chan args} {                       putserv "PRIVMSG $chan :Bot is listening"set mysql_handler [mysqlconnect -host localhost -port 3306 -user XXX -password XXX -db XXX]#putserv "PRIVMSG $chan :After Database connect"mysqlexec $mysql_handler "DELETE FROM irc_online"foreach nick [chanlist $chan] {#putserv "PRIVMSG $chan :$nick"mysqlexec $mysql_handler "INSERT INTO irc_online (Nickname) VALUES ('$nick');"}#putserv "PRIVMSG $chan :After Database insert" mysqlclose $mysql_handler}</code></pre></div>Many thanks in advance for your support.<br><br>Kato<p>Statistics: Posted by Guest — Sat May 29, 2004 1:27 pm</p><hr />
]]></content>
	</entry>
	</feed>
