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

	<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>2005-05-06T17:32:01-04:00</updated>

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

		<entry>
		<author><name><![CDATA[sKy]]></name></author>
		<updated>2005-05-06T17:32:01-04:00</updated>

		<published>2005-05-06T17:32:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=49126#p49126</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=49126#p49126"/>
		<title type="html"><![CDATA[question about foreach/string match]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=49126#p49126"><![CDATA[
It`s not too big and to slow now but the size will be bigger every day.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6101">sKy</a> — Fri May 06, 2005 5:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2005-05-06T17:01:36-04:00</updated>

		<published>2005-05-06T17:01:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=49124#p49124</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=49124#p49124"/>
		<title type="html"><![CDATA[question about foreach/string match]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=49124#p49124"><![CDATA[
Sky, how big is your list anyway? Unless it's really big I doubt this is much of an issue, but if it is, I'll try writing that thing I was talking about in tcl. Still might not make a whole lot of difference but it would be kind of fun.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Fri May 06, 2005 5:01 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2005-05-06T12:37:00-04:00</updated>

		<published>2005-05-06T12:37:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=49118#p49118</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=49118#p49118"/>
		<title type="html"><![CDATA[question about foreach/string match]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=49118#p49118"><![CDATA[
If we use -glob with lsearch we can match an element with wildcards to an element in a list. So we can't match this!that@those to this!*@* in the list but we can do vice-versa.<br><br>example:<blockquote class="uncited"><div>.tcl set thislist {"yo!*@*" "hayda*!me@*"}<br><br>.tcl lsearch -glob $thislist yo!hayda@haydek<br>Tcl: -1<br><br>.tcl lsearch -glob $thislist *!me@*<br>Tcl: 1</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Fri May 06, 2005 12:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2005-05-05T04:30:47-04:00</updated>

		<published>2005-05-05T04:30:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=49032#p49032</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=49032#p49032"/>
		<title type="html"><![CDATA[question about foreach/string match]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=49032#p49032"><![CDATA[
we still don't know how much the lrange and lsearch speed up does ^-^.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Thu May 05, 2005 4:30 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2005-05-04T23:27:50-04:00</updated>

		<published>2005-05-04T23:27:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=49027#p49027</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=49027#p49027"/>
		<title type="html"><![CDATA[question about foreach/string match]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=49027#p49027"><![CDATA[
Tcl's lsearch won't work with -glob and -sorted at the same time. However you could write a search function that does that... it's kind of tricky because you have to split the list up based on where the wildcards are (beginning, middle, end). I was doing something like this for eggdrop 1.9.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Wed May 04, 2005 11:27 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arcane]]></name></author>
		<updated>2005-05-02T03:30:04-04:00</updated>

		<published>2005-05-02T03:30:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48856#p48856</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48856#p48856"/>
		<title type="html"><![CDATA[question about foreach/string match]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48856#p48856"><![CDATA[
hm.. maybe sort the list and use lsearch -sorted. i think that would be the most effective improvement.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2617">arcane</a> — Mon May 02, 2005 3:30 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2005-05-01T12:21:06-04:00</updated>

		<published>2005-05-01T12:21:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48819#p48819</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48819#p48819"/>
		<title type="html"><![CDATA[question about foreach/string match]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48819#p48819"><![CDATA[
dont disapoint the guy. of course lsearch can search for wildcards:<br><a href="http://www.tcl.tk/man/tcl8.4/TclCmd/lsearch.htm#M10" class="postlink">http://www.tcl.tk/man/tcl8.4/TclCmd/lsearch.htm#M10</a><br><br>you can probably speed up the thing, when you set the list like:<br>set hostlist {*.il24.net *.comcast.net *.jazztel.es *.telia.com *.attbi.com ...}<br><br>an alternitve would be to do:<br>set hostlist [lrange $hostlist 0 end]<br><br>this should strip any redudant code.<br><div class="codebox"><p>Code: </p><pre><code>#De_Kus# set hostlistCurrently:    "*.il24.net"   "*.comcast.net"   "*.jazztel.es"   "*.telia.com"   "*.attbi.com"tcl: evaluate (.tcl): lrange $hostlist 0 endTcl: *.il24.net *.comcast.net *.jazztel.es *.telia.com *.attbi.com</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Sun May 01, 2005 12:21 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[sKy]]></name></author>
		<updated>2005-05-01T11:26:26-04:00</updated>

		<published>2005-05-01T11:26:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48814#p48814</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48814#p48814"/>
		<title type="html"><![CDATA[question about foreach/string match]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48814#p48814"><![CDATA[
mmh :/<br>no other way?<br><br>how is the internal bot banlist coded? that`s still fast until the banlist is huge.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6101">sKy</a> — Sun May 01, 2005 11:26 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2005-05-01T11:12:58-04:00</updated>

		<published>2005-05-01T11:12:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48812#p48812</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48812#p48812"/>
		<title type="html"><![CDATA[question about foreach/string match]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48812#p48812"><![CDATA[
With lsearch you search for an element in a list and it will return it's position in the list (which would be a number) or -1 if it doesn't exist. So, you can't match with lsearch.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Sun May 01, 2005 11:12 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[sKy]]></name></author>
		<updated>2005-05-01T11:08:21-04:00</updated>

		<published>2005-05-01T11:08:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48810#p48810</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48810#p48810"/>
		<title type="html"><![CDATA[question about foreach/string match]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48810#p48810"><![CDATA[
what about lsearch? i tryed but i can`t find "right match"<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6101">sKy</a> — Sun May 01, 2005 11:08 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2005-05-01T11:04:54-04:00</updated>

		<published>2005-05-01T11:04:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48809#p48809</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48809#p48809"/>
		<title type="html"><![CDATA[question about foreach/string match]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48809#p48809"><![CDATA[
if you bind join - "* &lt;mask&gt;" it might make it faster, but then you'll have alot of bind joins, so I suggest you keep it this way.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Sun May 01, 2005 11:04 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[sKy]]></name></author>
		<updated>2005-05-01T10:48:57-04:00</updated>

		<published>2005-05-01T10:48:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48808#p48808</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48808#p48808"/>
		<title type="html"><![CDATA[question about foreach/string match]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48808#p48808"><![CDATA[
Is there a way to do the same like this script but with more speed?<br>(hostlist is much bigger)<br><div class="codebox"><p>Code: </p><pre><code>set hostlist {"*.il24.net""*.comcast.net""*.jazztel.es""*.telia.com""*.attbi.com".................................}bind join - * onjoin:checkproc onjoin:check { nickname hostname handle channel } { set host [lindex [split $hostname "@"] 1] foreach h $hostlist {  if { [string match -nocase $h $host] } {   procname $var $var ....   return  } }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6101">sKy</a> — Sun May 01, 2005 10:48 am</p><hr />
]]></content>
	</entry>
	</feed>
