Code: Select all
#################################################################
# --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" & "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_slots
proc play_slots {nick uhost handle chan args} {
global slotchan
if {$chan == $slotchan} {
putserv "PRIVMSG $slotchan :<<$nick>> 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_slotsm
proc play_slotsm {nick uhost handle chan args} {
putserv "PRIVMSG $nick :<<$nick>> puts a quarter in the slot machine, pulls the lever, The reels are spinning... coming to a stop..."
putserv "PRIVMSG $nick :<<$nick>> 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"
It still needs flood protection as it could easily post a lot of text to the channel and in PRVMSG..
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...