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

	<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-07-15T12:00:46-04:00</updated>

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

		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2003-07-15T12:00:46-04:00</updated>

		<published>2003-07-15T12:00:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23513#p23513</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23513#p23513"/>
		<title type="html"><![CDATA[Message Auto-Reply]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23513#p23513"><![CDATA[
<blockquote class="uncited"><div>not like that silly.. like this: .tcl string match *foo* foo bar .. anyway, it realy dosen't matter.. I'm used to use the " to make the code look better and avoid any errors.</div></blockquote>How would the code given by wile ever get to such a construction?<br><br>There are two string variables $targchan and $chan and they are compared to each other.<br><br>For sure, a command will fail if you don't use the proper syntax.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Tue Jul 15, 2003 12:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-07-15T11:54:30-04:00</updated>

		<published>2003-07-15T11:54:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23512#p23512</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23512#p23512"/>
		<title type="html"><![CDATA[Message Auto-Reply]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23512#p23512"><![CDATA[
not like that silly.. like this: .tcl string match *foo* foo bar .. anyway, it realy dosen't matter.. I'm used to use the " to make the code look better and avoid any errors.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue Jul 15, 2003 11:54 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2003-07-15T11:27:24-04:00</updated>

		<published>2003-07-15T11:27:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23507#p23507</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23507#p23507"/>
		<title type="html"><![CDATA[Message Auto-Reply]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23507#p23507"><![CDATA[
<blockquote class="uncited"><div>try with two words like: foo bar .. and you will see a notable difference. if is one word only then is working, else.. see for yourself.</div></blockquote>First, I would assume that a channel name is a single word. But, if you insist...<br><blockquote class="uncited"><div>tclsh8.3<br>% set targchan "foo bar"<br>foo bar<br>% set chan #foobar<br>#foobar<br>% string match *$targchan* $chan<br>0<br>% puts *$targchan*<br>*foo bar*</div></blockquote>Now that I did see it for myself (as you asked), I wonder what your point is?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Tue Jul 15, 2003 11:27 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-07-15T10:59:31-04:00</updated>

		<published>2003-07-15T10:59:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23505#p23505</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23505#p23505"/>
		<title type="html"><![CDATA[Message Auto-Reply]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23505#p23505"><![CDATA[
try with two words like: foo bar .. and you will see a notable difference. if is one word only then is working, else.. see for yourself.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue Jul 15, 2003 10:59 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2003-07-14T17:05:36-04:00</updated>

		<published>2003-07-14T17:05:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23473#p23473</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23473#p23473"/>
		<title type="html"><![CDATA[Message Auto-Reply]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23473#p23473"><![CDATA[
<blockquote class="uncited"><div>Uhmm. yes, mea culpa. Btw, that *string match* thing should have some " in it..</div></blockquote><blockquote class="uncited"><div>tclsh8.3<br>% set targchan foo<br>foo<br>% set chan #foobar<br>#foobar<br>% string match *$targchan* $chan<br>1<br>% puts *$targchan*<br>*foo*</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Mon Jul 14, 2003 5:05 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2003-07-14T18:51:59-04:00</updated>

		<published>2003-07-14T17:01:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23472#p23472</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23472#p23472"/>
		<title type="html"><![CDATA[Re: Message Auto-Reply]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23472#p23472"><![CDATA[
<blockquote class="uncited"><div>bot will reply for a massage at the channel or nick<br>but i have an error which is<br><br>Tcl error [replychan]: wrong # args: should be "string option arg ?arg ...?"<br><br>here is the source problem<br>proc replychan {nick uhost hand chan rest} {<br>global botnick repchan<br>foreach targchan $repchan {if {[string match *[string tolower $targchan]* [string tolower $chan]]} {append reps "$chan $rest" ; replyuser $nick $uhost $hand $reps ; return 0}}<br>}</div></blockquote>It feels like you are breaking the [string match] command across lines.<br>So, besides the comments/suggestions given above, make sure that you don't break the code across lines. Newlines, do matter.<br><br>WRONG:<div class="codebox"><p>Code: </p><pre><code>if { [string match *$targchan* \n$chan]} { .... }</code></pre></div>the \n indicates a newline<br><br>RIGHT:<div class="codebox"><p>Code: </p><pre><code>if { [string match *$targchan* $chan] } { \n... }</code></pre></div>Example of what may go wrong:<div class="codebox"><p>Code: </p><pre><code>if { [string matchhello world ]} {   puts "match"} {   puts "no match"}</code></pre></div>will result in:<br><blockquote class="uncited"><div>wrong # args: should be "string match ?-nocase? pattern string"<br>    while executing<br>"string match "<br>    (file "test.tcl" line 1)</div></blockquote>Another example<br><div class="codebox"><p>Code: </p><pre><code>if { [string match hello world ]} {   puts "match"} {   puts "no match"}</code></pre></div>will result in:<br><blockquote class="uncited"><div>wrong # args: should be "string option arg ?arg ...?"<br>    while executing<br>"string "<br>    (file "test.tcl" line 1)</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Mon Jul 14, 2003 5:01 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-07-14T16:09:09-04:00</updated>

		<published>2003-07-14T16:09:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23471#p23471</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23471#p23471"/>
		<title type="html"><![CDATA[Message Auto-Reply]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23471#p23471"><![CDATA[
Uhmm. yes, mea culpa. Btw, that *string match* thing should have some " in it..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Mon Jul 14, 2003 4:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2003-07-14T16:03:49-04:00</updated>

		<published>2003-07-14T16:03:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23470#p23470</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23470#p23470"/>
		<title type="html"><![CDATA[Message Auto-Reply]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23470#p23470"><![CDATA[
I'm sure caesar meant the replyuser proc, because replychan is already posted :)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Mon Jul 14, 2003 4:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-07-14T14:05:17-04:00</updated>

		<published>2003-07-14T14:05:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23468#p23468</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23468#p23468"/>
		<title type="html"><![CDATA[Message Auto-Reply]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23468#p23468"><![CDATA[
Please do paste the code of the *replychan* proc.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Mon Jul 14, 2003 2:05 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-07-14T13:27:45-04:00</updated>

		<published>2003-07-14T13:27:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23466#p23466</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23466#p23466"/>
		<title type="html"><![CDATA[Message Auto-Reply]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23466#p23466"><![CDATA[
hello mr. ceasar i tried your advice theres new error such as<br>[17:31] Tcl error [replychan]: wrong # args: should be "string match ?-nocase? pattern string"<br> <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><p>Statistics: Posted by Guest — Mon Jul 14, 2003 1:27 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2003-07-13T14:53:50-04:00</updated>

		<published>2003-07-13T14:53:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23414#p23414</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23414#p23414"/>
		<title type="html"><![CDATA[Message Auto-Reply]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23414#p23414"><![CDATA[
I don't think the error is in that proc. It's probably in your "replyuser" function.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Sun Jul 13, 2003 2:53 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-07-13T13:16:38-04:00</updated>

		<published>2003-07-13T13:16:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23411#p23411</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23411#p23411"/>
		<title type="html"><![CDATA[Message Auto-Reply]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23411#p23411"><![CDATA[
Place the *[string tolower $targchan]* in two "'s like: "*[string tolower $targchan]*" if you use *wildcards*<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Sun Jul 13, 2003 1:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dereckson]]></name></author>
		<updated>2003-07-13T13:00:48-04:00</updated>

		<published>2003-07-13T13:00:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23410#p23410</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23410#p23410"/>
		<title type="html"><![CDATA[Message Auto-Reply]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23410#p23410"><![CDATA[
Please give a example of sentence that causes an error.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1339">Dereckson</a> — Sun Jul 13, 2003 1:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-07-13T12:38:49-04:00</updated>

		<published>2003-07-13T12:38:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23409#p23409</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23409#p23409"/>
		<title type="html"><![CDATA[Message Auto-Reply]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23409#p23409"><![CDATA[
bot will reply for a massage at the channel or nick<br>but i have an error which is<br><br>Tcl error [replychan]: wrong # args: should be "string option arg ?arg ...?"<br><br>here is the source problem<br>proc replychan {nick uhost hand chan rest} {<br>global botnick repchan<br>foreach targchan $repchan {if {[string match *[string tolower $targchan]* [string tolower $chan]]} {append reps "$chan $rest" ; replyuser $nick $uhost $hand $reps ; return 0}}<br>}<p>Statistics: Posted by Guest — Sun Jul 13, 2003 12:38 pm</p><hr />
]]></content>
	</entry>
	</feed>
