Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Change camount to set how many prizes to give out.
- -- if you are using this on a multiplayer server
- -- add a way to stop them being able to access the terminal(add a script to make un-terminatable)
- camount = 10
- shell.run("clear",1)
- mon = peripheral.wrap("top")
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write(" INSERT")
- mon.setCursorPos(1,2)
- mon.write(" GOLD")
- mon.setCursorPos(1,3)
- mon.write(" TO")
- mon.setCursorPos(1,4)
- mon.write(" PLAY")
- function won()
- sleep(2)
- mon = peripheral.wrap("right")
- mon.clear()
- mon.setCursorPos(3,1)
- mon.setBackgroudnColor(colors.black)
- mon.setTextColor(colors.lime)
- mon.write(" WON!")
- end
- function loss()
- sleep(2)
- mon = peripheral.wrap("right")
- mon.clear()
- mon.setCursorPos(3,1)
- mon.setBackgroudnColor(colors.black)
- mon.setTextColor(colors.red)
- mon.write(" LOST")
- end
- function slots()
- result1 = math.random(1,5)
- result1 = result1 - ".0"
- result2 = math.random(1,5)
- result2 = result2 - ".0"
- result3 = math.random(1,5)
- result3 = result3 - ".0"
- term.setCursorPos(25,5)
- mon = peripheral.wrap("right")
- mon.clear()
- mon.setCursorPos(3,2)
- if (result1 == 1) then
- mon.setBackgroudnColor(colors.pink)
- mon.setTextColor(colors.pink)
- mon.write(" ")
- else if (result1 == 2) then
- mon.setBackgroudnColor(colors.yellow)
- mon.setTextColor(colors.yellow)
- mon.write(" ")
- else if (result1 == 3) then
- mon.setBackgroudnColor(colors.cyan)
- mon.setTextColor(colors.cyan)
- mon.write(" ")
- else if (result1 == 4) then
- mon.setBackgroudnColor(colors.red)
- mon.setTextColor(colors.red)
- mon.write(" ")
- else if (result1 == 5) then
- mon.setBackgroudnColor(colors.lightBlue)
- mon.setTextColor(colors.lightBlue)
- mon.write(" ")
- end
- mon.setBackgroudnColor(colors.black)
- mon.setTextColor(colors.white)
- mon.write(" ")
- if (result2 == 1) then
- mon.setBackgroudnColor(colors.pink)
- mon.setTextColor(colors.pink)
- mon.write(" ")
- else if (result2 == 2) then
- mon.setBackgroudnColor(colors.yellow)
- mon.setTextColor(colors.yellow)
- mon.write(" ")
- else if (result2 == 3) then
- mon.setBackgroudnColor(colors.cyan)
- mon.setTextColor(colors.cyan)
- mon.write(" ")
- else if (result2 == 4) then
- mon.setBackgroudnColor(colors.red)
- mon.setTextColor(colors.red)
- mon.write(" ")
- else if (result2 == 5) then
- mon.setBackgroudnColor(colors.lightBlue)
- mon.setTextColor(colors.lightBlue)
- mon.write(" ")
- end
- mon.setBackgroudnColor(colors.black)
- mon.setTextColor(colors.white)
- mon.write(" ")
- if (result3 == 1) then
- mon.setBackgroudnColor(colors.pink)
- mon.setTextColor(colors.pink)
- mon.write(" ")
- else if (result3 == 2) then
- mon.setBackgroudnColor(colors.yellow)
- mon.setTextColor(colors.yellow)
- mon.write(" ")
- else if (result3 == 3) then
- mon.setBackgroudnColor(colors.cyan)
- mon.setTextColor(colors.cyan)
- mon.write(" ")
- else if (result3 == 4) then
- mon.setBackgroudnColor(colors.red)
- mon.setTextColor(colors.red)
- mon.write(" ")
- else if (result3 == 5) then
- mon.setBackgroudnColor(colors.lightBlue)
- mon.setTextColor(colors.lightBlue)
- mon.write(" ")
- end
- mon.setBackgroudnColor(colors.black)
- mon.setTextColor(colors.white)
- if result1 == result2 and result2 == result3 then
- print("Winner")
- win()
- cpayout = 0
- while cpayout < 3 do
- redstone.setOutput("left",true)
- sleep(0.2)
- redstone.setOutput("left",false)
- sleep(0.2)
- cpayout = cpayout +1
- end
- os.reboot()
- else
- print("Lost.")
- loss()
- sleep(2)
- os.reboot()
- end
- end
- local rRunning = true
- while rRunning do
- sleep(0.5)
- local rEvent, param = os.pullEvent()
- if rEvent == "redstone" then
- if redstone.getInput("right") then
- if redstone.getInput("right") == true then
- slots()
- else
- shell.run("clear",1)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement