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

	<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>2021-02-27T07:09:32-04:00</updated>

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

		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2021-02-27T07:09:32-04:00</updated>

		<published>2021-02-27T07:09:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109439#p109439</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109439#p109439"/>
		<title type="html"><![CDATA[finishing script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109439#p109439"><![CDATA[
Here's my approach: we create a global variable to store the the function's state (locked/unlocked) and based on that the function can continue it's execution or halt it so you have only one instance running at any given time even if function is called multiple times within a small time frame.<div class="codebox"><p>Code: </p><pre><code>proc something {your arguments in here} {global lockif {$lock} {# function was previously called and it's now in a locked state, so we halt the further code executionreturn} else {# function isn't locked so we first make sure we lock it and then continue with the execution of the codeset lock 1}# execute this code only once# when finished we unlock it so can be called again when needed but once per instanceset lock 0}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Sat Feb 27, 2021 7:09 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[haferbrei]]></name></author>
		<updated>2021-02-27T05:35:23-04:00</updated>

		<published>2021-02-27T05:35:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109438#p109438</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109438#p109438"/>
		<title type="html"><![CDATA[finishing script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109438#p109438"><![CDATA[
A command calls a script which should run only once until it is finished. It should not be called until it is finished. How can I make a query so that a command does not overlap?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12860">haferbrei</a> — Sat Feb 27, 2021 5:35 am</p><hr />
]]></content>
	</entry>
	</feed>
