Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Finding the monitor side
- local side=nil
- for r,s in pairs(rs.getSides()) do
- if peripheral.getType(s)=='monitor' then
- side=s
- break
- end
- end
- --Wrapping the peripheral and setting up defaults
- local m = peripheral.wrap(side)
- m.setBackgroundColor(colors.black)
- m.clear()
- m.setTextScale(1)
- m.setCursorPos(1,1)
- m.setTextColor(colors.yellow)
- m.write("SLOTS")
- --Playing the game
- while true do
- if os.pullEvent()=='monitor_touch' then
- --Spinner 1
- local sponge1=nil
- local number1 = math.random(1, 6)
- if number1 == 1 then
- sponge1 = colors.yellow
- elseif number1 == 2 then
- sponge1 = colors.green
- elseif number1 == 3 then
- sponge1 = colors.blue
- elseif number1 == 4 then
- sponge1 = colors.magenta
- elseif number1 == 5 then
- sponge1 = colors.red
- elseif number1 == 6 then
- sponge1 = colors.orange
- end
- function slot1(x1,y1,x2,y2,color1)
- x1,y1,x2,y2 = 1,2,2,2
- for i = x1,x2 do
- for o = y1,y2 do
- color1 = sponge1
- m.setCursorPos(i,o)
- m.setBackgroundColor(color1)
- m.write(" ")
- end
- end
- end
- if number1==1 then
- slot1(x1,y1,x2,y2,number1)
- elseif number1==2 then
- slot1(x1,y1,x2,y2,number1)
- elseif number1==3 then
- slot1(x1,y1,x2,y2,number1)
- elseif number1==4 then
- slot1(x1,y1,x2,y2,number1)
- elseif number1==5 then
- slot1(x1,y1,x2,y2,number1)
- elseif number1==6 then
- slot1(x1,y1,x2,y2,number1)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment