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

	<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>2015-08-04T12:15:36-04:00</updated>

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

		<entry>
		<author><name><![CDATA[primus]]></name></author>
		<updated>2015-08-04T12:15:36-04:00</updated>

		<published>2015-08-04T12:15:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104339#p104339</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104339#p104339"/>
		<title type="html"><![CDATA[slots.tcl - Slot Machine for your Eggy]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104339#p104339"><![CDATA[
Thanks Caesar,<br><br>Did a test run with it, but got this:<br><br>[08:59:47] Tcl error [::slots::play]: can't read "slots": no such variable<br><br>so looked through the code and noticed this..<br><div class="codebox"><p>Code: </p><pre><code>proc spin {count} {</code></pre></div>so changed it to...<br><div class="codebox"><p>Code: </p><pre><code>proc slots {count} {</code></pre></div>After the change, worked flawless...<br><br>When I get time, which most of us dont have a lot of now, I will recode with the changes... I still got to look at the links from willyw to check out throttling...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12556">primus</a> — Tue Aug 04, 2015 12:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2015-08-04T01:33:41-04:00</updated>

		<published>2015-08-04T01:33:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104338#p104338</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104338#p104338"/>
		<title type="html"><![CDATA[slots.tcl - Slot Machine for your Eggy]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104338#p104338"><![CDATA[
Here's my attempt at this slots game, but did only the "channel" part, replaced that <em class="text-italics">set slotchan "#underground"</em> with a channel flag so could run this on multiple channels and activate or deactivate it from party line (DCC chat/telnet with the bot) via <em class="text-italics">.chanset +slots</em> or <em class="text-italics">.chanset -slots</em><div class="codebox"><p>Code: </p><pre><code>namespace eval slots {set slots {"Lemon""Orange""Cherry""Lime""Bar""Bell""Seven""Diamond"}set lever "!spin"setudef flag slotsbind pub - $lever [namespace current]::playproc play {nick uhost hand chan text} {if {![channel get $chan slots]} returnset result [spin 3]foreach word [split $result] {incr count($word)}puthelp "PRIVMSG $chan :&lt;&lt;$nick&gt;&gt; puts a quarter in the slot machine, pulls the lever, The reels are spinning... coming to a stop..." puthelp "PRIVMSG $chan :| [join [split $result] " | "] |"switch -- [llength [array names count]] {"1" {puthelp "PRIVMSG $chan :Congratulations! $nick  You hit the Jackpot!  \$500 !! =)"puthelp "PRIVMSG $chan :Hey everyone! $nick Just hit the Jackpot!"}"2" {puthelp "PRIVMSG $chan :Aww Shucks $nick, :(  2 out of 3 only pays \$50 !  =)"}"3" {puthelp "PRIVMSG $chan :Sorry $nick not everyone can be a winner.  Better luck next time, Chump!"}}}proc spin {count} {variable slotsset len [llength $slots]for {set x 0} {$x&lt;$count} {incr x} {lappend result [lindex $slots [rand $len]]}return $result}}</code></pre></div>There's even room to extend it, meaning instead of 3 slots can have 4 or even 5. Would just need to add more lines under the "switch" <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>You could add user's throttled proc from the first link willyw kindly gave to you to prevent a flood on the bot. I'm too busy with work to finish the code right now.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue Aug 04, 2015 1:33 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2015-08-03T02:24:29-04:00</updated>

		<published>2015-08-03T02:24:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104337#p104337</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104337#p104337"/>
		<title type="html"><![CDATA[Re: slots.tcl - Slot Machine for your Eggy]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104337#p104337"><![CDATA[
<blockquote class="uncited"><div><br>....<br>A timer to throttle responses would be great and if anyone happens to add it,...</div></blockquote><br>Here is a command throttle for you to check out:<br><br><a href="http://forum.egghelp.org/viewtopic.php?p=45537#45537" class="postlink">http://forum.egghelp.org/viewtopic.php?p=45537#45537</a><br><br>and<br><br><a href="http://forum.egghelp.org/viewtopic.php?p=75097#75097" class="postlink">http://forum.egghelp.org/viewtopic.php?p=75097#75097</a><br><br><br>I hope this helps.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Mon Aug 03, 2015 2:24 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[primus]]></name></author>
		<updated>2015-08-03T00:43:10-04:00</updated>

		<published>2015-08-03T00:43:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104336#p104336</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104336#p104336"/>
		<title type="html"><![CDATA[slots.tcl - Slot Machine for your Eggy]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104336#p104336"><![CDATA[
Its been reworked once prior to myself... It now works with eggdrop1.6.X, not sure about earlier version... Let me know if anything needs fixed in the script or if it works with earlier eggdrop versions... And please post in the topic of the forum.... More info after code...<br><div class="codebox"><p>Code: </p><pre><code>##################################################################             --The Ultimate eggdrop Slot Machine --  #            slots.tcl v3.0 by Pr|muS@Undernet 8/2/2015##               For eggdrop1.6.X and maybe older...##              In Honor of MC_8 (Carl M. Gregory)#                We need you back on IRC buddy!##           DO NOT Distribute this TCL in any edited form#             without the existing revision history!!!#                            ##################################################################  #  v3.0 by Pr|muS@Undernet##  v3.0 Changes (8/2/2015)#  - Shortened output to keep from flooding#  - Removed set botnick "$botnick"#    (Was causing crash on startup)#  - Added channel set (Single Channel Only)#  - Added option to change !Trigger#  - Removed "Hearts" and added "Diamond" &amp; "Seven" to reels##  v2.0 Changes (11/15/97) by Chuck Jedlicka#    (jcme1@hotmail.com)#  - Changed output to channel#  - Added message funtionality so your users #    don't tie up the channel.#  - Added prizes and more...#  #  v1.0 Original Code (6/22/97) by Lorna MacTavish#   (macgirl@poboxes.com)##  This is a slot machine proc for your eggdrop bot#  Tested on eggdrop1.6.21################################################################Settings#Set the channel to play in. ex: set slotchan "#playslots"set slotchan "#underground"#Set the public channel comand to pull the lever ex:"!spin"set lever "!spin"###############################################################Do Not Edit below this line unless you know TCL!!!##############################################################set slots {  "Lemon"  "Orange"  "Cherry"  "Lime"  "Bar"  "Bell"  "Seven"  "Diamond"}bind pub - $lever play_slotsproc play_slots {nick uhost handle chan args} {  global slotchan  if {$chan == $slotchan} {  putserv "PRIVMSG $slotchan :&lt;&lt;$nick&gt;&gt; puts a quarter in the slot machine, pulls the lever, The reels are spinning... coming to a stop..."  global slots botnick lever  set slot1 [lindex $slots [rand [llength $slots]]]  set slot2 [lindex $slots [rand [llength $slots]]]  set slot3 [lindex $slots [rand [llength $slots]]]  putserv "PRIVMSG $slotchan :| $slot1 | $slot2 | $slot3 |"  if {$slot1 == $slot2} {    if {$slot2 == $slot3} {      putserv "PRIVMSG $slotchan :Congratulations! $nick  You hit the Jackpot!  \$500 !! =)"      putserv "PRIVMSG $slotchan :Hey everyone! $nick Just hit the Jackpot!"      putserv "NOTICE  $nick :Don't ya wish it were Real!!  lmfao! :P"      return 1     }     putserv "PRIVMSG $slotchan :Aww Shucks $nick, :(  2 out of 3 only pays \$50 !  =)"     putserv "NOTICE  $nick :Too bad it's only on IRC... like your other \"scores\" :P"    return 1  }  if {$slot3 == $slot2} {    if {$slot2 == $slot1} {      putserv "PRIVMSG $slotchan :Congratulations! $nick  You hit the Jackpot! \$500 !! =)"      putserv "PRIVMSG $slotchan :Hey everyone! $nick Just hit the Jackpot!"      putserv "notice  $nick :Don't ya wish it were Real!!  lmfao! :P"      return 1    }    putserv "PRIVMSG $slotchan :Not too shabby $nick  you just won \$50 !  =)"    putserv "NOTICE  $nick :Too bad it's only on IRC... like your other \"scores\" :P"    return 1  }  if {$slot1 == $slot3} {    if {$slot2 == $slot1} {      putserv "PRIVMSG $slotchan :Congratulations! $nick  You hit the Jackpot!  \$500 !! =)"      putserv "PRIVMSG $slotchan :Hey everyone! $nick Just hit the Jackpot!"      putserv "NOTICE  $nick :Don't ya wish it were Real!!  lmfao! :P"      return 1    }    putserv "PRIVMSG $slotchan :Getting close there $nick,  outside matches pay \$25 ! =)"    putserv "NOTICE  $nick :Too bad its like your other \"SCORES\" on IRC  :P"    return 1  }  putserv "PRIVMSG $slotchan :Sorry $nick not everyone can be a winner.  Better luck next time, Chump!"  putserv "NOTICE  $nick :You can also play in private!  Use /msg $botnick $lever Good Luck!"   return 1 }}bind msg - $lever play_slotsmproc play_slotsm {nick uhost handle chan args} {  putserv "PRIVMSG $nick :&lt;&lt;$nick&gt;&gt; puts a quarter in the slot machine, pulls the lever, The reels are spinning... coming to a stop..."  putserv "PRIVMSG $nick :&lt;&lt;$nick&gt;&gt; is feeling mighty lucky today!"  global slots  set slot1 [lindex $slots [rand [llength $slots]]]  set slot2 [lindex $slots [rand [llength $slots]]]  set slot3 [lindex $slots [rand [llength $slots]]]  putserv "PRIVMSG $nick :| $slot1 | $slot2 | $slot3 |"  if {$slot1 == $slot2} {    if {$slot2 == $slot3} {      putserv "PRIVMSG $nick :Congratulations! $nick  You hit the jackpot!  \$500 !! =)"      putserv "PRIVMSG $nick :Hey everyone! $nick Just hit the Jackpot!"      putserv "PRIVMSG $nick :Don't ya wish it were Real!!  lmfao! :P"      return 1     }     putserv "PRIVMSG $nick :Aww Shucks $nick, :(  2 out of 3 only pays \$50 !  =)"     putserv "PRIVMSG $nick :Too bad it's only on IRC... like your other \"scores\" :P"    return 1  }  if {$slot3 == $slot2} {    if {$slot2 == $slot1} {      putserv "PRIVMSG $nick :Congratulations! $nick  You hit the Jackpot! \$500 !! =)"      putserv "PRIVMSG $nick :Hey everyone! $nick Just hit the Jackpot!"      putserv "PRIVMSG $nick :Don't ya wish it were Real!!  lmfao! :P"      return 1    }    putserv "PRIVMSG $nick :Not too shabby $nick  you just won \$50 !  =)"    putserv "PRIVMSG $nick :Too bad it's only on IRC... like your other \"scores\" :P"    return 1  }  if {$slot1 == $slot3} {    if {$slot2 == $slot1} {      putserv "PRIVMSG $nick :Congratulations! $nick  You hit the Jackpot!  \$500 !! =)"      putserv "PRIVMSG $nick :Hey everyone! $nick Just hit the Jackpot!"      putserv "PRIVMSG $nick :Don't ya wish it were Real!!  lmfao! :P"      return 1    }    putserv "PRIVMSG $nick :Getting close there $nick,  outside matches pay \$25 ! =)"    putserv "PRIVMSG $nick :Too bad its like your other \"SCORES\" on IRC  :P"    return 1  }  putserv "PRIVMSG $nick :Sorry $nick not everyone can be a winner.  Better luck next time, Chump!"  putserv "PRIVMSG $nick :Thanks for playing privately!  Your fellow channel members appreciate it! =)"   return 1 }putlog "Slots 3.0 by Pr|muS@Undernet loaded succesfully"</code></pre></div>I'm still new to TCL, in fact this is my first release of an older .tcl...<br><br>It still needs flood protection as it could easily post a lot of text to the channel and in PRVMSG..<br><br>A timer to throttle responses would be great and if anyone happens to add it, please PM me the entire edited code so I can add you to the revision history...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12556">primus</a> — Mon Aug 03, 2015 12:43 am</p><hr />
]]></content>
	</entry>
	</feed>
