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

	<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>2014-08-09T09:36:46-04:00</updated>

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

		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2014-08-09T09:36:46-04:00</updated>

		<published>2014-08-09T09:36:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103141#p103141</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103141#p103141"/>
		<title type="html"><![CDATA[How to make a time limit between commands?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103141#p103141"><![CDATA[
You've restarted the bot, haven't you? <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=187">caesar</a> — Sat Aug 09, 2014 9:36 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[JaySon]]></name></author>
		<updated>2014-08-08T17:20:04-04:00</updated>

		<published>2014-08-08T17:20:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103136#p103136</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103136#p103136"/>
		<title type="html"><![CDATA[How to make a time limit between commands?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103136#p103136"><![CDATA[
Actually, it seems to be behaving the way it should for the most part now. I haven't changed anything from willyw's original suggestion, but if it ain't broke... I'll just leave it the way it is for now. Thanks all.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12421">JaySon</a> — Fri Aug 08, 2014 5:20 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2014-08-07T09:24:12-04:00</updated>

		<published>2014-08-07T09:24:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103135#p103135</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103135#p103135"/>
		<title type="html"><![CDATA[How to make a time limit between commands?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103135#p103135"><![CDATA[
<blockquote class="uncited"><div>The culprit is<div class="codebox"><p>Code: </p><pre><code>if {[info exists wait_toggle]} { </code></pre></div>as my guess in his case is that the <em class="text-italics">wait_toggle</em> variable exist and wasn't unset yet or won't be at all unless restarts the bot. </div></blockquote>Interesting.<br><blockquote class="uncited"><div>It was working for you cos that variable didn't exist, but starting with the second !test should you get the same error if you issued the same command withing the 30 seconds time frame.</div></blockquote>Actually, that wouldn't be an error - as that is what it is supposed to do.<br><br>Perhaps instead of checking for the existence of the variable, it would be better to set it to 0, and change it to 1, and back and forth like that - and check the value.<br>I really don't know why I did it the way I did - it was quick, and quite some time ago.<br><br>Thanks for your input.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Thu Aug 07, 2014 9:24 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2014-08-07T00:55:20-04:00</updated>

		<published>2014-08-07T00:55:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103133#p103133</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103133#p103133"/>
		<title type="html"><![CDATA[How to make a time limit between commands?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103133#p103133"><![CDATA[
The culprit is<div class="codebox"><p>Code: </p><pre><code>if {[info exists wait_toggle]} { </code></pre></div>as my guess in his case is that the <em class="text-italics">wait_toggle</em> variable exist and wasn't unset yet or won't be at all unless restarts the bot. It was working for you cos that variable didn't exist, but starting with the second !test should you get the same error if you issued the same command withing the 30 seconds time frame.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Thu Aug 07, 2014 12:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2014-08-06T12:06:27-04:00</updated>

		<published>2014-08-06T12:06:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103132#p103132</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103132#p103132"/>
		<title type="html"><![CDATA[How to make a time limit between commands?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103132#p103132"><![CDATA[
Ah.  <br>That's interesting, and could be a "better" idea for JaySon.<br><br>Have you read all the above?  Any ideas as to why the simple thing that I've done is behaving differently for him and me?<br><br>Thanks.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Wed Aug 06, 2014 12:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2014-08-06T11:30:38-04:00</updated>

		<published>2014-08-06T11:30:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103131#p103131</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103131#p103131"/>
		<title type="html"><![CDATA[How to make a time limit between commands?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103131#p103131"><![CDATA[
If you use it as is in his example and have <em class="text-italics">nick,channel</em> as <em class="text-italics">id</em> then that's correct, but this doesn't stop you from changing from <em class="text-italics">nick,channel</em> to just <em class="text-italics">channel</em>.<blockquote class="uncited"><div>example limiting usage by same user@host on a specific channel<br>(the id part can be what ever you like of course) </div></blockquote>From his example replace the:<div class="codebox"><p>Code: </p><pre><code>if {[throttled $u,$c 30]} {</code></pre></div>to:<div class="codebox"><p>Code: </p><pre><code>if {[throttled $c 30]} {</code></pre></div>for instance.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Wed Aug 06, 2014 11:30 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2014-08-06T07:58:42-04:00</updated>

		<published>2014-08-06T07:58:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103130#p103130</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103130#p103130"/>
		<title type="html"><![CDATA[How to make a time limit between commands?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103130#p103130"><![CDATA[
<blockquote class="uncited"><div>Have a look at user's <a href="http://forum.egghelp.org/viewtopic.php?t=9009#45537" class="postlink">throttled</a> function.</div></blockquote>I thought of that too, but seemed to recall that it throttles a particular user from re-using a command within a given time.   <br>Do you know - is that correct?   <br><br>I think JaySon wants some command to be protected from repeated use by anybody, for a given amount of time.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Wed Aug 06, 2014 7:58 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2014-08-06T07:55:35-04:00</updated>

		<published>2014-08-06T07:55:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103129#p103129</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103129#p103129"/>
		<title type="html"><![CDATA[How to make a time limit between commands?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103129#p103129"><![CDATA[
<blockquote class="uncited"><div>...<br>Unfortunately, this now sends the message "wait a bit" even when it's the first time the person has issues the command. So now users can never issue the !test command without it executing the proper commands. It always just says "wait a bit" every single time the command is issued.</div></blockquote>This is mysterious then.  It doesn't do that for me.  I just tried it, again - and it works for me.<br><br>We need to figure out what I'm doing different from you, or vice versa.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Wed Aug 06, 2014 7:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2014-08-06T00:54:07-04:00</updated>

		<published>2014-08-06T00:54:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103128#p103128</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103128#p103128"/>
		<title type="html"><![CDATA[How to make a time limit between commands?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103128#p103128"><![CDATA[
Have a look at user's <a href="http://forum.egghelp.org/viewtopic.php?t=9009#45537" class="postlink">throttled</a> function.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Wed Aug 06, 2014 12:54 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[JaySon]]></name></author>
		<updated>2014-08-05T21:41:16-04:00</updated>

		<published>2014-08-05T21:41:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103126#p103126</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103126#p103126"/>
		<title type="html"><![CDATA[How to make a time limit between commands?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103126#p103126"><![CDATA[
Hi willyw, thanks for your time.<br><br>Unfortunately, this now sends the message "wait a bit" even when it's the first time the person has issues the command. So now users can never issue the !test command without it executing the proper commands. It always just says "wait a bit" every single time the command is issued.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12421">JaySon</a> — Tue Aug 05, 2014 9:41 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2014-08-04T23:48:16-04:00</updated>

		<published>2014-08-04T23:48:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103121#p103121</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103121#p103121"/>
		<title type="html"><![CDATA[How to make a time limit between commands?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103121#p103121"><![CDATA[
<blockquote class="uncited"><div>Unfortunately, this does not work. Here is my code:<br>...<br>You can still execute the command successfully without waiting 30 seconds.</div></blockquote><br>Yep.<br>Mine was simple, and obviously different.<br><br>See what I moved:<br><div class="codebox"><p>Code: </p><pre><code>bind pub - !test testproc test {nick uhost hand chan args} {global test1targets test2targets test2places test1places wait_toggle       if {[info exists wait_toggle]} {                puthelp "PRIVMSG $nick :Wait a bit"                return 0           }# Just cut this from where it was, and paste it here  set wait_toggle "1"        utimer 30 [list unset wait_toggle]   set test1place [lindex $test1places [rand [llength test1places]]]   set dummies [lindex $test1targets [rand [llength $test1targets]]]      if ![file exists "/eggdrop/scripts/test1"] {       set f [open "/eggdrop/scripts/test1" w]       puts $f "test 1 a"       close $f      }   set f [open "/eggdrop/scripts/test1" r]   gets $f testrec   close $f   set maxtest1 [lindex $testrec 1]      set maxtest1 [expr $maxtest1 + 100]   set testnumber [rand $maxtest1]   puthelp "PRIVMSG $chan :$nick testing"   if [rand 2] {      utimer 2 [list puthelp "privmsg $chan :testing 2"]   } else {      utimer 2 [list puthelp "privmsg $chan :testing 3"]      return 1   }set f [open "/eggdrop/scripts/test1" r]gets $f testrecclose $fif { $testnumber &gt; [lindex $testrec 1] } {   utimer 4 [list puthelp "privmsg $chan :great test"]   utimer 6 [list puthelp "privmsg $chan :very great"]   set f [open "/eggdrop/scripts/test1" w]   puts $f "$nick $testnumber $dummies"   close $f   return 1} else {   utimer 4 [list puthelp "privmsg $chan :no test"]   return 1} } </code></pre></div>Try that.<br>( with some made up values to the global variables, and different paths,<br>it worked for me.    Bot pm'd me with "Wait a bit". )<br><br>I have no idea why I did it the way I first showed it to you. <br>That was from the little script that I threw together for myself, long ago.<br>I remembered it, found it, and picked out the lines, and posted here.<br><br>I hope this works for you now.    <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=10420">willyw</a> — Mon Aug 04, 2014 11:48 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[JaySon]]></name></author>
		<updated>2014-08-04T22:20:59-04:00</updated>

		<published>2014-08-04T22:20:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103120#p103120</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103120#p103120"/>
		<title type="html"><![CDATA[How to make a time limit between commands?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103120#p103120"><![CDATA[
Unfortunately, this does not work. Here is my code:<br><div class="codebox"><p>Code: </p><pre><code>bind pub - !test testproc test {nick uhost hand chan args} {global test1targets test2targets test2places test1places wait_toggle       if {[info exists wait_toggle]} {                puthelp "PRIVMSG $nick :Wait a bit"                return 0           }set test1place [lindex $test1places [rand [llength test1places]]]set dummies [lindex $test1targets [rand [llength $test1targets]]]      if ![file exists "/eggdrop/scripts/test1"] {       set f [open "/eggdrop/scripts/test1" w]       puts $f "test 1 a"       close $f      }set f [open "/eggdrop/scripts/test1" r]gets $f testrecclose $fset maxtest1 [lindex $testrec 1]      set maxtest1 [expr $maxtest1 + 100]set testnumber [rand $maxtest1]puthelp "PRIVMSG $chan :$nick testing"if [rand 2] {utimer 2 [list puthelp "privmsg $chan :testing 2"]} else {utimer 2 [list puthelp "privmsg $chan :testing 3"]return 1}set f [open "/eggdrop/scripts/test1" r]gets $f testrecclose $fif { $testnumber &gt; [lindex $testrec 1] } {utimer 4 [list puthelp "privmsg $chan :great test"]utimer 6 [list puthelp "privmsg $chan :very great"]set f [open "/eggdrop/scripts/test1" w]puts $f "$nick $testnumber $dummies"close $freturn 1} else {utimer 4 [list puthelp "privmsg $chan :no test"]return 1}   set wait_toggle "1"        utimer 30 [list unset wait_toggle]}</code></pre></div>You can still execute the command successfully without waiting 30 seconds.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12421">JaySon</a> — Mon Aug 04, 2014 10:20 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2014-08-04T21:04:42-04:00</updated>

		<published>2014-08-04T21:04:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103119#p103119</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103119#p103119"/>
		<title type="html"><![CDATA[Re: How to make a time limit between commands?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103119#p103119"><![CDATA[
<blockquote class="uncited"><div>Is there a quick/easy/simple way to make some sort of delay between the bind commands? So the command can only be used once every minute or whatever (and the bot seconds a PRIVMSG stating this information).</div></blockquote><br>I do this with one little script of mine.  I just didn't want the proc to be hammered.<br><br>Example:<br><div class="codebox"><p>Code: </p><pre><code>bind pub - "!your_command" your_procproc your_proc {nick uhost handle chan text} {global wait_toggle       if {[info exists wait_toggle]} {                putserv "notice $nick :Wait [lindex [utimers] [lsearch -index 1 [utimers] *wait_toggle*] 0] seconds, and try again"                return 0           }      ###########            # in here is whatever you want, for your proc         ###########set wait_toggle "1"        utimer 20 [list unset wait_toggle]}</code></pre></div>This will create a 20 second delay.  If the proc is called within 20 seconds after first being called, it will notice the user that triggered the bind, telling him how long to wait before trying again.<br><br>I hope this helps.<br><br>You might get other and better ideas, too.<br><br><br><br>p.s.<br>I had to make a few small edits from my original working code.  I hope I made no typos.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Mon Aug 04, 2014 9:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[JaySon]]></name></author>
		<updated>2014-08-04T19:15:42-04:00</updated>

		<published>2014-08-04T19:15:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103117#p103117</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103117#p103117"/>
		<title type="html"><![CDATA[How to make a time limit between commands?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103117#p103117"><![CDATA[
Is there a quick/easy/simple way to make some sort of delay between the bind commands? So the command can only be used once every minute or whatever (and the bot seconds a PRIVMSG stating this information).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12421">JaySon</a> — Mon Aug 04, 2014 7:15 pm</p><hr />
]]></content>
	</entry>
	</feed>
