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

	<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-02-14T06:01:39-04:00</updated>

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

		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-02-14T06:01:39-04:00</updated>

		<published>2003-02-14T06:01:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16581#p16581</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16581#p16581"/>
		<title type="html"><![CDATA[ranks]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16581#p16581"><![CDATA[
hi,<br><br>not on a !rank command to read/write in the file, just in 1 hour or more to do the writing.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Fri Feb 14, 2003 6:01 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Papillon]]></name></author>
		<updated>2003-02-14T05:21:38-04:00</updated>

		<published>2003-02-14T05:21:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16575#p16575</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16575#p16575"/>
		<title type="html"><![CDATA[ranks]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16575#p16575"><![CDATA[
emm...<br>are you sure you want it to read and write every time someone does that command? I have the feeling the bot will be lagged if it is used heavily <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br><br>anyway... open the file for reading, do a while loop on it and put all the lines NOT matching $arg into a list just as they are, the one matching $arg you split to get the "rank" and then do a <em class="text-italics">incr</em> on that and put it into the list aswell, finally close the file, reopen it using <em class="text-italics">[open $file w]</em> and put the whole list into it.. of course you can use <em class="text-italics">lsort</em> or something like that on it to make the file nice and clean-looking <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=852">Papillon</a> — Fri Feb 14, 2003 5:21 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-02-13T12:12:22-04:00</updated>

		<published>2003-02-13T12:12:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=16548#p16548</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=16548#p16548"/>
		<title type="html"><![CDATA[ranks]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=16548#p16548"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code># script rank.tcl# version 0.1# settingsset rank(top) 5set rank(time) 10# bindsbind pub - !rank pub:rank# rank procproc pub:rank {nick uhost hand chan arg} {global rank# setset topic [lindex $arg 0]set points [lindex $arg 1]# helpif {![llength $arg] == 1} {putserv "PRIVMSG $chan :Usage: !rank &lt;topic&gt; &lt;1 to 5&gt;"return }# topics listif {$points &gt; $rank(top) || $points == 0} {putserv "PRIVMSG $chan :Ranks available betwen \0020\002 and \002$rank(top)\002."return }# countif {![info exists rank($uhost:$chan)]} {set rank($uhost:$chan) 0 }# retopice arrayutimer $rank(time) "array unset rank $uhost:$chan"# already topicdif {$rank($uhost:$chan) &gt; 0} {putserv "PRIVMSG $chan :Only one \002!rank\002 per hour. Please try again later."return }# for &amp; fixfor {set no 1} {$no&lt;$rank(top)} {incr no} {#fixif {![info exists rank($topic:$points)]} {set rank([lindex $arg 0]:$points) 0 }}incr rank($topic:$points)incr rank($uhost:$chan)# tellif {$points &gt; 1} {putserv "PRIVMSG $chan :You have ranked topic number \002$topic\002 with \002$points\002 points. Thank you!"} else {putserv "PRIVMSG $chan :You have ranked topic number \002$topic\002 with \002$points\002 point. Thank you!" }return }putlog "rank.tcl loaded.."</code></pre></div>eg. '!rank 1 1' results in a array like this: 1:1 1 (topic-number:rank number of times he was ranked with 1). How can I write this result in a file like this: 'topic 1:1 1' and on another '!rank 1 1' should read and write in the file '1:1 2', I mean read and increase it's value. Also on a '!rank 1 2' to write another line in the file: 'topic 1:2 1' and so on.. Any sugestions to do so?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Thu Feb 13, 2003 12:12 pm</p><hr />
]]></content>
	</entry>
	</feed>
