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

	<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-10-12T15:14:47-04:00</updated>

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

		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-10-12T15:14:47-04:00</updated>

		<published>2002-10-12T15:14:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11926#p11926</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11926#p11926"/>
		<title type="html"><![CDATA[searching the userlist]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11926#p11926"><![CDATA[
The script I produced above, is perfect for limiting the amount retruned to a user.<br><br>It cycles through each handle, if it matches, it then adds there handle to a list.<br><br>At the end of the foreach loop, it will then output this list on on like like "hand, hand2, hand3, hand4"<br><br>Changing the <div class="codebox"><p>Code: </p><pre><code>[join $b {, }]</code></pre></div>to<br>[/code]<br>[join [lrange $b 0 9] {, }]<br>[/code]<br>WOuld limit the amount of the list, fed to the output function.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Sat Oct 12, 2002 3:14 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simonbell]]></name></author>
		<updated>2002-10-12T13:22:37-04:00</updated>

		<published>2002-10-12T13:22:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11921#p11921</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11921#p11921"/>
		<title type="html"><![CDATA[searching the userlist]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11921#p11921"><![CDATA[
i wrote this script which appears to be working:<br><blockquote class="uncited"><div>proc msg_search {nick host hand arg} {<br> set search [lindex $arg 0]<br> putnotc $nick "Listing matches to your search criteria \(max 10\)"<br> foreach searchuser [userlist] {<br>  if { [string match -nocase $search $searchuser] == 1 } {<br>   putnotc $nick "$searchuser"<br>   }<br> }<br> putnotc $nick "End of search"<br>}</div></blockquote>now, is it possible to detect when the number of handles that have been output reach 10, and then halt the process, so that people dont get an endless list of lots of people?<br><br>Simon<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1696">simonbell</a> — Sat Oct 12, 2002 1:22 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-10-12T10:49:33-04:00</updated>

		<published>2002-10-12T10:49:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11911#p11911</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11911#p11911"/>
		<title type="html"><![CDATA[searching the userlist]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11911#p11911"><![CDATA[
The code posted, while it would work, it does not do the job, of checking the users current host, or if it matched using the mask (remember the bad old days of "del *.*", this is the type of matching we are on about).<br><br>OK, first, the mask used in this script, can be comprised of characters used in the Tcl "string match" command, <a href="http://www.tcl.tk/man/tcl8.3/TclCmd/string.htm#M35" class="postlink">Available here</a><br><br>Second, you would use somthing like <div class="codebox"><p>Code: </p><pre><code>set b [list]foreach a [userlist] {  if {[string match [lindex [split $text] 0] $a]} {    lappend b $a  }}puthelp "PRIVMSG $nick :Users that match \"[lindex [split $text] 0]\" are \"[string trimright [join $b {, }] {, }]\""</code></pre></div>This is based on the fact, you use $nick to reply to, and that $text contains the incoming command arguments.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Sat Oct 12, 2002 10:49 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simonbell]]></name></author>
		<updated>2002-10-12T09:58:50-04:00</updated>

		<published>2002-10-12T09:58:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11905#p11905</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11905#p11905"/>
		<title type="html"><![CDATA[searching the userlist]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11905#p11905"><![CDATA[
hm, i dont want it to match hosts. I just want it to return a list of handles which match a mask the user enters. So if a user puts in a* it will return all handles which begin with the letter a, etc.<br><br>Simon<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1696">simonbell</a> — Sat Oct 12, 2002 9:58 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[spyda]]></name></author>
		<updated>2002-10-12T09:53:04-04:00</updated>

		<published>2002-10-12T09:53:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11904#p11904</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11904#p11904"/>
		<title type="html"><![CDATA[Basic Coding]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11904#p11904"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>foreach asus_nick [userlist] {  if {[getuser $asus_nick HOSTS] == [lindex [split $text] 0]} {  #do what you want it to do if the host matchs}</code></pre></div>That will do a search for all the hosts and every nick in the user file, then match it to the value you set with /msg $botnick search text.<br><br>------------<br>ThePope<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1731">spyda</a> — Sat Oct 12, 2002 9:53 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simonbell]]></name></author>
		<updated>2002-10-12T09:37:25-04:00</updated>

		<published>2002-10-12T09:37:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=11903#p11903</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=11903#p11903"/>
		<title type="html"><![CDATA[searching the userlist]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=11903#p11903"><![CDATA[
Hi<br><br>I am trying to make a script which will search through the userlist for a nick matching a mask which a user would input. Using the command:<br><blockquote class="uncited"><div>/msg $botnick search mask</div></blockquote>Im guessing id search through the userlist using the userlist command and foreach which is fine, im not really sure how i would match it to a mask. If someone put search bob, and bob was a handle then that would be fine, but is it possible to put in something like b?b and the bot would output matches, such as bob?<br><br>thanks<br>Simon<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1696">simonbell</a> — Sat Oct 12, 2002 9:37 am</p><hr />
]]></content>
	</entry>
	</feed>
