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

	<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>2013-02-21T07:40:54-04:00</updated>

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

		<entry>
		<author><name><![CDATA[dirty]]></name></author>
		<updated>2013-02-21T07:40:54-04:00</updated>

		<published>2013-02-21T07:40:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101075#p101075</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101075#p101075"/>
		<title type="html"><![CDATA[Search file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101075#p101075"><![CDATA[
Here is something for the queue .. I haven`t tested it but it should work. Also changed from privmsg $chan to $nick<br><div class="codebox"><p>Code: </p><pre><code>bind pub -|- !stats bigtoe:search set database_file "/home/botty/bigtoe.db" set how_many "5" proc bigtoe:search {nick uhost hand chan text} { global database_file how_many if {[queuesize help] &gt; 0} { putquick "PRIVMSG $nick :Please be patient you have been added to the queue."}set file [open $database_file r] set data [read $file]     close $file     set count 0     foreach line [split $data \n] { if { [string match -nocase "(*$text*)*" "$line"] == 1 } { puthelp "PRIVMSG $nick :$line"incr count if {$count == $how_many} { break } }     } if {$count == 0} { putserv "privmsg $chan :sorry $nick no stats found for \"$text\"";return }    }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12189">dirty</a> — Thu Feb 21, 2013 7:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BigToe]]></name></author>
		<updated>2013-02-21T05:05:13-04:00</updated>

		<published>2013-02-21T05:05:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101072#p101072</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101072#p101072"/>
		<title type="html"><![CDATA[Search file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101072#p101072"><![CDATA[
Thanks doggo!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11473">BigToe</a> — Thu Feb 21, 2013 5:05 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[doggo]]></name></author>
		<updated>2013-02-15T10:13:01-04:00</updated>

		<published>2013-02-15T10:13:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101003#p101003</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101003#p101003"/>
		<title type="html"><![CDATA[Search file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101003#p101003"><![CDATA[
give this a go..<br><br>not tested on bot but should be ok<br><div class="codebox"><p>Code: </p><pre><code>bind pub -|- !stats bigtoe:search set database_file "/home/botty/bigtoe.db" set how_many "3"proc bigtoe:search {nick uhost hand chan text} { global database_file how_many       set file [open $database_file r]        set data [read $file]        close $file        set count 0        foreach line [split $data \n] {           if { [string match -nocase "(*$text*)*" "$line"] == 1 } {           utimer 2 [list putserv "privmsg $chan :$line"]           incr count                     if {$count == $how_many} { break }           }        }        if {$count == 0} { putserv "privmsg $chan :sorry $nick no stats found for \"$text\"";return }    } </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11046">doggo</a> — Fri Feb 15, 2013 10:13 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BigToe]]></name></author>
		<updated>2013-02-15T09:13:40-04:00</updated>

		<published>2013-02-15T09:13:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101002#p101002</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101002#p101002"/>
		<title type="html"><![CDATA[Search file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101002#p101002"><![CDATA[
I need a configuration for this script please.<br><br>I need that I can define in the script how many results it will display to the user (like a variable that can be set)<br><br>And then it will display the newest results (the newest results would be from the bottom of the text file to the top, i.e the last 3 results would be lets say lines 100, 115 and 118 and not something like lines 1, 5, 50)..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11473">BigToe</a> — Fri Feb 15, 2013 9:13 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BigToe]]></name></author>
		<updated>2012-10-18T09:14:51-04:00</updated>

		<published>2012-10-18T09:14:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100149#p100149</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100149#p100149"/>
		<title type="html"><![CDATA[Search file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100149#p100149"><![CDATA[
Thanks doggo, that script works well!<br><br>Any chance for a Queue list to inform people if they have to wait because the script is currently displaying messages elsewhere? (I've made this a privmsg $nick script)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11473">BigToe</a> — Thu Oct 18, 2012 9:14 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[doggo]]></name></author>
		<updated>2012-10-15T09:19:43-04:00</updated>

		<published>2012-10-15T09:19:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100134#p100134</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100134#p100134"/>
		<title type="html"><![CDATA[Search file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100134#p100134"><![CDATA[
tested a little and seems to work ok for the search <br><br><div class="codebox"><p>Code: </p><pre><code>bind pub -|- !stats bigtoe:searchset database_file "/home/botty/bigtoe.db"proc bigtoe:search {nick uhost hand chan text} {global database_file       set file [open $database_file r]       set data [read $file]       close $file       set count 0       foreach line [split $data \n] {           if { [string match -nocase "(*$text*)*" "$line"] == 1 } {       utimer 2 [list putserv "privmsg $chan :$line"]     incr count           }       }       if {$count == 0} { putserv "privmsg $chan :sorry $nick no stats found for \"$text\"";return }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11046">doggo</a> — Mon Oct 15, 2012 9:19 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BigToe]]></name></author>
		<updated>2012-10-13T17:30:54-04:00</updated>

		<published>2012-10-13T17:30:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100125#p100125</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100125#p100125"/>
		<title type="html"><![CDATA[Search file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100125#p100125"><![CDATA[
Hello all<br><br>I need a script that will return results based on its 'special' format.<br>A user will search through the file using a public command.<br>The results will be played to the user as a query with a timer to make sure the bot does not flood out.<br>If someone is currently receiving messages from the bot and someone else uses the search script - it will add him to a queue spot, will inform of the user what his spot is and when hes done with #1 he'll move to #2 in line and #3 in line and so on untill the queue is done.<br><br>The text file format is as follows... notice that it will only return results that match the search text in the Brackets:<br><br>(Wizard vs. Giant) Has +3 power.<br>(Wizard vs. Giant) Wizard Eats pie for breakfast<br>(Wizard vs. Giant) Knows how to clean his own house, unlike the Giant.<br>(Frog vs. Bird) Frog Needs atleast 4 meals a day<br>(Frog vs. Bird) Frog is as fast as the Wizard and two times faster than Bird.<br>(The Hamster vs. The Dog) The Dog is evil, the Hamster is not. <br>(The Hamster vs. The Dog) The Dog is hungry, the Hamster is not. <br><br><span style="text-decoration:underline">An example of how the script would work:</span><br><br><blockquote class="uncited"><div>&lt;User&gt; !Stats Wizard<br>&lt;Bot&gt; (Wizard vs. Giant) Has +3 power.<br>&lt;Bot&gt; (Wizard vs. Giant) Eats pie for breakfast<br>&lt;Bot&gt; (Wizard vs. Giant) Knows how to clean his own house, unlike the Giant.</div></blockquote>Notice it did <strong class="text-strong">NOT</strong> return the Frog vs. Bird stat that talks about the Wizard:<br><br>(Frog vs. Bird) Frog is as fast as the Wizard and two times faster than Bird.<br><br><br>Please help.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11473">BigToe</a> — Sat Oct 13, 2012 5:30 pm</p><hr />
]]></content>
	</entry>
	</feed>
