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

	<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>2009-03-25T19:44:34-04:00</updated>

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

		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-03-25T19:44:34-04:00</updated>

		<published>2009-03-25T19:44:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88108#p88108</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88108#p88108"/>
		<title type="html"><![CDATA[Help with script to say all nicks from chan]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88108#p88108"><![CDATA[
Variables are case sensitive... <br>Change this:<div class="codebox"><p>Code: </p><pre><code>utimer 5 [list set vflood 0]</code></pre></div>Into this:<div class="codebox"><p>Code: </p><pre><code>utimer 5 [list set vFlood 0]</code></pre></div>And everything should work just fine (assuming you are using arfer's code).<br><br>Also disregard speechles' talk 'bout global namespaces. Timers are always executed in the global namespace, and vFlood was linked to globalspace using the global command in that code.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Mar 25, 2009 7:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[unb0rn]]></name></author>
		<updated>2009-03-25T19:19:40-04:00</updated>

		<published>2009-03-25T19:19:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88106#p88106</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88106#p88106"/>
		<title type="html"><![CDATA[Help with script to say all nicks from chan]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88106#p88106"><![CDATA[
I have no idea what i'm doing wrong, but i can't get it to work properly with the "flood protection" ;/<br>i have to use it like this, otherwise it won't work more then once..<blockquote class="uncited"><div>set vFlood 0<br>utimer 5 <ul></ul></div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10194">unb0rn</a> — Wed Mar 25, 2009 7:19 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2009-03-25T17:44:41-04:00</updated>

		<published>2009-03-25T17:44:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88103#p88103</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88103#p88103"/>
		<title type="html"><![CDATA[Help with script to say all nicks from chan]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88103#p88103"><![CDATA[
<blockquote class="uncited"><div>I get this : <div class="codebox"><p>Code: </p><pre><code>[22:27] Tcl error [pNicklist]: invalid command name "wordwrap"</code></pre></div></div></blockquote>Well, did you include the procedure by user in the script by arfer? If not, then of course it's an invalid command name. The procedure supporting it must be added to the script...<div class="codebox"><p>Code: </p><pre><code>proc wordwrap {str {len 70} {splitChr { }}} {   set out [set cur {}]; set i 0   foreach word [split [set str][unset str] $splitChr] {      if {[incr i [string len $word]]&gt;$len} {         lappend out [join $cur $splitChr]         set cur [list $word]         set i [string len $word]      } {         lappend cur $word      }      incr i   }   lappend out [join $cur $splitChr]} </code></pre></div>Add the above to the bottom of the script (Full credit goes to user for the above, find the thread <a href="http://forum.egghelp.org/viewtopic.php?t=6690#33031" class="postlink">here</a>).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Wed Mar 25, 2009 5:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[DaRkOoO]]></name></author>
		<updated>2009-03-25T17:32:15-04:00</updated>

		<published>2009-03-25T17:32:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88102#p88102</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88102#p88102"/>
		<title type="html"><![CDATA[Help with script to say all nicks from chan]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88102#p88102"><![CDATA[
I get this : <div class="codebox"><p>Code: </p><pre><code>[22:27] Tcl error [pNicklist]: invalid command name "wordwrap"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10236">DaRkOoO</a> — Wed Mar 25, 2009 5:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-03-25T17:13:58-04:00</updated>

		<published>2009-03-25T17:13:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88101#p88101</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88101#p88101"/>
		<title type="html"><![CDATA[Help with script to say all nicks from chan]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88101#p88101"><![CDATA[
Yes I agree. I warned the original poster about the issue of many nicks exceeding the allowed text length in my first respionse to this thread.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Wed Mar 25, 2009 5:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2009-03-25T17:06:33-04:00</updated>

		<published>2009-03-25T17:06:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88100#p88100</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88100#p88100"/>
		<title type="html"><![CDATA[Help with script to say all nicks from chan]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88100#p88100"><![CDATA[
<blockquote class="uncited"><div>This dont work.If there is,for example,more than 50 nicks in channel bot will say just how much he can say in one msg,so lets say he can say about 40 nicks,and what about rest of nicks?</div></blockquote>Incorporate a wordwrap procedure, such as <a href="http://forum.egghelp.org/viewtopic.php?t=6690#33031" class="postlink">this one by user</a>. <br><div class="codebox"><p>Code: </p><pre><code>putserv "PRIVMSG $channel :[join [chanlist $tchan] ", "]"</code></pre></div>Change that above to this below...<div class="codebox"><p>Code: </p><pre><code>foreach line [wordwrap [join [chanlist $tchan] ", "]]] { putserv "privmsg $chan :$line" }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Wed Mar 25, 2009 5:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-03-25T17:04:39-04:00</updated>

		<published>2009-03-25T17:04:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88099#p88099</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88099#p88099"/>
		<title type="html"><![CDATA[Help with script to say all nicks from chan]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88099#p88099"><![CDATA[
I have tested the script pretty much as it stands, after increasing the flood time to a realistic value of 30 seconds. It works fine. Perhaps a return command at the end of the proc would be proper, as below (not convinced though that it would matter in this instance).<br><br>One other thing that could I suppose effect scripts. When I copy/paste from this site to my text editor, I get a whitespace at the end of each line. If that happens to you, get rid of them before you load the script on the bot.<br><div class="codebox"><p>Code: </p><pre><code>set vChannels "#EggTCL"set vFlood 0bind PUB - !nicks pNicklistproc pNicklist {nick uhost hand channel txt} {  global vChannels vFlood  if {!$vFlood} {    switch -- [llength [split $txt]] {      0 {set tchan $channel}      1 {set tchan $txt}    }    if {[info exists tchan]} {      if {[regexp {^#} $tchan]} {        if {[validchan $tchan]} {          if {[botonchan $tchan]} {            if {[lsearch -exact [string tolower $vChannels] [string tolower $tchan]] != -1} {              putserv "PRIVMSG $channel :[join [chanlist $tchan] ", "]"            }          } else {putserv "PRIVMSG $channel :-error- bot is not currently monitoring $tchan"}        } else {putserv "PRIVMSG $channel :-error- bot does not have a channel record for $tchan"}      } else {putserv "PRIVMSG $channel :-error- $tchan is not in the format of a valid channel name"}    } else {putserv "PRIVMSG $channel :-error- correct syntax is !nicks ?#channel?"}    set vFlood 1    utimer 30 [list set vFlood 0]  } else {putserv "PRIVMSG $channel :-flood- please try again later"}  return 0}</code></pre></div>This is the output at in the channel #EggTCL on DALnet :-<br><br>[20:45] &lt;@arfer&gt; !nicks<br>[20:45] &lt;@Baal&gt; Baal, Colossus, McKay, arfer<br>[20:45] &lt;@arfer&gt; !nicks<br>[20:45] &lt;@Baal&gt; -flood- please try again later<br>[20:45] &lt;@arfer&gt; !nicks<br>[20:45] &lt;@Baal&gt; -flood- please try again later<br>[20:45] &lt;@arfer&gt; !nicks<br>[20:45] &lt;@Baal&gt; -flood- please try again later<br>[20:46] &lt;@arfer&gt; !nicks<br>[20:46] &lt;@Baal&gt; Baal, Colossus, McKay, arfer<br><br>Following the first successful use of the command !nicks, subsequent use within the 30 seconds wait time results in the -flood- message. after 30 seconds the command responds again as expected.<br><br>The command has to get from your IRC client to the server and then from the server to your bot which then executes the code, responds to the server which responds to your IRC client. Whilst the Tcl code on your bot probably takes milliseconds to execute per cycle, the to'ing and fro'ing possibly takes up most if not all of the 5 seconds. Hence the next command works even though it appears to you to be within the 5 seconds flood time.<br><br>Anyway, I can now confirm that there is nothing wrong with the code (in my opinion). I don't intend modifying it further.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Wed Mar 25, 2009 5:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[DaRkOoO]]></name></author>
		<updated>2009-03-25T17:00:17-04:00</updated>

		<published>2009-03-25T17:00:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88098#p88098</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88098#p88098"/>
		<title type="html"><![CDATA[Help with script to say all nicks from chan]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88098#p88098"><![CDATA[
This dont work.If there is,for example,more than 50 nicks in channel bot will say just how much he can say in one msg,so lets say he can say about 40 nicks,and what about rest of nicks?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10236">DaRkOoO</a> — Wed Mar 25, 2009 5:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2009-03-25T17:00:38-04:00</updated>

		<published>2009-03-25T16:45:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88097#p88097</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88097#p88097"/>
		<title type="html"><![CDATA[Help with script to say all nicks from chan]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88097#p88097"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set vFlood 1 utimer 5 [list set vflood 0]</code></pre></div>There is the issue. The script tracks the global variable vflood and uses the global command to associate the local references as global ones. This works fine to set vflood to 1, meaning it's been used recently. The problem is, this timer will execute after the proc ends, meaning the association to the global variable vflood is lost. The set vflood 0 will occur in local space as a local variable and is immediately destroyed. The global variable vflood will remain set to 1, forever. Back and forth. The same 1.<br><div class="codebox"><p>Code: </p><pre><code>utimer 5 [list set ::vflood 0]</code></pre></div>We can use the global namespace identifier (::<strong class="text-strong"></strong>) and prefix vflood with this and it will now work, and remain tied to the global variable vflood. When the timer is invoked, it will return the global variable vflood to 0 and all is well in the world.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Wed Mar 25, 2009 4:45 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[unb0rn]]></name></author>
		<updated>2009-03-25T13:57:23-04:00</updated>

		<published>2009-03-25T13:57:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88093#p88093</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88093#p88093"/>
		<title type="html"><![CDATA[Help with script to say all nicks from chan]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88093#p88093"><![CDATA[
Once again i have to thank you for your help, but the reason why i don't know, but if i use the script, the only way to make it work again, i have to rehash it... ;/<br><br>i've been editing stuff, and i detected that if a change the "1" to "0", the problem stops, but the script doesn't stop when people flood it, and the "utimer" it's not doing nothing, 'cos i've tried to change from "5" to "1" and "0", and it's the same...<br><blockquote class="uncited"><div>utimer 5 [list set vflood <strong class="text-strong">0</strong>]</div></blockquote><br>Can you please help me using the other part of the script that i've pasted here, on this one?[/b][/quote]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10194">unb0rn</a> — Wed Mar 25, 2009 1:57 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-03-25T12:43:55-04:00</updated>

		<published>2009-03-25T12:43:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88090#p88090</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88090#p88090"/>
		<title type="html"><![CDATA[Help with script to say all nicks from chan]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88090#p88090"><![CDATA[
I can't think why the script has stuck with the flood setting but simply rehashing the bot would fix things.<br><br>Yes you could use something similar to the code you have seen in a previous script.<br><br>My personal prefference in these situations is to unbind the pub bind for 5 seconds to prevent its reuse within that timeframe but that method doesnt give easy opportunity to output a flood message.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Wed Mar 25, 2009 12:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[unb0rn]]></name></author>
		<updated>2009-03-25T05:29:09-04:00</updated>

		<published>2009-03-25T05:29:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88084#p88084</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88084#p88084"/>
		<title type="html"><![CDATA[Help with script to say all nicks from chan]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88084#p88084"><![CDATA[
I detected a problem ;x<br>I didn't change the time of wait before using the script again, to prevent flood, but, i do the command !nicks, and even if a wait 5s, or more(i tried waiting 2m, and the only thing that i see, is the message from flood), the command doesn't work, it always shows the message from the flood protection.<br><br>What could be?<br><br><br>btw, i have this from another script that i've done, that works pretty much the same way, but for another thing, it's possible to use this(what im about to show) on this script?<br><blockquote class="uncited"><div>set usedcmd [expr {[unixtime]-5}]<br><br>proc cmd {nick uhost hand chan arg} {<br> global usedcmd sex<br> if {[set t [expr {[unixtime]-$usedcmd}]] &lt; 5} {<br>  puthelp "privmsg $chan :Wait [expr {5-$t}] sc(s) or gtfo"<br>  return 0</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10194">unb0rn</a> — Wed Mar 25, 2009 5:29 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[unb0rn]]></name></author>
		<updated>2009-03-24T13:27:27-04:00</updated>

		<published>2009-03-24T13:27:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88069#p88069</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88069#p88069"/>
		<title type="html"><![CDATA[Help with script to say all nicks from chan]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88069#p88069"><![CDATA[
Thank you, it's working perfectly.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10194">unb0rn</a> — Tue Mar 24, 2009 1:27 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-03-24T08:41:11-04:00</updated>

		<published>2009-03-24T08:41:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88057#p88057</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88057#p88057"/>
		<title type="html"><![CDATA[Help with script to say all nicks from chan]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88057#p88057"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set vChannels "#chan1 #chan2"set vFlood 0bind PUB - !nicks pNicklistproc pNicklist {nick uhost hand channel txt} {  global vChannels vFlood  if {!$vFlood} {    switch -- [llength [split $txt]] {      0 {set tchan $channel}      1 {set tchan $txt}    }    if {[info exists tchan]} {      if {[regexp {^#} $tchan]} {        if {[validchan $tchan]} {          if {[botonchan $tchan]} {            if {[lsearch -exact [string tolower $vChannels] [string tolower $tchan]] != -1} {              putserv "PRIVMSG $channel :ALL NICKS FROM $tchan"              putserv "PRIVMSG $channel :[join [chanlist $tchan] ", "]"            }          } else {putserv "PRIVMSG $channel :-error- bot is not currently monitoring $tchan"}        } else {putserv "PRIVMSG $channel :-error- bot does not have a channel record for $tchan"}      } else {putserv "PRIVMSG $channel :-error- $tchan is not in the format of a valid channel name"}    } else {putserv "PRIVMSG $channel :-error- correct syntax is !nicks ?#channel?"}    set vFlood 1    utimer 5 [list set vflood 0]  } else {putserv "PRIVMSG $channel :-flood- please try again later"}}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Tue Mar 24, 2009 8:41 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[unb0rn]]></name></author>
		<updated>2009-03-24T08:01:22-04:00</updated>

		<published>2009-03-24T08:01:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88056#p88056</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88056#p88056"/>
		<title type="html"><![CDATA[Help with script to say all nicks from chan]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88056#p88056"><![CDATA[
How do i set the limit of time of commands that the users can use?<br><br>ex:<br>someone: !nicks<br>bot: ALL NICKS FROM THE CHANNEL<br>someone: !nicks<br>bot: you have to wait 5s, before using the command again<br><br>I want to put a selected time, so they have to wait a couple of seconds, and not flooding the bot/server.<br><br>and how do i put a message before the eggdrop says all nicks from the channel?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10194">unb0rn</a> — Tue Mar 24, 2009 8:01 am</p><hr />
]]></content>
	</entry>
	</feed>
