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

	<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-12-03T17:43:47-04:00</updated>

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

		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-12-03T17:43:47-04:00</updated>

		<published>2003-12-03T17:43:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=31045#p31045</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=31045#p31045"/>
		<title type="html"><![CDATA[Matching strings containing []]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=31045#p31045"><![CDATA[
Evidently.. in my tests the string stuff are a lot faster than an regsub. Do a lil test on yourself.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Wed Dec 03, 2003 5:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2003-12-03T17:33:58-04:00</updated>

		<published>2003-12-03T17:33:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=31044#p31044</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=31044#p31044"/>
		<title type="html"><![CDATA[Matching strings containing []]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=31044#p31044"><![CDATA[
Thanx, that works perfectly <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>I guess string map is faster the regsub right ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Wed Dec 03, 2003 5:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-12-03T16:32:36-04:00</updated>

		<published>2003-12-03T16:32:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=31043#p31043</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=31043#p31043"/>
		<title type="html"><![CDATA[Matching strings containing []]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=31043#p31043"><![CDATA[
<blockquote class="uncited"><div>I've tested string qual using .tcl command in partyline, for example <strong class="text-strong">.tcl string equal -nocase [nick1] [Nick1]</strong> it returns "<strong class="text-strong">Tcl error: invalid command name "nick1"</strong>". the pattern here would be the nick from the file (I use foreach to get each nick from the file) and the string would be the nick joining the channel, would string equal be the solution ?</div></blockquote>The line you run using .tcl in your eggdrop is evaluated and variable/command/backslash substitution is done. (escaping is needed if you don't want this to happen)<br>Text recieved from irc/read from a file and put in a variable is not evaluated. (no escaping needed)<br><br>'string equal' is just a simple char by char comparison of the strings (optional -nocase), so if you want the match chars * and ? to work you better use 'string match' and escape the special chars you don't want to work using 'regsub' or 'string map'.<div class="codebox"><p>Code: </p><pre><code>proc yourMatch {mask string} {  string match -nocase [string map {\\ \\\\ \[ \\\[ \] \\\]} $mask] $string}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Wed Dec 03, 2003 4:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2003-12-03T16:18:04-04:00</updated>

		<published>2003-12-03T15:59:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=31041#p31041</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=31041#p31041"/>
		<title type="html"><![CDATA[Matching strings containing []]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=31041#p31041"><![CDATA[
I've tested string qual using .tcl command in partyline, for example <strong class="text-strong">.tcl string equal -nocase [nick1] [Nick1]</strong> it returns "<strong class="text-strong">Tcl error: invalid command name "nick1"</strong>". the pattern here would be the nick from the file (I use foreach to get each nick from the file) and the string would be the nick joining the channel, would string equal be the solution ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Wed Dec 03, 2003 3:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-12-03T15:13:19-04:00</updated>

		<published>2003-12-03T15:13:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=31040#p31040</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=31040#p31040"/>
		<title type="html"><![CDATA[Matching strings containing []]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=31040#p31040"><![CDATA[
<blockquote class="uncited"><div>thanks user for pointing that out. you said "Use 'string equal'" in your post there but it does the same thing on nicks containing such characters. I would use ==, but I want to use wildcards such as * and ? in matching.</div></blockquote>The brackets doesn't trigger command substitution when used in a mask passed to 'string match' or as one of the strings being compared using 'string equal'. What exactly are you doing? You might also want to check the manual page for <a href="http://tcl.tk/man/tcl8.3/TclCmd/string.htm#M35" class="postlink">string match</a> (to know what chars are special so you know what to escape in your masks)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Wed Dec 03, 2003 3:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2003-12-03T15:02:54-04:00</updated>

		<published>2003-12-03T15:02:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=31039#p31039</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=31039#p31039"/>
		<title type="html"><![CDATA[Matching strings containing []]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=31039#p31039"><![CDATA[
thanks user for pointing that out. you said "Use 'string equal'" in your post there but it does the same thing on nicks containing such characters. I would use ==, but I want to use wildcards such as * and ? in matching.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Wed Dec 03, 2003 3:02 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[GodOfSuicide]]></name></author>
		<updated>2003-12-03T14:42:41-04:00</updated>

		<published>2003-12-03T14:42:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=31038#p31038</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=31038#p31038"/>
		<title type="html"><![CDATA[Matching strings containing []]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=31038#p31038"><![CDATA[
somehow this question is a classic quote...some kind of tradition<br><br>(again a strong candidate for a sticky tread (not the post, the topic))<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1433">GodOfSuicide</a> — Wed Dec 03, 2003 2:42 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-12-03T14:31:24-04:00</updated>

		<published>2003-12-03T14:31:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=31037#p31037</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=31037#p31037"/>
		<title type="html"><![CDATA[Matching strings containing []]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=31037#p31037"><![CDATA[
<a href="http://forum.egghelp.org/viewtopic.php?t=5974" class="postlink">http://forum.egghelp.org/viewtopic.php?t=5974</a> - read your own post and my reply. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Wed Dec 03, 2003 2:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2003-12-03T13:03:04-04:00</updated>

		<published>2003-12-03T13:03:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=31034#p31034</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=31034#p31034"/>
		<title type="html"><![CDATA[Matching strings containing []]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=31034#p31034"><![CDATA[
I have a problem in a script that matches nicks joining channels with nicks in a file, if 1 is returned the bot will kick the nick. I'm using <strong class="text-strong">string match -nocase $nick-from-file $nick</strong> but if the nick contains [ or ] in it, tcl considers it a command. Is there any way to fix this ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Wed Dec 03, 2003 1:03 pm</p><hr />
]]></content>
	</entry>
	</feed>
