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

	<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-12-16T21:10:11-04:00</updated>

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

		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-12-16T21:10:11-04:00</updated>

		<published>2007-12-16T21:10:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=79379#p79379</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=79379#p79379"/>
		<title type="html"><![CDATA[[SOLVED] A little problem with the INVITE raw]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=79379#p79379"><![CDATA[
Studying other peoples code is a good start on learning any coding language, just remember to cross-reference with a good instruction documentation or similar when you find something "interresting" or new.<br><br>None can be expected to make flawless code from the beginning, keep up the good work. And don't be afraid of asking whenever something is unclear or you can't seem to find the right answer on your own.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sun Dec 16, 2007 9:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Riddler]]></name></author>
		<updated>2007-12-16T20:55:26-04:00</updated>

		<published>2007-12-16T20:55:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=79378#p79378</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=79378#p79378"/>
		<title type="html"><![CDATA[[SOLVED] A little problem with the INVITE raw]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=79378#p79378"><![CDATA[
Upsss....  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_eek.gif" width="15" height="15" alt=":shock:" title="Shocked"> sorry if I didn't pay attention <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_confused.gif" width="15" height="15" alt=":?" title="Confused"> <br><br>@speechles: thanks for the ideea, the script it's working great now  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_lol.gif" width="15" height="15" alt=":lol:" title="Laughing"> <br><br>@nml375: I didn't really know untill now, what's the real function of the "args" argument... sorry again... but I`ve saw some other codes ( I needed a example on how the raw INVITE proc works )....... so that's why my code wasn't "by the book".... as you guys ar tryin to make me understand <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> <br><br>Maybe next time I should ask you guys first and not only trust a tcl code ( not all of them ar very good coded <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_mad.gif" width="15" height="15" alt=":x" title="Mad"> ) <br><br>Anyway thanks again speechles &amp; nml375 for the support on this issue  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9010">Riddler</a> — Sun Dec 16, 2007 8:55 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-12-16T19:56:47-04:00</updated>

		<published>2007-12-16T19:56:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=79377#p79377</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=79377#p79377"/>
		<title type="html"><![CDATA[[SOLVED] A little problem with the INVITE raw]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=79377#p79377"><![CDATA[
Riddler:<br>As I said, don't use "args" as a argument name unless you really understand how it works, and really need it's behaviour.<br>A somewhat common misconception is that eggdrop will add one argument for each word in the message. That is not the case, the number of parameters is always the same, and thus your proc should accept a fixed number of arguments. Hence there is no need or use for "args". Follow speechles suggestion and use "text" instead, which has no special function.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sun Dec 16, 2007 7:56 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2007-12-16T20:06:14-04:00</updated>

		<published>2007-12-16T19:40:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=79375#p79375</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=79375#p79375"/>
		<title type="html"><![CDATA[[SOLVED] A little problem with the INVITE raw]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=79375#p79375"><![CDATA[
<blockquote class="uncited"><div>Furthermore, in your case, you are using the special argument "args" wich may take 0 or more parameters, and concatenates them into a list</div></blockquote>Guess you didn't read this part. Your use of args is making those { } in creating the list, and your further splitting complicates it. Your getting two words you see, in one as a string. You need to split the string and then lindex it for its 2nd part. Using args creates a list containing a single two word element, not what you had intended..<div class="codebox"><p>Code: </p><pre><code>proc show:invite {from key text} {...set text [lindex [split $text] 1]</code></pre></div>perhaps?  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes"><br><br>edit: or even, if you insist on using args:<div class="codebox"><p>Code: </p><pre><code>set text [lindex [split [lindex $args 0]] 1]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Sun Dec 16, 2007 7:40 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Riddler]]></name></author>
		<updated>2007-12-16T18:54:34-04:00</updated>

		<published>2007-12-16T18:54:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=79374#p79374</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=79374#p79374"/>
		<title type="html"><![CDATA[[SOLVED] A little problem with the INVITE raw]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=79374#p79374"><![CDATA[
Hey, <br><br>I do agree with you nml375, I`ve just made the script yesterday and never worked with the <em class="text-italics">INVITE raw</em> before <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_surprised.gif" width="15" height="15" alt=":o" title="Surprised"> <br>So thanks for the info about how to use that raw... I`ll paste the code again with the modifications...<br><div class="codebox"><p>Code: </p><pre><code>set si(mc) "#monitoringchan"set si(ac) "#alertchan"set si(except) { "*!cservice@undernet.org" "*!*@me.users.undernet.org"}bind raw - INVITE show:inviteproc show:invite {from key args} { global botnick si  set nick [lindex [split $from !] 0]  set host [lindex [split $from !] 1]  set ban [lindex [split $from @] 1]  set text [lindex [split $args] 1]  foreach ehost $si(except) {    if {[string match $ehost "$nick!$host"]} { return 0 }  }     putserv "PRIVMSG $si(ac) :INVITE SPAM by\0032 $nick \003\[$host\]: invited me to $text"     putserv "PRIVMSG $si(mc) :.ban *!*@$ban Inviter!"}</code></pre></div>So I've made try this code with the modification and now it's working a little better but still ...<br><blockquote class="uncited"><div>(20:48:06) &lt;bot&gt; INVITE SPAM by XXXX [~ident@127.0.0.1]: invited me to #chan<span style="color:red"><strong class="text-strong">}</strong></span></div></blockquote>the rest of the script is working great, only that "<strong class="text-strong">}</strong>" I need to remove...<br><br>And if I change this:<br><div class="codebox"><p>Code: </p><pre><code>  set text [lindex [split $args] 1]</code></pre></div>with this: <br><div class="codebox"><p>Code: </p><pre><code>  set text $args </code></pre></div>the result will be this:<br><blockquote class="uncited"><div>(20:34:11) &lt;bot&gt; INVITE SPAM by XXXX [~ident@127.0.0.1]: invited me to <strong class="text-strong">{bot #chan}</strong></div></blockquote>So... how do I extract the #chan from $args ?!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9010">Riddler</a> — Sun Dec 16, 2007 6:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-12-16T10:36:35-04:00</updated>

		<published>2007-12-16T10:36:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=79368#p79368</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=79368#p79368"/>
		<title type="html"><![CDATA[[SOLVED] A little problem with the INVITE raw]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=79368#p79368"><![CDATA[
First off, it would appear you've got the parameters for your proc slightly off..<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. If the proc returns 1, Eggdrop will not process the line<br>           any further (this could cause unexpected behavior in some cases).<br>         Module: server</div></blockquote>That is, there should be only three arguments. Furthermore, in your case, you are using the special argument "args" wich may take 0 or more parameters, and concatenates them into a list (in this case, an empty list as there is no 4th or further parameters).<br><br>Now, what will your variables contain? (assuming rfc1459 compliant server)<br>nick: "nick"<br>uhost: "INVITE"<br>key: "botnick #channel"<br>args: ""<br><br>First off, I would suggest that you adjust your proc's argument-list, using "args" when it's not needed is a very bad idea. Also, using names that clearly illustrate the contents helps alot.<br><br>Secondly, as rfc1459 requires the server to provide the nickname of the provider, and not full host, you'll need to use the "getchanhost" command. Keep in mind that this will only work if the nick is currently in any of the eggdrop's channels.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sun Dec 16, 2007 10:36 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Riddler]]></name></author>
		<updated>2007-12-16T20:56:00-04:00</updated>

		<published>2007-12-15T23:17:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=79361#p79361</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=79361#p79361"/>
		<title type="html"><![CDATA[[SOLVED] A little problem with the INVITE raw]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=79361#p79361"><![CDATA[
Hello guys, I`m having a issue with my code <br><br>The Code<div class="codebox"><p>Code: </p><pre><code>set si(mc) "#monitoringchan"set si(ac) "#alertchan"set si(except) { "*!cservice@undernet.org" "*!*@me.users.undernet.org"}bind raw - INVITE show:inviteproc show:invite { nick uhost key args } { global botnick si  set nik [lindex [split $nick !] 0]  set host [lindex [split $nick !] 1]  set ban [lindex [split $nick @] 1]  set text [lindex [split $args #] 1]  foreach ehost $si(except) {    if {[string match $ehost "$nik!$host"]} { return 0 }  }     putserv "PRIVMSG $si(ac) :INVITE SPAM by\0032 $nik \003\[$host\]: invited to $text"     putserv "PRIVMSG $si(mc) :.ban *!*@$ban Inviter!"}</code></pre></div>The Error:<br><blockquote class="uncited"><div>On Alert chan<br><br>(05:03:22) &lt;bot&gt; INVITE SPAM by <span style="color:blue">XXXX</span> [~xxx@127.0.0.1]: invited to <strong class="text-strong">......</strong></div></blockquote>I can't get the right setting for $text so that will see in the alert chan, ....  the channel that the bot got invited to by XXXX<br><br>Have any ideas ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9010">Riddler</a> — Sat Dec 15, 2007 11:17 pm</p><hr />
]]></content>
	</entry>
	</feed>
