Advertisement
Esbenmine

Casino

Aug 7th, 2014
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.74 KB | None | 0 0
  1. --Made by Esbenmine
  2. SleepTime = .2
  3. Start1 = true
  4. Start2 = true
  5. Start3 = true
  6. Start = true
  7. term.clear()
  8. term.setCursorPos(1,1)
  9. MW, MH = term.getSize()
  10. FH = 10
  11. FW = 12
  12. Enter = function()
  13.   repeat
  14.     local event, key = os.pullEvent("key")
  15.     if key == keys.space then
  16.       if Start1 then
  17.         Start1 = false
  18.       else
  19.         if Start2 then
  20.           Start2 = false
  21.         else
  22.           if Start3 then
  23.             Start3 = false
  24.             if Color1 == Color2 and Color2 == Color3 then
  25.               print("Yeah")
  26.             elseif Color1 == Color2 or Color2 == Color3 or Color3 == Color1 then
  27.               print("Little Yeah")
  28.             else
  29.               print("Nope")
  30.             end
  31.             sleep(2)
  32.             Start1 = true
  33.             Start2 = true
  34.             Start3 = true
  35.           end
  36.         end
  37.       end
  38.     else
  39.     end
  40.   until Start == false
  41. end
  42.  
  43. RandomColor = function()
  44.   Number = math.random(1,16)
  45.   if Number == 1 then
  46.     Color = colors.white
  47.   elseif Number == 2 then
  48.     Color = colors.orange
  49.   elseif Number == 3 then
  50.     Color = colors.magenta
  51.   elseif Number == 4 then
  52.     Color = colors.lightBlue
  53.   elseif Number == 5 then
  54.     Color = colors.yellow
  55.   elseif Number == 6 then
  56.     Color = colors.lime
  57.   elseif Number == 7 then
  58.     Color = colors.pink
  59.   elseif Number == 8 then
  60.     Color = colors.gray
  61.   elseif Number == 9 then
  62.     Color = colors.lightGray
  63.   elseif Number == 10 then
  64.     Color = colors.cyan
  65.   elseif Number == 11 then
  66.     Color = colors.purple
  67.   elseif Number == 12 then
  68.     Color = colors.blue
  69.   elseif Number == 13 then
  70.     Color = colors.brown
  71.   elseif Number == 14 then
  72.     Color = colors.green
  73.   elseif Number == 15 then
  74.     Color = colors.red
  75.   elseif Number == 16 then
  76.     Color = colors.black
  77.   end
  78.   return Color
  79. end
  80.  
  81. DrawF = function(x,y, Color)
  82.   for x1 = 1, FW do
  83.     for y1 = 1, FH do
  84.       term.setBackgroundColor(Color)
  85.       term.setCursorPos((x1+x),(y1+y))
  86.       print(" ")
  87.     end
  88.   end
  89. end
  90. Spin1 = function()
  91.   repeat
  92.     if Start1 == false then
  93.       return
  94.     else
  95.       Color1 = RandomColor()
  96.       DrawF((MW/2 - FW/2 - FW - 6),1, Color1)  
  97.     end
  98.     sleep(SleepTime)
  99.   until Start1 == false  
  100. end
  101.  
  102. Spin2 = function()
  103.   repeat
  104.     if Start2 == false then
  105.       return  
  106.     else
  107.       Color2 = RandomColor()
  108.       DrawF((MW/2 - FW/2),1,Color2)
  109.     end
  110.     sleep(SleepTime)
  111.   until Start2 == false
  112. end
  113.  
  114. Spin3 = function()
  115.   repeat
  116.     if Start3 == false then
  117.       return
  118.     else
  119.       Color3 = RandomColor()
  120.       DrawF((MW/2 - FW/2 + FW + 6),1,Color3)
  121.     end
  122.     sleep(SleepTime)
  123.   until Start3 == false
  124. end
  125.  
  126. repeat
  127.   parallel.waitForAll(Enter, Spin1, Spin2, Spin3)
  128. until Start == false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement