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

	<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>2007-09-05T12:33:16-04:00</updated>

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

		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-09-05T12:33:16-04:00</updated>

		<published>2007-09-05T12:33:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75732#p75732</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75732#p75732"/>
		<title type="html"><![CDATA[My request script. [wont validate.]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75732#p75732"><![CDATA[
A few comments on the last few posts:<br><ul><li>Returning 1 when triggered by a raw binding will prevent any further processing. In this case, depending on order, this would completely disable eggdrop's ability of maintaining the internal channel-memers list.</li><li>Using raw-bindings with the output of NAMES has the disadvantage that you would have to manually process any and all RPL_NAMREPLY replies along with the RPL_ENDOFNAMES, as this will not update the internal channel-members list, whereas, using the output of WHO allows you to use chanlist without any manual processing. Care should however be taken to make sure this is done after eggdrop has processed this message itself.</li><li>The is still an issue with unescaped [ in tosser's last post, see user's post erlier in the thread... as stated by awyeah, there should not be an additional ] within request:endofwho.</li><li>pub:request is flawed as it uses list commands (lindex) on a string. It also splits $nick for some unknown reason. Lastly, the check against the blocked channels list does not properly care for case.</li><li>The list of blocked channels could easily be broken, if not careful with characters affecting list structures.</li></ul><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Sep 05, 2007 12:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2007-09-05T11:08:11-04:00</updated>

		<published>2007-09-05T11:08:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75726#p75726</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75726#p75726"/>
		<title type="html"><![CDATA[My request script. [wont validate.]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75726#p75726"><![CDATA[
This would be the correct code I beleive:<br><div class="codebox"><p>Code: </p><pre><code>proc request:endofwho {from raw arg} { global requestchannel requestnick if {[string equal -nocase [lindex [split $arg] 1] $requestchannel]} {  request:join_chan $requestchannel $requestnick  return 1  }}</code></pre></div>Tosser's code was correct. You added an extra bracket which would generate an error in the proc and will not make it execute.<br><br><em class="text-italics">Technique: In a statement, all opening brackets "[" should be equal to all "]" closing brackets. Only then the statement would be balanced. This goes for all type of brackets. (round brackets and also curly braces)</em><br><br><strong class="text-strong">If there was an error because of a missing-bracket, it must be in some other proc, this one is correct. Besides I see in one of your procs (in a putserv statement) you have not escaped the [, ] brackets and left them as they are.</strong><br><em class="text-italics">Hint: Read <strong class="text-strong">user's</strong> post.</em><br><br><span style="color:red">Remember to escape all tcl special characters ([, ], {, }, \, $, &amp; etc) with a "\" infront of them. Your script is choking on brackets from what I see, so fix it.</span><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Wed Sep 05, 2007 11:08 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Youri]]></name></author>
		<updated>2007-09-05T07:23:46-04:00</updated>

		<published>2007-09-05T07:23:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75724#p75724</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75724#p75724"/>
		<title type="html"><![CDATA[My request script. [wont validate.]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75724#p75724"><![CDATA[
you missed a ] at <div class="codebox"><p>Code: </p><pre><code>proc request:endofwho {from raw arg} {   global requestchannel requestnick   if {[string equal -nocase [lindex [split $arg] 1]] $requestchannel]} {      request:join_chan $requestchannel $requestnick      return 1   }} </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5970">Youri</a> — Wed Sep 05, 2007 7:23 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2007-09-05T04:51:11-04:00</updated>

		<published>2007-09-05T04:51:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75720#p75720</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75720#p75720"/>
		<title type="html"><![CDATA[My request script. [wont validate.]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75720#p75720"><![CDATA[
<blockquote class="uncited"><div><blockquote class="uncited"><div>chanlist will output the content of eggdrop's internal list of channel-members, it will not trigger a fetch from the server. Thus, if you call it too soon from your eggie joining a channel, you will not get a list of the channel members.<br>Hence, you'd need to delay that process until the internal list has been fully updated... Either using a timer, or a raw binding triggering on the numeric for "End of who".</div></blockquote>I was not aware of that. Learned something new &lt;tips hat&gt; <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"></div></blockquote>Also you can use the raw binding, with the command: <em class="text-italics">/NAMES #channel</em><br>This can be done immediately on join and does not need any delay when called. It will give you the member-list of the channel from the server. Also nicks with ops and voices will have their respective operator sign infront of them.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Wed Sep 05, 2007 4:51 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2007-09-04T23:29:44-04:00</updated>

		<published>2007-09-04T23:29:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75714#p75714</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75714#p75714"/>
		<title type="html"><![CDATA[My request script. [wont validate.]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75714#p75714"><![CDATA[
<blockquote class="uncited"><div>chanlist will output the content of eggdrop's internal list of channel-members, it will not trigger a fetch from the server. Thus, if you call it too soon from your eggie joining a channel, you will not get a list of the channel members.<br>Hence, you'd need to delay that process until the internal list has been fully updated... Either using a timer, or a raw binding triggering on the numeric for "End of who".</div></blockquote>I was not aware of that. Learned something new &lt;tips hat&gt; <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=7395">rosc2112</a> — Tue Sep 04, 2007 11:29 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[r0t3n]]></name></author>
		<updated>2007-09-04T16:58:01-04:00</updated>

		<published>2007-09-04T16:58:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75709#p75709</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75709#p75709"/>
		<title type="html"><![CDATA[My request script. [wont validate.]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75709#p75709"><![CDATA[
Updated:<br><div class="codebox"><p>Code: </p><pre><code>############################################################ Package Name:          Request                          ## Package Author:        Youri &lt; xeonnn@gmail.com &gt;       ## Package Version:       1                                ############################################################bind pub -|- .request pub:requestbind msg -|- .help pub:helpbind raw - {315} request:endofwhoset requestchannel ""set requestnick ""proc pub:help {nick uhost handle text} {  putserv "PRIVMSG $nick : \[HELP\] To request the bot, typ .request &lt;channel&gt;"  putserv "PRIVMSG $nick : \[HELP\] The channel needs to have minium 20 people, and you need a operator status."  putserv "PRIVMSG $nick : \[HELP\] If the requested channel doesnt require the rules the bot will leave."}proc pub:request {nick uhost handle chan text} {   global requestchannel requestnick   set requestchannel [string tolower [lindex $text 0]]   set requestnick [split $nick]   set blocked(active) no   set blocked(channels) {    "#help"    "#xeoN.development"   }   foreach block $blocked(channels) {     if { $block == $requestchannel } { set blocked(active) yes  }   }  if { $blocked(active) == yes } {     putserv "PRIVMSG $nick : \[ERROR\] $requestchannel has been blocked from the request service."  } else {     channel add $requestchannel     putserv "PRIVMSG $nick : \[APPROVED\] $requestchannel has been approved, validation will begin in a couple seconds."  }}proc request:endofwho {from raw arg} {   global requestchannel requestnick   if {[string equal -nocase [lindex [split $arg] 1] $requestchannel]} {      request:join_chan $requestchannel $requestnick      return 1   }}proc request:join_chan { requestchannel requestnick } {  set t_users [llength [chanlist $requestchannel]]  set usercheck [expr $t_users - 1]  if { $usercheck &gt;= 20  &amp;&amp; [isop $requestnick] } {    putserv "PRIVMSG $requestnick : \[VALIDATION\] Found 20, or more users in $requestchannel ."    putserv "PRIVMSG $requestnick : \[VALIDATION\] You have operator(@)."    putserv "PRIVMSG $requestnick : [\VALIDATION\] The channel meets the requirements, the bot will stay."  } else {    putserv "PRIVMSG $requestnick : \[ERROR\] The channel does not meet the requirements."    putserv "PRIVMSG $requestnick : \[ERROR\] Typ .help to see the requirements."    channel remove $requestchannel  }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6300">r0t3n</a> — Tue Sep 04, 2007 4:58 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-09-04T15:29:23-04:00</updated>

		<published>2007-09-04T15:29:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75707#p75707</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75707#p75707"/>
		<title type="html"><![CDATA[My request script. [wont validate.]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75707#p75707"><![CDATA[
Still have to add proper return-values to prevent your eggie from going nuts...<blockquote class="uncited"><div>    (17) RAW (stackable)<br>         bind raw &lt;flags&gt; &lt;keyword&gt; &lt;proc&gt;<br>         procname &lt;from&gt; &lt;keyword&gt; &lt;text&gt;<br><br>         Description: previous versions of Eggdrop required a special compile<br>           option to enable this binding, but it's now standard. The keyword<br>           is either a numeric, like "368", or a keyword, such as "PRIVMSG".<br>           from will be the server name or the source user (depending on<br>           the keyword); flags are ignored. The order of the arguments is<br>           identical to the order that the IRC server sends to the bot. The<br>           pre-processing  only splits it apart enough to determine the<br>           keyword. <strong class="text-strong"><span style="text-decoration:underline">If the proc returns 1, Eggdrop will not process the line<br>           any further (this could cause unexpected behavior in some cases).</span></strong><br>         Module: server</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Tue Sep 04, 2007 3:29 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[r0t3n]]></name></author>
		<updated>2007-09-04T15:24:13-04:00</updated>

		<published>2007-09-04T15:24:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75706#p75706</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75706#p75706"/>
		<title type="html"><![CDATA[My request script. [wont validate.]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75706#p75706"><![CDATA[
if you want the bind active all the time, remove the catch lines and add the bind raw line under the other pub/msg bind lines.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6300">r0t3n</a> — Tue Sep 04, 2007 3:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-09-04T15:11:44-04:00</updated>

		<published>2007-09-04T15:11:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75705#p75705</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75705#p75705"/>
		<title type="html"><![CDATA[My request script. [wont validate.]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75705#p75705"><![CDATA[
Idea looks good, a few thoughts tho..<br>When working with raw-bindings, the returncode of the proc is very important, as it determines wether any further processing will be done, and bindings added with scripts trigger before those built in. If a return-value is not provided explicitly, an implicit return-value will be generated from the last executed command within the proc (in this case; catch {unbind raw - {315} request:endofwho})<br><br> Also, would'nt it be easier to keep the binding active at all times, extract the channel-name from the message body, and check wether this matches the channel you're trying to validate (in theory, the triggered binding may be from a different who-query, although very unlikely).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Tue Sep 04, 2007 3:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[r0t3n]]></name></author>
		<updated>2007-09-04T14:59:28-04:00</updated>

		<published>2007-09-04T14:59:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75704#p75704</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75704#p75704"/>
		<title type="html"><![CDATA[My request script. [wont validate.]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75704#p75704"><![CDATA[
i bind to raw 315 (end of /who), and then continue.<br><div class="codebox"><p>Code: </p><pre><code>############################################################ Package Name:          Request                          ## Package Author:        Youri &lt; xeonnn@gmail.com &gt;       ## Package Version:       1                                ############################################################bind pub -|- .request pub:requestbind msg -|- .help pub:helpset requestchannel ""set requestnick ""proc pub:help {nick uhost handle text} {  putserv "PRIVMSG $nick : \[HELP\] To request the bot, typ .request &lt;channel&gt;"  putserv "PRIVMSG $nick : \[HELP\] The channel needs to have minium 20 people, and you need a operator status."  putserv "PRIVMSG $nick : \[HELP\] If the requested channel doesnt require the rules the bot will leave."}proc pub:request {nick uhost handle chan text} {   global requestchannel requestnick   set requestchannel [string tolower [lindex $text 0]]   set requestnick [split $nick]   set blocked(active) no   set blocked(channels) {    "#help"    "#xeoN.development"   }   foreach block $blocked(channels) {     if { $block == $requestchannel } { set blocked(active) yes  }   }  if { $blocked(active) == yes } {     putserv "PRIVMSG $nick : \[ERROR\] $requestchannel has been blocked from the request service."  } else {     catch {bind raw - {315} request:endofwho}     channel add $requestchannel     putserv "PRIVMSG $nick : \[APPROVED\] $requestchannel has been approved, validation will begin in a couple seconds."  }}proc request:endofwho {from raw arg} {   global requestchannel requestnick   if {[string equal -nocase [lindex [split $arg] 1] $requestchannel]} {      request:join_chan $requestchannel $requestnick      catch {unbind raw - {315} request:endofwho}   }}proc request:join_chan { requestchannel requestnick } {  set t_users [llength [chanlist $requestchannel]]  set usercheck [expr $t_users - 1]  if { $usercheck &gt;= 20  &amp;&amp; [isop $requestnick] } {    putserv "PRIVMSG $requestnick : \[VALIDATION\] Found 20, or more users in $requestchannel ."    putserv "PRIVMSG $requestnick : \[VALIDATION\] You have operator(@)."    putserv "PRIVMSG $requestnick : [\VALIDATION\] The channel meets the requirements, the bot will stay."  } else {    putserv "PRIVMSG $requestnick : \[ERROR\] The channel does not meet the requirements."    putserv "PRIVMSG $requestnick : \[ERROR\] Typ .help to see the requirements."    channel remove $requestchannel  }}</code></pre></div>Might work, might not.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6300">r0t3n</a> — Tue Sep 04, 2007 2:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-09-04T14:19:54-04:00</updated>

		<published>2007-09-04T14:19:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75700#p75700</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75700#p75700"/>
		<title type="html"><![CDATA[My request script. [wont validate.]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75700#p75700"><![CDATA[
chanlist will output the content of eggdrop's internal list of channel-members, it will not trigger a fetch from the server. Thus, if you call it too soon from your eggie joining a channel, you will not get a list of the channel members.<br>Hence, you'd need to delay that process until the internal list has been fully updated... Either using a timer, or a raw binding triggering on the numeric for "End of who".<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Tue Sep 04, 2007 2:19 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2007-09-04T14:15:26-04:00</updated>

		<published>2007-09-04T14:15:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75699#p75699</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75699#p75699"/>
		<title type="html"><![CDATA[My request script. [wont validate.]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75699#p75699"><![CDATA[
Shouldn't need any timers, since the bot will wait til the result of [chanlist] is returned before doing the next commands..<br><br><br>Try putting some "putcmdlog" lines into your script to aid in debugging the process.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Tue Sep 04, 2007 2:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Youri]]></name></author>
		<updated>2007-09-04T10:05:50-04:00</updated>

		<published>2007-09-04T10:05:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75695#p75695</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75695#p75695"/>
		<title type="html"><![CDATA[My request script. [wont validate.]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75695#p75695"><![CDATA[
thanks user, works HALFY now <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":-)" title="Smile"><br><br>i think i need to work with a timer indeed. <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=5970">Youri</a> — Tue Sep 04, 2007 10:05 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2007-09-04T09:43:16-04:00</updated>

		<published>2007-09-04T09:43:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75693#p75693</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75693#p75693"/>
		<title type="html"><![CDATA[Re: My request script. [wont validate.]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75693#p75693"><![CDATA[
<blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>    putserv "PRIVMSG $requestnick : \[VALIDATION\] You have operator(@)."    putserv "PRIVMSG $requestnick : [\VALIDATION\] The channel meets the requirements, the bot will stay."</code></pre></div></div></blockquote>"[" != "\["<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Tue Sep 04, 2007 9:43 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Youri]]></name></author>
		<updated>2007-09-04T09:09:42-04:00</updated>

		<published>2007-09-04T09:09:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75690#p75690</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75690#p75690"/>
		<title type="html"><![CDATA[My request script. [wont validate.]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75690#p75690"><![CDATA[
<blockquote class="uncited"><div>The problem is most likely due to the fact that your bot most likely hav'nt had time to gather any information about the channel by the time you call request:join_chan. The time for this may be from just a few secs for small channels, to 20secs or more for large channels (basically the time it takes to retrieve the output, and parse it, from a "WHO #channel" request).<br><br>I would probably use a timer to delay the member-check a minute or two.<br><br>A somewhat more advanced way of doing it would be to manually capturing the data of the who-request using raw bindings. Making any mistakes here might result in your bot behaving very oddly however.</div></blockquote>So the request:join_chan isnt wrong or something?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5970">Youri</a> — Tue Sep 04, 2007 9:09 am</p><hr />
]]></content>
	</entry>
	</feed>
