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

	<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>2002-12-03T17:20:40-04:00</updated>

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

		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-12-03T17:20:40-04:00</updated>

		<published>2002-12-03T17:20:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=13934#p13934</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=13934#p13934"/>
		<title type="html"><![CDATA[error: wrong # args:]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=13934#p13934"><![CDATA[
There is no real need to organise vars.<br><br>So long as you give them meaningful names, and stay away from the name args, your should be fine.<br><br>As for the route problem, it may well be due to samba and wordpad.<br><br>I would sugest FTP or SCP (available with putty) for uploading.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Tue Dec 03, 2002 5:20 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-12-03T17:04:57-04:00</updated>

		<published>2002-12-03T17:04:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=13933#p13933</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=13933#p13933"/>
		<title type="html"><![CDATA[error: wrong # args:]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=13933#p13933"><![CDATA[
oh one more thing I forgot to answer,<br><br>I was using wordpad in windows to edit my tcl files over my samba network, but I suppose that it isnt the best thing to use.  I am now using EditPlus which seems like it will work well<p>Statistics: Posted by Guest — Tue Dec 03, 2002 5:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-12-03T16:59:55-04:00</updated>

		<published>2002-12-03T16:59:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=13931#p13931</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=13931#p13931"/>
		<title type="html"><![CDATA[error: wrong # args:]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=13931#p13931"><![CDATA[
hello,<br><br>Sorry, I have only started playing around with tcl in the past few days.  Anyway I understand what you are saying with the list.  Basically I copied code from tekkbot (not sure who the author is, but gave credit where needed) and implemented it into something I wrote.  <br><br>I tried the replacement code you posted and still got the same error.  Perhaps the proc that calls do_commandm is at fault.  I have decided to try to rewrite most of the code to my own, which will hopefully let me learn exactly how everything works.  Do you have any suggestions as to how I could organize my args in a better fashion?  <br><br>Thanks<p>Statistics: Posted by Guest — Tue Dec 03, 2002 4:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-12-03T05:47:38-04:00</updated>

		<published>2002-12-03T05:47:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=13901#p13901</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=13901#p13901"/>
		<title type="html"><![CDATA[error: wrong # args:]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=13901#p13901"><![CDATA[
Well for a start, you have complicated things for yourself in this script.<br><br>You are using lots of usless regsubs, that can be removed.<br><br>The reason you have to use regsub's, is because of your use of the $args variable.<br><br>The $args variable has a special usage.<br><br><a href="http://www.tcl.tk/man/tcl8.3/TclCmd/proc.htm" class="postlink">Here</a> is the Tcl man page with the relevant info<br><blockquote class="uncited"><div>If the last formal argument has the name args, then a call to the procedure may contain more actual arguments than the procedure has formals. In this case, all of the actual arguments starting at the one that would be assigned to args are combined into a list (as if the list command had been used); this combined value is assigned to the local variable args.</div></blockquote>To add injury to insult, you then proced to use list commands (lindex, lrange) on a non-valid list.<br><br>The quickest method of visit this, would to replace your example code with the following.<br><div class="codebox"><p>Code: </p><pre><code>proc do_commandsm {which nick uhost hand arg} { global botnick att Nickserv Chanserv set args [split $arg]set att_cmd [lindex $args 0] set att_string [lrange $args 1 end] set att_string2 [lrange $args 2 end] set att_arg1 [lindex $args 1] set att_arg2 [lindex $args 2] set att_arg3 [lindex $args 3] ... more stuff ... }</code></pre></div>This will remove the need for the regsubs, and allow proper use (and remove any nasty bugs that will popup later) of the list commands.<br><br>On top of this, what editor are you using?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Tue Dec 03, 2002 5:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-12-03T05:13:57-04:00</updated>

		<published>2002-12-03T05:13:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=13900#p13900</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=13900#p13900"/>
		<title type="html"><![CDATA[error: wrong # args:]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=13900#p13900"><![CDATA[
hello,<br><br>I am getting a weird error when I try to start my eggdrop.<br>I have two similar procs one to handle public commands and one to handle msg commands.  Both result in the same error. When I move one proc above the other in my code, the error seems to stay on the same line (perhaps there's something wrong with both my procs?).<br><br><br>[00:57] Tcl error in file 'eggdrop.conf':<br>[00:57] wrong # args: should be "proc name args body"<br>    while executing<br>"proc do_commandsm {which nick uhost hand args} "<br>    (file "scripts/tqobot/commands.tcl" line 1)<br>    invoked from within<br>"source scripts/tqobot/commands.tcl"<br>    (file "scripts/tqobot.tcl" line 21)<br>    invoked from within<br>"source scripts/tqobot.tcl"<br>    (file "eggdrop.conf" line 1334)<br>[00:57] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)<br><br><br>here is the beginning 10 lines of the proc commandsm:<div class="codebox"><p>Code: </p><pre><code>proc do_commandsm {which nick uhost hand args} {global botnick att Nickserv Chanservregsub -all {\{} $args "" argsregsub -all {\}} $args "" argsregsub -all {\"} $args "" argsregsub -all {\'} $args "" argsset att_cmd [lindex $args 0]set att_string [lrange $args 1 end]set att_string2 [lrange $args 2 end]set att_arg1 [lindex $args 1]set att_arg2 [lindex $args 2]set att_arg3 [lindex $args 3]... more stuff ...}</code></pre></div>the syntax seems fine.  I'm not quite sure what I am doing wrong  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"> <br>Anyone ever had this error before?  Any way to fix this?<br><br>Thanks!<p>Statistics: Posted by Guest — Tue Dec 03, 2002 5:13 am</p><hr />
]]></content>
	</entry>
	</feed>
