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

	<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>2006-05-23T04:37:38-04:00</updated>

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

		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2006-05-23T04:37:38-04:00</updated>

		<published>2006-05-23T04:37:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=63291#p63291</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=63291#p63291"/>
		<title type="html"><![CDATA[Problem with textfiles]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=63291#p63291"><![CDATA[
Start using your brain man, there is only line that uses similar vars with lappend. But strange that he finds the nick and creates a new entry anyway... thats irrationel <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy">.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Tue May 23, 2006 4:37 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[darton]]></name></author>
		<updated>2006-05-22T15:16:49-04:00</updated>

		<published>2006-05-22T15:16:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=63283#p63283</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=63283#p63283"/>
		<title type="html"><![CDATA[Problem with textfiles]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=63283#p63283"><![CDATA[
Yes in the textfile, there is exactly that nick. When I type "!medals {{As}masterblast{GEN}}" lsearch find this nick. But when I want to store this nick a new line is made everytime. What do you mean with <div class="codebox"><p>Code: </p><pre><code>lappend list "$name $mvp $kills"</code></pre></div>Instead of what do I have to use this?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7270">darton</a> — Mon May 22, 2006 3:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2006-05-16T16:25:32-04:00</updated>

		<published>2006-05-16T16:25:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=63099#p63099</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=63099#p63099"/>
		<title type="html"><![CDATA[Problem with textfiles]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=63099#p63099"><![CDATA[
does the nick stand in the text file exactly like that, or are the {} excaped with \?<br>Maybe lsearch doenst find it, because of the sublist. You could try to use<div class="codebox"><p>Code: </p><pre><code>lappend list "$name $mvp $kills"</code></pre></div>instead for a pure string.<br>You must remove escape characters from the current textfile, of course.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Tue May 16, 2006 4:25 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[darton]]></name></author>
		<updated>2006-05-16T09:37:14-04:00</updated>

		<published>2006-05-16T09:37:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=63089#p63089</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=63089#p63089"/>
		<title type="html"><![CDATA[Problem with textfiles]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=63089#p63089"><![CDATA[
The bot seems to have problems with this nick: {{As}masterblast{GEN}}<br>It does not make an own line for each time, but it makes a new line everytime for this nick, when it has MVP or MostKills.<br>Does anyone know why?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7270">darton</a> — Tue May 16, 2006 9:37 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[darton]]></name></author>
		<updated>2006-05-07T10:56:20-04:00</updated>

		<published>2006-05-07T10:56:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=62756#p62756</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=62756#p62756"/>
		<title type="html"><![CDATA[Problem with textfiles]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=62756#p62756"><![CDATA[
Does it make any difference where I put in the close command? So this should be right?<div class="codebox"><p>Code: </p><pre><code>set medalsfile "scripts/medals.txt"bind pub - !medals medals:getproc medals:get {nick uhost hand chan arg} {  set fd [open $::medalsfile r+]      while {![eof $fd]} {         lappend list [gets $fd]      }  if {[set le [lsearch -glob $list "$nick *"]] != -1} {       set line [lindex $list $le]       set mvp [lindex $line 1]       set kills [lindex $line 2]     putquick "PRIVMSG $chan :$nick has $mvp MVP Medal(s) and $kills MostKills Medal(s)."     } else {       putquick "PRIVMSG $chan :$nick has no medals yet."   }   close $fd }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7270">darton</a> — Sun May 07, 2006 10:56 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2006-05-07T10:19:50-04:00</updated>

		<published>2006-05-07T10:19:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=62753#p62753</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=62753#p62753"/>
		<title type="html"><![CDATA[Problem with textfiles]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=62753#p62753"><![CDATA[
well, I would have used a 'return 1' at the end, used puthelp instead of putquick and changed the r+ to r, since we nolonger need to open the file in read and write modus <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy">, but its exactly that what I thought you should make <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile">.<br><br>only 1 note: you forgot to close the file <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile">.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Sun May 07, 2006 10:19 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[darton]]></name></author>
		<updated>2006-05-07T07:55:08-04:00</updated>

		<published>2006-05-07T07:55:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=62738#p62738</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=62738#p62738"/>
		<title type="html"><![CDATA[Problem with textfiles]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=62738#p62738"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set medalsfile "scripts/medals.txt"bind pub - !medals medals:getproc medals:get {nick uhost hand chan arg} {  set fd [open $::medalsfile r+]      while {![eof $fd]} {         lappend list [gets $fd]      }  if {[set le [lsearch -glob $list "$nick *"]] != -1} {        set line [lindex $list $le]       set mvp [lindex $line 1]       set kills [lindex $line 2]     putquick "PRIVMSG $chan :$nick has $mvp MVP Medal(s) and $kills MostKills Medal(s)."     } else {       putquick "PRIVMSG $chan :$nick has no medals yet."    }}</code></pre></div>I made that script. It works. I hope its a "proper syntax". <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"> <br>Thanks again for your work De Kus.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7270">darton</a> — Sun May 07, 2006 7:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2006-05-07T07:37:07-04:00</updated>

		<published>2006-05-07T07:37:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=62734#p62734</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=62734#p62734"/>
		<title type="html"><![CDATA[Problem with textfiles]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=62734#p62734"><![CDATA[
you can creat a modified copy of the above script. [lindex $line 1] and [lindex $line 2] will contain the counter of the medals and if lsearch returns -1, there is no record of medals of him.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Sun May 07, 2006 7:37 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[darton]]></name></author>
		<updated>2006-05-07T07:04:17-04:00</updated>

		<published>2006-05-07T07:04:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=62730#p62730</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=62730#p62730"/>
		<title type="html"><![CDATA[Problem with textfiles]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=62730#p62730"><![CDATA[
Now I have a last question. Is this possible: If someone in the channel writes "!medals" my bot looks for his name in the textfile and says for example:"$nick has 2 MVP Medal(s) and 1 MostKills Medal(s)". If the bot could not find the name in the textfile it should say: "$nick has no medals yet."<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7270">darton</a> — Sun May 07, 2006 7:04 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2006-05-07T06:34:00-04:00</updated>

		<published>2006-05-07T06:34:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=62728#p62728</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=62728#p62728"/>
		<title type="html"><![CDATA[Problem with textfiles]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=62728#p62728"><![CDATA[
<blockquote class="uncited"><div>But it doesn't.</div></blockquote>else? and make sure you used a copy from the last edit <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz">.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Sun May 07, 2006 6:34 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[darton]]></name></author>
		<updated>2006-05-07T07:03:55-04:00</updated>

		<published>2006-05-07T06:32:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=62727#p62727</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=62727#p62727"/>
		<title type="html"><![CDATA[Problem with textfiles]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=62727#p62727"><![CDATA[
EDIT: Hey it works, you are great De Kus. Thank you very much.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7270">darton</a> — Sun May 07, 2006 6:32 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2006-05-07T06:17:58-04:00</updated>

		<published>2006-05-07T06:17:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=62725#p62725</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=62725#p62725"/>
		<title type="html"><![CDATA[Problem with textfiles]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=62725#p62725"><![CDATA[
if you looked at the complete error message, you would have seen what var name there should be written <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz">. Thats why its recommned to use meaningfull var names.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Sun May 07, 2006 6:17 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[darton]]></name></author>
		<updated>2006-05-07T04:12:25-04:00</updated>

		<published>2006-05-07T04:12:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=62722#p62722</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=62722#p62722"/>
		<title type="html"><![CDATA[Problem with textfiles]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=62722#p62722"><![CDATA[
<blockquote class="uncited"><div>Tcl error [medals]: can't read "line": no such variable</div></blockquote>Hm...what's that?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7270">darton</a> — Sun May 07, 2006 4:12 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2006-05-07T02:47:31-04:00</updated>

		<published>2006-05-07T02:47:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=62720#p62720</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=62720#p62720"/>
		<title type="html"><![CDATA[Problem with textfiles]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=62720#p62720"><![CDATA[
sorry, didnt consider empty file and that the last line would always expent by an empty line. I changed code to discard the empty last line and dont put no more \n before EOF. However you will have to remove the first empty line by hand <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy">.<br><br>For the counting, you exressed yourself a bit misunderstanding, I thought you meant a boolan, not a counter <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy">. These simply incr statements should work... if my sleepy brain didnt make a total disaster <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy">.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Sun May 07, 2006 2:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[darton]]></name></author>
		<updated>2006-05-06T15:52:25-04:00</updated>

		<published>2006-05-06T15:52:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=62703#p62703</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=62703#p62703"/>
		<title type="html"><![CDATA[Problem with textfiles]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=62703#p62703"><![CDATA[
Not possible??<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7270">darton</a> — Sat May 06, 2006 3:52 pm</p><hr />
]]></content>
	</entry>
	</feed>
