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

	<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-12-02T05:56:37-04:00</updated>

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

		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-12-02T05:56:37-04:00</updated>

		<published>2002-12-02T05:56:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=13869#p13869</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=13869#p13869"/>
		<title type="html"><![CDATA[duplicate in a file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=13869#p13869"><![CDATA[
Maybe you should experiment on your own for a bit.<br><br>We will help along the way, but simply continously posting code, and expecting us to complete, fix or point your correctly every time, without giving the slightest though, to looking it over yourself (after making an attempt at correcting it).<br><br>As for the code: No.<br><br>Too be hoenst, I don't know where you got it from.<br><br>We are making pointers, showing you example code, that would help in your tracks, and you simply dump it in and expect it to work. THat is not how the forum operates.<br><br>You should take the code, review it, understand it, understand your own code and how the provided code could help you. You can then adapt it for your own use.<br><br>Think of how you want your script to operate in english first. How would you discribe what your script does? Give a numbered list, of every action and reactiont hat should take place.<br><br>IE. This is for a one-join script<br><br>1: Check to see if the joining party is know by me. If so, and he has the the +D channel flag, ont he channle he has joined, move to step 2, otherwise quit.<br><br>2: Send message to joining person.<br><br>3: Check if he has any notes. If yes, move to step 4, otherwise quit.<br><br>4: Tell the person how many notes they have and exit<br><br>This could be created (using fiction commands in some cases) like so. If you read the two of them side-by-side, you will note how much alike the code and english rules are.<br><div class="codebox"><p>Code: </p><pre><code>proc on:join {nick uh hand channel} {  if {[matchatrr $hand +D $channel]} {    puthelp "PRIVMSG $channel :Welcome $nick"  } else {    return  }  if {[UserHasNotes $hand]} {    puthelp "NOTICE $nick :You have [NumberOfNotes $hand] waiting"  }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Mon Dec 02, 2002 5:56 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[EEggy]]></name></author>
		<updated>2002-12-02T00:29:51-04:00</updated>

		<published>2002-12-02T00:29:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=13864#p13864</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=13864#p13864"/>
		<title type="html"><![CDATA[duplicate in a file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=13864#p13864"><![CDATA[
may be now heh<br><br>if {$socklog != ""} { <br>set x [open $socklog r]<br>set somelist  [split [read $file]  \n]<br>set x [open $socklog a+] <br>while {![eof $file]} { <br>set x [gets $file] <br>lappend somelist "$x" <br>} <br>if {[lsearch -glob $somelist "$host*"] == -1} { puts $x "[date] [time] - $host"} <br>close $x <br>} <br><br>thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1962">EEggy</a> — Mon Dec 02, 2002 12:29 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-12-01T08:57:27-04:00</updated>

		<published>2002-12-01T08:57:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=13834#p13834</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=13834#p13834"/>
		<title type="html"><![CDATA[duplicate in a file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=13834#p13834"><![CDATA[
No - you will need to read over the "open" command, and find out about access flags.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Sun Dec 01, 2002 8:57 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[EEggy]]></name></author>
		<updated>2002-12-01T01:25:55-04:00</updated>

		<published>2002-12-01T01:25:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=13820#p13820</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=13820#p13820"/>
		<title type="html"><![CDATA[duplicate in a file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=13820#p13820"><![CDATA[
hmm ok so is this correct..<br><br>if {$socklog != ""} {<br>    set x [open $socklog a+]<br>    while {![eof $file]} { <br>       set x [gets $file] <br>       lappend somelist "$x" <br>     } <br>   if {[lsearch -glob $somelist "$host*"] == -1} { puts $x "[date] [time] - $host"}<br>   close $x<br>   }<br><br>thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1962">EEggy</a> — Sun Dec 01, 2002 1:25 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-11-30T21:22:37-04:00</updated>

		<published>2002-11-30T21:22:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=13819#p13819</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=13819#p13819"/>
		<title type="html"><![CDATA[duplicate in a file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=13819#p13819"><![CDATA[
Place a little thought into it.<br><br>Before placeing a line in the file, you have to check for it's pre-existance.<br><br>This is what you have asked for, so this is what we have given you.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Sat Nov 30, 2002 9:22 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[EEggy]]></name></author>
		<updated>2002-11-30T18:29:22-04:00</updated>

		<published>2002-11-30T18:29:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=13814#p13814</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=13814#p13814"/>
		<title type="html"><![CDATA[duplicate in a file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=13814#p13814"><![CDATA[
thanks ppslim, but i am still confused..how do i set these codes to stop duplicates host...<br><br>if {$socklog != ""} { <br>set x [open $socklog a+] <br>puts $x "[date] [time] - $host" <br>close $x <br>} <br><br>i'll appreciate it<br>thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1962">EEggy</a> — Sat Nov 30, 2002 6:29 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-11-30T09:31:47-04:00</updated>

		<published>2002-11-30T09:31:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=13794#p13794</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=13794#p13794"/>
		<title type="html"><![CDATA[duplicate in a file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=13794#p13794"><![CDATA[
There is no need to use gets in this situation.<br><br>You are reading the whole file, before you do the search. If the search was done on the fly, then yes, you could use this.<br><br>However, using the read command would be simpler.<br><div class="codebox"><p>Code: </p><pre><code>set somelist [split [read $file] \n]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Sat Nov 30, 2002 9:31 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Papillon]]></name></author>
		<updated>2002-11-30T08:21:13-04:00</updated>

		<published>2002-11-30T08:21:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=13793#p13793</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=13793#p13793"/>
		<title type="html"><![CDATA[duplicate in a file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=13793#p13793"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>while {![eof $file]} {    set x [gets $file]    lappend somelist "$x"  }if {[lsearch -glob $somelist "$host*"] == -1} { blabølabla add the thingie...</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=852">Papillon</a> — Sat Nov 30, 2002 8:21 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[EEggy]]></name></author>
		<updated>2002-11-29T11:31:06-04:00</updated>

		<published>2002-11-29T11:31:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=13768#p13768</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=13768#p13768"/>
		<title type="html"><![CDATA[duplicate in a file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=13768#p13768"><![CDATA[
Thanks, could you please give me an example for "lsearch" ...<br>thanks again<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1962">EEggy</a> — Fri Nov 29, 2002 11:31 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Papillon]]></name></author>
		<updated>2002-11-29T03:43:46-04:00</updated>

		<published>2002-11-29T03:43:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=13759#p13759</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=13759#p13759"/>
		<title type="html"><![CDATA[duplicate in a file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=13759#p13759"><![CDATA[
either you make a loop and check each of the lines in the file, or you add the whole file to a list and use lsearch on it<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=852">Papillon</a> — Fri Nov 29, 2002 3:43 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[EEggy]]></name></author>
		<updated>2002-11-28T20:08:18-04:00</updated>

		<published>2002-11-28T20:08:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=13752#p13752</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=13752#p13752"/>
		<title type="html"><![CDATA[duplicate in a file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=13752#p13752"><![CDATA[
hi, when i write logs to the file, how do i make sure it shouldn't write duplicates,?/ i mean if host is there, no need to write it again..<br><br>if {$socklog != ""} {<br>          set x [open $socklog a+]<br>          puts $x "[date] [time] - $host"<br>          close $x<br>        }<br><br>thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1962">EEggy</a> — Thu Nov 28, 2002 8:08 pm</p><hr />
]]></content>
	</entry>
	</feed>
