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

	<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>2016-06-07T16:09:40-04:00</updated>

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

		<entry>
		<author><name><![CDATA[juanamores]]></name></author>
		<updated>2016-06-07T16:09:40-04:00</updated>

		<published>2016-06-07T16:09:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105130#p105130</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105130#p105130"/>
		<title type="html"><![CDATA[Help to modify game stone-paper-scissors]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105130#p105130"><![CDATA[
Work perfectly!!! <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br>Thank you <strong class="text-strong">caesar</strong> !<br><br>Then I 'll see if I can add something in order to that a nick can not play until his turn comes .<br>Sometimes , they play more than once out of turn.<br>Example:<br>If nicks A, B , C , D and E playing..<br>After playing A, you should expect to play B and then C ... and so on...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12499">juanamores</a> — Tue Jun 07, 2016 4:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2016-06-07T09:13:24-04:00</updated>

		<published>2016-06-07T09:13:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105124#p105124</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105124#p105124"/>
		<title type="html"><![CDATA[Help to modify game stone-paper-scissors]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105124#p105124"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>namespace eval ssp {variable maxScore 5variable ssp [list "scissor" "stone" "paper"]bind pub - !choose [namespace current]::choose bind pub o|o !reset [namespace current]::resetproc choose {nick uhost hand chan text} {variable sspvariable diceScoreset random [lindex $ssp [rand [llength $ssp]]]if {[scan $text {%s} pick] != 1} {putserv "PRIVMSG $chan :To play the game choose one from \"[join $random]\" and make your choose like: !choose $random"return}set pick [string tolower $pick]set won 0if {[string equal $random $pick]} {putserv "PRIVMSG $chan :You have \0037$pick\003 and i have \0037$random\003 game \00312-draw-\003"} else {switch -- $pick {"stone" {if {[string equal $random "paper"]} {putserv "PRIVMSG $chan :You have \0037Stone\003 and i have \0037Paper\003 you \0034-lose-\003"} elseif {$random eq "scissor"} {putserv "PRIVMSG $chan :You have \0037Stone\003 and i have \0037Scissor\003 you \0033-won-\003"incr won}}"paper" {if {[string equal $random "scissor"]} {putserv "PRIVMSG $chan :You have \0037Paper\003 and i have \0037Scissor\003 you \0034-lose-\003"} elseif {$random eq "stone"} {putserv "PRIVMSG $chan :You have \0037Paper\003 and i have \0037Stone\003 you \0033-won-\003"incr won}}"scissor" {if {[string equal $random "stone"]} {putserv "PRIVMSG $chan :You have \0037Scissor\003 and i have \0037Stone\003 you \0034-lose-\003"} elseif {$random eq "paper"} {putserv "PRIVMSG $chan :You have \0037Scissor\003 and i have \0037Paper\003 you have \0033-won-\003"incr won}}default {putserv "PRIVMSG $chan :Sorry, your pick is not valid. You must choose one from: [join $ssp]"}}}if {$won} {set pos [getPos $chan $nick]set score [expr $pos != -1 ? [getScore $chan $nick] : 0]set newScore [incr score]if {$pos != -1} {set diceScore($chan) [lreplace $diceScore($chan) $pos $pos [list $nick $newScore]]} else {lappend diceScore($chan) [list $nick 1]}}if {[checkScore $chan]} {array unset diceScore $chanputserv "PRIVMSG $chan :Congrats to $nick! He won this round!"}}proc reset {nick uhost hand chan text} {variable diceScorearray unset diceScore $chan}proc checkScore {chan} {variable diceScorevariable maxScoreset x 0if {[info exists diceScore($chan)]} {foreach {player score} [join $diceScore($chan)] {if {$score &lt; $maxScore} continueincr xbreak}}return $x}proc getPos {chan nick} {set pos -1set match 0variable diceScoreif {[info exists diceScore($chan)]} {foreach {player score} [join $diceScore($chan)] {incr posif {![string equal -nocase $player $nick]} continueincr matchbreak}}return [expr $match ? "$pos" : "-1"]}proc getScore {chan nick} {set x 0variable diceScoreif {[info exists diceScore($chan)]} {foreach {player score} [join $diceScore($chan)] {if {![string equal -nocase $player $nick]} continueincr x $scorebreak}}return $x}}</code></pre></div><blockquote class="uncited"><div>&lt;cez&gt; !choose bla<br>&lt;@bot&gt; Sorry, your pick is not valid. You must choose one from: scissor stone paper<br>&lt;cez&gt; !choose stone<br>&lt;@bot&gt; You have Stone and i have Scissor you -won-<br>&lt;cez&gt; !choose stone<br>&lt;@bot&gt; You have stone and i have stone game -draw-<br>&lt;cez&gt; !choose stone<br>&lt;@bot&gt; You have Stone and i have Scissor you -won-<br>&lt;cez&gt; !choose stone<br>&lt;@bot&gt; You have Stone and i have Scissor you -won-<br>&lt;cez&gt; !choose stone<br>&lt;@bot&gt; You have Stone and i have Paper you -lose-<br>&lt;cez&gt; !choose stone<br>&lt;@bot&gt; You have Stone and i have Scissor you -won-<br>&lt;cez&gt; !choose stone<br>&lt;@bot&gt; You have Stone and i have Paper you -lose-<br>&lt;cez&gt; !choose stone<br>&lt;@bot&gt; You have Stone and i have Scissor you -won-<br>&lt;@bot&gt; Congrats to cez! He won this round!</div></blockquote>This should be extended to monitor nick change, kick, part and quit and also do some resets every 30 minutes, 1 hour or whatever. I added a !reset in case something goes wrong, but you can remove it.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue Jun 07, 2016 9:13 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[juanamores]]></name></author>
		<updated>2016-06-06T03:49:21-04:00</updated>

		<published>2016-06-06T03:49:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105106#p105106</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105106#p105106"/>
		<title type="html"><![CDATA[Help to modify game stone-paper-scissors]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105106#p105106"><![CDATA[
I found this game of stone-paper-scissors and want to improve it ...<br>How I can do to saved the scores for each user who plays on each channel and, at the same time if one of the users win 5 times end the game?<br><div class="codebox"><p>Code: </p><pre><code>##################################################### Author : TALES 24-08-2003                        ## File name: ssp.tcl                               ## version script : v1                              ## Script info : This is a little game for channel  ##               hope you like the game.            ##               cmd like: !choose scissor          ##                         !choose stone            ##                         !choose paper            ######################################################         if you got any questions you             ##         can find me @ irc.chatcity.nl            ##         http://www.cb3rob.net/~tales/            ######################################################     this script is made for eggdrop 1.6.13       ##      but should work on al 1.6.* versions        ##    use of this script is for your own risk!      ###################################################### Credits : Fr33man_, Ace^                         #####################################################bind pub - !choose msg_sspset ssp_list { "scissor" "stone" "paper"}proc msg_ssp {nick uhost hand chan rest} {  global botnick ssp_list  set ssp [lindex $ssp_list [rand [llength $ssp_list]]]  set cmd [string tolower [lindex $rest 0]]  if { ($cmd == $ssp) } {     putserv "PRIVMSG $chan :You have \0037$cmd\003 and i have \0037$ssp\003 game \00312-draw-\003"      return 0     }  if {$cmd == "stone"} {    if {$ssp == "paper"} {       putserv "PRIVMSG $chan :You have \0037Stone\003 and i have \0037Paper\003 you \0034-lose-\003"        return 0       }    if {$ssp == "scissor"} {       putserv "PRIVMSG $chan :You have \0037Stone\003 and i have \0037Scissor\003 you \0033-won-\003"        return 0       }      }  if {$cmd == "paper"} {    if {$ssp == "stone"} {        putserv "PRIVMSG $chan :You have \0037Paper\003 and i have \0037Stone\003 you \0033-won-\003"        return 0       }    if {$ssp == "scissor"} {        putserv "PRIVMSG $chan :You have \0037Paper\003 and i have \0037Scissor\003 you \0034-lose-\003"        return 0       }      }  if {$cmd == "scissor"} {    if {$ssp == "stone"} {        putserv "PRIVMSG $chan :You have \0037Scissor\003 and i have \0037Stone\003 you \0034-lose-\003"        return 0       }    if {$ssp == "paper"} {        putserv "PRIVMSG $chan :You have \0037Scissor\003 and i have \0037Paper\003 you have \0033-won-\003"        return 0       }      }}putlog "ssp.tcl v1 made by TALES loaded succesfully."</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12499">juanamores</a> — Mon Jun 06, 2016 3:49 am</p><hr />
]]></content>
	</entry>
	</feed>
