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

	<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-01-01T22:27:48-04:00</updated>

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

		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-01-01T22:27:48-04:00</updated>

		<published>2003-01-01T22:27:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=14777#p14777</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=14777#p14777"/>
		<title type="html"><![CDATA[TCl Woes]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=14777#p14777"><![CDATA[
In your original post you gave 2 pieces of code.<br><br>From looking at them, they are not the only pieces, as there is a part missing from the begining.<br><br>The fact it opens several files at a time, shows the searchserials proc is being called more than once, this applies to the dccsend issue too.<br><br>You may think that it can't be so, as messages are only displayed once. This can be explained too. Eggdrop will drop repeated messages, to conserve uneeded traffic.<br><br>You are getting different sized files from dccsend, because you opened the file using the "a" mode, which will append to a file, rather than overwrite it.<br><br>It may help to see / revise the first part of the code.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Wed Jan 01, 2003 10:27 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-01-01T14:31:16-04:00</updated>

		<published>2003-01-01T14:31:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=14759#p14759</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=14759#p14759"/>
		<title type="html"><![CDATA[TCl Woes]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=14759#p14759"><![CDATA[
Hmmm - intreging. The script is loading several text files at once to do the string match on. Could be that it outputs the 'cannot find' statement if one of the files returns nothing.<br><br>Thanks<br><br>Del^<p>Statistics: Posted by Guest — Wed Jan 01, 2003 2:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-01-01T09:36:54-04:00</updated>

		<published>2003-01-01T09:36:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=14749#p14749</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=14749#p14749"/>
		<title type="html"><![CDATA[TCl Woes]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=14749#p14749"><![CDATA[
As for the dccsend issue, it does sound like more than what should hapen, is going on.<br><br>When it comes to the matching, it sounds less serious.<br><br>Because you are using a "string match" command, and the match pattern is "*$data*", it could be a simple fact that $data is empty.<br><br>Use some putlog lines, to test for this.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Wed Jan 01, 2003 9:36 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-12-31T08:25:14-04:00</updated>

		<published>2002-12-31T08:25:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=14735#p14735</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=14735#p14735"/>
		<title type="html"><![CDATA[TCl Woes]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=14735#p14735"><![CDATA[
PPSlim - Thanks for the reply.<br><br>I removed the dccsend part (it was purely 'dccsend scripts/sites/output.txt $nick' after the 'puthelp "PRIVMSG $nick :Found some matches - Preparing URL file. Please wait....."' line<br><br>and yes $data is in lowercase as I convert it and pull it through from another procedure. 'set datat [string tolower $datat]'<br><br>The procedures that I am having problems with are matching correctly, but they are doing the if statements and outputting both the true and false statements if they are true.<br><br>Del^<p>Statistics: Posted by Guest — Tue Dec 31, 2002 8:25 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-12-30T21:05:01-04:00</updated>

		<published>2002-12-30T21:05:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=14724#p14724</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=14724#p14724"/>
		<title type="html"><![CDATA[TCl Woes]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=14724#p14724"><![CDATA[
The first 2 things that stood out.<br><br>1: you didn't include what you used to try and automaticaly send the file.<br><br>2: Have you tried making sure that the $data variable is in lowercase too, just like the line of text int he file./<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Mon Dec 30, 2002 9:05 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-12-30T17:58:47-04:00</updated>

		<published>2002-12-30T17:58:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=14714#p14714</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=14714#p14714"/>
		<title type="html"><![CDATA[TCl Woes]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=14714#p14714"><![CDATA[
Hi there - I'm very new to tcl scripting. While I can work out the basics - this script that I am working on is really got me baffled. <br><br>There are two procedures that i'm working on that do a simple search against a flat text file. (Script below).<br><br>There are 2 problems I have that I've tried to sort but to no avail. <br><br>Problem 1. If there are no matches on the text file - I want the script to tell the user that there are no matches - which it does fine. But even if there are matches - it still says that there are no matches and continues processing. Have I got my if &amp; else statements wrong?<br><br>Problem 2. Ideally after the script has found all of the matches in the flat text file and written them to the output.txt file - i want it to automatically dccsend to the user thats requested the search, but when I try to do this, the script seems to initiate 3 or 4 dccsends of files all different sizes (sometimes sending the correct one). I'm assuming that somehow the script hasnt finished matching and writing the file. Is there a way to pause the script until the matching and writing the file is complete?<br><br>You're help is greatly greatly appreciated. If you dont want to reply on here - could you please message me on windows messenger (<a href="mailto:hezbag@hotmail.com">hezbag@hotmail.com</a>). Thanks<br><br>Del^<br><br>Script below here:<br>------------------------------------------------------------------------------------<br>proc searchserials {nick database data chan} {<br> global maxsearch results outputf<br>    set in [open $database r]<br>    set totfound 0<br>    set resu [open scripts/sites/output.txt a]<br>    <br>    while {![eof $in]} {<br>      set line [gets $in]<br>      if {[string match "*$data*" [string tolower $line]]} {<br>      puts $resu "$line"<br>      if {$totfound &gt; $maxsearch} {<br>      puthelp "PRIVMSG $nick :There are over $maxsearch matches. Please narrow your search."<br>      close $in<br>      close $resu<br>      return 0<br>     }<br>      set totfound [expr $totfound + 1]<br>     }<br>     }<br>    <br>    close $in<br>    close $resu<br>    sendoutput $nick $data $chan<br>    return 0<br>}<br><br>proc sendoutput {nick data chan} {<br>set size [file size scripts/sites/output.txt]<br>if {$size &gt; 0} {<br>puthelp "PRIVMSG $nick :Found some matches - Preparing URL file. Please wait....."<br>puthelp "PRIVMSG $nick :File is now ready. Type !geturlfile in the channel."<br>return 0<br>} else {<br>puthelp "PRIVMSG $nick :No matches found for $data - Try another search"<br>puthelp "PRIVMSG $chan :0,4 Search process now completed - !filename trigger now available again."<br>return 0<br>}<br>}<p>Statistics: Posted by Guest — Mon Dec 30, 2002 5:58 pm</p><hr />
]]></content>
	</entry>
	</feed>
