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

	<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>2011-01-13T11:24:01-04:00</updated>

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

		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2011-01-13T11:24:01-04:00</updated>

		<published>2011-01-13T11:24:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=95651#p95651</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=95651#p95651"/>
		<title type="html"><![CDATA[game script - gathering points]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=95651#p95651"><![CDATA[
<blockquote class="uncited"><div>thanks willyw, it's working great,</div></blockquote>Good to know!<br><img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><blockquote class="uncited"><div> but is it possible to add timer to script? so you can use trigger only once per day (and if someone use trigger before bot i'll send notice with remaining time). </div></blockquote>I'd have to think about that a while.<br>Maybe somebody else here would like to modify it.... or,  feel free to modify it yourself.   If you make a try at it,  usually somebody around here can advise you on it.<br><blockquote class="uncited"><div>and how to decrease number of given/taken points (3 will be enough for my channel)</div></blockquote>(I'm doing this off the top of my head, and it is not tested)<br>Find:<div class="codebox"><p>Code: </p><pre><code>set randnum [rand 21] </code></pre></div>and change to:<div class="codebox"><p>Code: </p><pre><code>set randnum [rand 7] </code></pre></div>Find:<div class="codebox"><p>Code: </p><pre><code>if {$randnum &lt; 11 } { </code></pre></div>and change to:<div class="codebox"><p>Code: </p><pre><code>if {$randnum &lt; 4 } { </code></pre></div>Find:<div class="codebox"><p>Code: </p><pre><code>if {$randnum &gt;= 11} { </code></pre></div>and change to:<div class="codebox"><p>Code: </p><pre><code>if {$randnum &gt;= 4} { </code></pre></div>Find:<div class="codebox"><p>Code: </p><pre><code>$randnum - 21</code></pre></div>in three places, and change to:<div class="codebox"><p>Code: </p><pre><code>$randnum - 7</code></pre></div><blockquote class="uncited"><div>and last thing, if someone use trigger first time bot will only give points or give nothing, and it'd be great if 0 would be minimum points you have (so there won't be negative points)</div></blockquote>Again, I'd have to think about that a while.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Thu Jan 13, 2011 11:24 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2011-01-13T11:11:51-04:00</updated>

		<published>2011-01-13T11:11:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=95650#p95650</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=95650#p95650"/>
		<title type="html"><![CDATA[game script - gathering points]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=95650#p95650"><![CDATA[
<blockquote class="uncited"><div>You should add at least a 'bind evnt' for prerehash</div></blockquote>I thought about it, but since values are not lost with a rehash, I didn't.<br><blockquote class="uncited"><div> and prerestart to save that list.</div></blockquote>?<br>Perhaps you overlooked it?  ... or I'm not understanding you?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Thu Jan 13, 2011 11:11 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anahel]]></name></author>
		<updated>2011-01-13T10:56:56-04:00</updated>

		<published>2011-01-13T10:56:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=95649#p95649</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=95649#p95649"/>
		<title type="html"><![CDATA[game script - gathering points]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=95649#p95649"><![CDATA[
thanks willyw, it's working great, but is it possible to add timer to script? so you can use trigger only once per day (and if someone use trigger before bot i'll send notice with remaining time). and how to decrease number of given/taken points (3 will be enough for my channel)<br><br>and last thing, if someone use trigger first time bot will only give points or give nothing, and it'd be great if 0 would be minimum points you have (so there won't be negative points)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10737">Anahel</a> — Thu Jan 13, 2011 10:56 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2011-01-13T02:01:28-04:00</updated>

		<published>2011-01-13T02:01:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=95645#p95645</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=95645#p95645"/>
		<title type="html"><![CDATA[game script - gathering points]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=95645#p95645"><![CDATA[
You should add at least a 'bind evnt' for prerehash and prerestart to save that list.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Thu Jan 13, 2011 2:01 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2011-01-13T00:54:28-04:00</updated>

		<published>2011-01-13T00:54:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=95644#p95644</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=95644#p95644"/>
		<title type="html"><![CDATA[Re: game script - gathering points]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=95644#p95644"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code># Commands:## !points## !savepoints## !clearpoints### !points : plays the game as described in request# !savepoints: saves nicks and respective points (use before killing bot)# !clearpoints: erases points (only for +n users)## If you use   .restart  to restart the bot, points will be saved.## The range of points awarded is -10 to 10 .##set the path and filename of the file that will hold the nicks and their respective pointsset pointsfile "scripts/random_points_game.txt"bind pub - "!points" randpointsbind pub - "!savepoints" savepointsbind pub n "!clearpoints" clearpointsbind evnt - prerestart writepointsfileif {[file exists $pointsfile]} {set fp [open $pointsfile r]set data [split [read -nonewline $fp] \n]  foreach i $data {    set name [lindex [split $i] 0]    set pointsvalue [lindex [split $i] 1]    set points($name) $pointsvalue  }close $fp  }proc randpoints {nick uhost handle chan text} {global botnick pointsset randnum [rand 21]if {$randnum == 0 } {if {![info exists points($nick)]} {set points($nick) 0    }putserv "privmsg $chan :$botnick gives $randnum points to $nick, you've now $points($nick)."return  }if {$randnum &lt; 11 } {if {[info exists points($nick)]} {set points($nick) [expr $points($nick) + $randnum ]    } else {set points($nick) $randnum    }putserv "privmsg $chan :$botnick gives $randnum points to $nick, you've now $points($nick)."return  }if {$randnum &gt;= 11} {if {[info exists points($nick)]} {set points($nick) [expr $points($nick) + $randnum - 21 ]    } else {set points($nick) [expr $randnum -21 ] }putserv "privmsg $chan :$botnick gives [expr $randnum - 21 ] points to $nick, you've now $points($nick)."return }}proc savepoints {nick uhost handle chan text} {global points pointsfile  set fp [open $pointsfile w]  foreach {name pointsvalue} [array get points] {    puts $fp "$name $pointsvalue"  }  close $fp  return 0} proc clearpoints {nick uhost handle chan text} {global points pointsfileset fp [open $pointsfile w]close $fpunset pointsputserv "privmsg $chan :All points cleared"}proc writepointsfile {prerestart} {global points pointsfile  set fp [open $pointsfile w]  foreach {name pointsvalue} [array get points] {    puts $fp "$name $pointsvalue"  }  close $fp  return 0} putlog "http://forum.egghelp.org/viewtopic.php?p=95644#95644"</code></pre></div>With a couple brief tests, it worked for me.   <br><br>Hopefully others will comment, or post other methods.   I'm curious to learn if my way of doing it is ok.<br><br>Good luck with it.    <br><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=10420">willyw</a> — Thu Jan 13, 2011 12:54 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anahel]]></name></author>
		<updated>2011-01-12T18:20:17-04:00</updated>

		<published>2011-01-12T18:20:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=95640#p95640</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=95640#p95640"/>
		<title type="html"><![CDATA[game script - gathering points]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=95640#p95640"><![CDATA[
I'm looking for a game script which would give users points (or something like that) on command, like:<br><br>me: !points<br>bot gives 2 points to &lt;me&gt;, you've now 2 points.<br><br>or radomly take away them, or give nothing.<br><br>i searched both forums and tcl archive and couldn't find something like that, maybe someone have similar script, or know how to do it without much effort (i've [censored] tcl skills and have no idea how to do script such as this one).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10737">Anahel</a> — Wed Jan 12, 2011 6:20 pm</p><hr />
]]></content>
	</entry>
	</feed>
