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

	<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>2003-04-16T09:34:35-04:00</updated>

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

		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-04-16T09:34:35-04:00</updated>

		<published>2003-04-16T09:34:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=19133#p19133</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=19133#p19133"/>
		<title type="html"><![CDATA[wrong # args in proc definition]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=19133#p19133"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>foreach address [$wildbans] {</code></pre></div>Anything with the square ([]) brackets is evaluated as a Tcl command, and in its place, the return value is used.<br><br>As such, in the above, you are telling it to evaluate the contents ot he variable $wildbans as a command.<br><br>Dropping the [] should work.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Wed Apr 16, 2003 9:34 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Solarin]]></name></author>
		<updated>2003-04-16T09:30:37-04:00</updated>

		<published>2003-04-16T09:30:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=19132#p19132</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=19132#p19132"/>
		<title type="html"><![CDATA[wrong # args in proc definition]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=19132#p19132"><![CDATA[
Yeah <br>string match &lt;string&gt; &lt;string&gt;<br>would be better to use here; however, that still will not solve my problem.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2990">Solarin</a> — Wed Apr 16, 2003 9:30 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-04-16T09:20:31-04:00</updated>

		<published>2003-04-16T09:20:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=19131#p19131</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=19131#p19131"/>
		<title type="html"><![CDATA[wrong # args in proc definition]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=19131#p19131"><![CDATA[
May I ask why you don't use an check if matches eggdrop's mask? something like [string match "$ban" "$botname"]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Wed Apr 16, 2003 9:20 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Solarin]]></name></author>
		<updated>2003-04-16T09:11:45-04:00</updated>

		<published>2003-04-16T09:11:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=19130#p19130</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=19130#p19130"/>
		<title type="html"><![CDATA[wrong # args in proc definition]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=19130#p19130"><![CDATA[
Ahhh thanks for your help ppslim.  That all worked fine.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Another question I'm having regarding the same script:<br><br>I'm receiving the following error:<br>[13:52] Tcl error [rwb_cmode]: invalid command name "*!*@* @* !*@* @ *!*@vw-23402.somehost.net"<br><br>Please refer to my previous post with code snippet and add the following before the bind statement:<br>set wildbans "*!*@* @* !*@* @ *!*@vw-23402.somehost.net"<br><br>and add:<br>global wildbans<br>before the set nick statement.<br><br>Why is that error resulting at runtime at foreach address [$wildbans] {?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2990">Solarin</a> — Wed Apr 16, 2003 9:11 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-04-09T17:09:15-04:00</updated>

		<published>2003-04-09T17:09:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18808#p18808</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18808#p18808"/>
		<title type="html"><![CDATA[wrong # args in proc definition]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18808#p18808"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>} #endif   return 0 } #endproc rwb_cmode</code></pre></div>It is trating the comment as part of the command.<br><br>COmment must only be at the start of a command line.<br><br>To end a command line, either use return to drop 1 line, or use the ; character<br><br>Thus making the code<br><div class="codebox"><p>Code: </p><pre><code>}; #endif   return 0 }; #endproc rwb_cmode</code></pre></div>Note it applies to the likes of the if command to (infact any line).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Wed Apr 09, 2003 5:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Solarin]]></name></author>
		<updated>2003-04-09T16:57:48-04:00</updated>

		<published>2003-04-09T16:57:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18806#p18806</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18806#p18806"/>
		<title type="html"><![CDATA[wrong # args in proc definition]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18806#p18806"><![CDATA[
Ok I appeared to have confused some people by showing a previous version of the code and part of the current.  I am throwing the current version down below in hopes to dispel confusion and find a solution:<br><div class="codebox"><p>Code: </p><pre><code>bind mode - * rwb_cmode#### Start_modeprocsproc rwb_cmode {nick uhost hand chan mc {victim ""}} {  set nick [string tolower $nick]    if {$mc == "+b"} {    foreach address [$wildbans] {      if {[[string tolower $victim] == [string tolower $address]]} {        if {$nick == "chanop"} {          PRIVMSG ChanOP :unban $chan $victim           continue        } else {          pushmode $chan -b $victim          continue        }       } #endif    } #endforeach  } #endif  return 0} #endproc rwb_cmode</code></pre></div>That produces the following error:<br>wrong # args: should be "proc name args body" while executing "proc rwb_cmode {nick uhost hand chan mc {victim ""}} { ..."<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2990">Solarin</a> — Wed Apr 09, 2003 4:57 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2003-04-09T16:21:25-04:00</updated>

		<published>2003-04-09T16:21:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18804#p18804</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18804#p18804"/>
		<title type="html"><![CDATA[Re: wrong # args in proc definition]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18804#p18804"><![CDATA[
<blockquote class="uncited"><div>I am confused as to why I would receive the following error:<br><br>wrong # args: should be "proc name args body" while executing  "proc rwb_cmode {nick uhost hand chan mc {victim ""}} { ..."<br><br><br>It would then get upset about the proc rwb_cmode line. *shrugs*</div></blockquote>Looking at the error message and the code it seems your binds are not updated, probably due to your debugging efforts. The error message refers to "proc rwb_cmode " where the list of arguments are those of "proc rwb_cmode_fix".<br><br>There are 2 other issues on the code you have shown:<br><br>1. "append mc "$victim" . This will make a new string which does not contain a space. It will look something like: "+ovictim". This single string is then given as the last argument ($mc) when you call rwb_cmode in "rwb_cmode $nick $uhost $hand $chan $mc"<br><br>2. in the rwb_cmode proc you use the split argument on $args. Note however that "args" has a special meaning in Tcl.<br><br>If you want to run the script on a recent bot (1.6.13), there is no need to use the 2 procs. tcl-commands.doc will give the exact amount of variables you must declare for a bind to MODE.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Wed Apr 09, 2003 4:21 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Papillon]]></name></author>
		<updated>2003-04-09T15:43:07-04:00</updated>

		<published>2003-04-09T15:43:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18801#p18801</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18801#p18801"/>
		<title type="html"><![CDATA[wrong # args in proc definition]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18801#p18801"><![CDATA[
change<br>bind mode - * rwb_cmode <br>to<br>bind mode - * rwb_cmode_fix<br><br>restart the bot and try again<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=852">Papillon</a> — Wed Apr 09, 2003 3:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Weirdo]]></name></author>
		<updated>2003-04-09T15:01:20-04:00</updated>

		<published>2003-04-09T15:01:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18799#p18799</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18799#p18799"/>
		<title type="html"><![CDATA[wrong # args in proc definition]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18799#p18799"><![CDATA[
what kind of binds? pub/pubm? msg?<br><br>That error usually occurs when you have either too many, or not enough variables in the { } after the proc &lt;procname&gt; bit. <br><br>Might be worth making ms or victim global, and out of the brackets.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1195">Weirdo</a> — Wed Apr 09, 2003 3:01 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Solarin]]></name></author>
		<updated>2003-04-09T14:18:42-04:00</updated>

		<published>2003-04-09T14:18:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=18797#p18797</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=18797#p18797"/>
		<title type="html"><![CDATA[wrong # args in proc definition]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=18797#p18797"><![CDATA[
I am confused as to why I would receive the following error:<br><br>wrong # args: should be "proc name args body" while executing  "proc rwb_cmode {nick uhost hand chan mc {victim ""}} { ..."<br><br>The bind statment is as follows: <br>bind mode - * rwb_cmode<br><br>Any help would be greatly appreciated.  I have also tried the following:<br><div class="codebox"><p>Code: </p><pre><code>proc rwb_cmode_fix {nick uhost hand chan mc {victim ""}} {  if {$victim != ""} {    append mc "$victim"  }  rwb_cmode $nick $uhost $hand $chan $mc}proc rwb_cmode {nick uhost handle channel args} {  set nick [string tolower $nick]  set change [string tolower [lindex [split $args] 0]]  set victim [join [lrange [split $args] 1 end]]...</code></pre></div>It would then get upset about the proc rwb_cmode line. *shrugs*<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2990">Solarin</a> — Wed Apr 09, 2003 2:18 pm</p><hr />
]]></content>
	</entry>
	</feed>
