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 = 50
- shell.run("clear",1)
- mon = peripheral.wrap("right")
- mon.clear()
- if redstone.getInput("top") == false then
- mon.setCursorPos(1,1)
- mon.write("Push")
- mon.setCursorPos(1,2)
- mon.write("button")
- mon.setCursorPos(1,3)
- mon.write("to play")
- mon.setCursorPos(1,4)
- mon.write(" ->")
- elseif redstone.getInput("top") == true then
- mon.setCursorPos(1,1)
- mon.write("Insert")
- mon.setCursorPos(1,2)
- mon.write("card")
- mon.setCursorPos(1,3)
- mon.write("to play")
- mon.setCursorPos(1,4)
- mon.write(" ->")
- end
- print("Welcome to Slot v1.2.a (modif and bugfixed by lego11)")
- function winner()
- sleep(2)
- mon = peripheral.wrap("right")
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write("*-*-*-*")
- mon.setCursorPos(1,2)
- mon.write("-*-*-*-")
- mon.setCursorPos(1,3)
- mon.write("Winner!")
- mon.setCursorPos(1,4)
- mon.write("-*-*-*-")
- mon.setCursorPos(1,5)
- mon.write("*-*-*-*")
- sleep(0.5)
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write("-*-*-*-")
- mon.setCursorPos(1,2)
- mon.write("*-*-*-*")
- mon.setCursorPos(1,3)
- mon.write("Winner!")
- mon.setCursorPos(1,4)
- mon.write("*-*-*-*")
- mon.setCursorPos(1,5)
- mon.write("-*-*-*-")
- sleep(0.5)
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write("*-*-*-*")
- mon.setCursorPos(1,2)
- mon.write("-*-*-*-")
- mon.setCursorPos(1,3)
- mon.write("Winner!")
- mon.setCursorPos(1,4)
- mon.write("-*-*-*-")
- mon.setCursorPos(1,5)
- mon.write("*-*-*-*")
- sleep(0.5)
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write("-*-*-*-")
- mon.setCursorPos(1,2)
- mon.write("*-*-*-*")
- mon.setCursorPos(1,3)
- mon.write("Winner!")
- mon.setCursorPos(1,4)
- mon.write("*-*-*-*")
- mon.setCursorPos(1,5)
- mon.write("-*-*-*-")
- sleep(0.5)
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write("*-*-*-*")
- mon.setCursorPos(1,2)
- mon.write("-*-*-*-")
- mon.setCursorPos(1,3)
- mon.write("Winner!")
- mon.setCursorPos(1,4)
- mon.write("-*-*-*-")
- mon.setCursorPos(1,5)
- mon.write("*-*-*-*")
- sleep(0.5)
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write("-*-*-*-")
- mon.setCursorPos(1,2)
- mon.write("*-*-*-*")
- mon.setCursorPos(1,3)
- mon.write("Winner!")
- mon.setCursorPos(1,4)
- mon.write("*-*-*-*")
- mon.setCursorPos(1,5)
- mon.write("-*-*-*-")
- end
- function Loser()
- sleep(2)
- mon = peripheral.wrap("right")
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write("*-*-*-*")
- mon.setCursorPos(1,2)
- mon.write("-*-*-*-")
- mon.setCursorPos(1,3)
- mon.write("Loser!!")
- mon.setCursorPos(1,4)
- mon.write("-*-*-*-")
- mon.setCursorPos(1,5)
- mon.write("*-*-*-*")
- sleep(0.5)
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write("-*-*-*-")
- mon.setCursorPos(1,2)
- mon.write("*-*-*-*")
- mon.setCursorPos(1,3)
- mon.write("Loser!!")
- mon.setCursorPos(1,4)
- mon.write("*-*-*-*")
- mon.setCursorPos(1,5)
- mon.write("-*-*-*-")
- sleep(0.5)
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write("*-*-*-*")
- mon.setCursorPos(1,2)
- mon.write("-*-*-*-")
- mon.setCursorPos(1,3)
- mon.write("Loser!!")
- mon.setCursorPos(1,4)
- mon.write("-*-*-*-")
- mon.setCursorPos(1,5)
- mon.write("*-*-*-*")
- sleep(0.5)
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write("-*-*-*-")
- mon.setCursorPos(1,2)
- mon.write("*-*-*-*")
- mon.setCursorPos(1,3)
- mon.write("Loser!!")
- mon.setCursorPos(1,4)
- mon.write("*-*-*-*")
- mon.setCursorPos(1,5)
- mon.write("-*-*-*-")
- sleep(0.5)
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write("*-*-*-*")
- mon.setCursorPos(1,2)
- mon.write("-*-*-*-")
- mon.setCursorPos(1,3)
- mon.write("Loser!!")
- mon.setCursorPos(1,4)
- mon.write("-*-*-*-")
- mon.setCursorPos(1,5)
- mon.write("*-*-*-*")
- sleep(0.5)
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write("-*-*-*-")
- mon.setCursorPos(1,2)
- mon.write("*-*-*-*")
- mon.setCursorPos(1,3)
- mon.write("Loser!!")
- mon.setCursorPos(1,4)
- mon.write("*-*-*-*")
- mon.setCursorPos(1,5)
- mon.write("-*-*-*-")
- end
- function slots()
- result1 = math.random(1,7)
- result1 = result1 - ".0"
- result2 = math.random(1,7)
- result2 = result2 - ".0"
- result3 = math.random(1,7)
- result3 = result3 - ".0"
- result4 = math.random(1,7)
- result4 = result4 - ".0"
- result5 = math.random(1,7)
- result5 = result5 - ".0"
- result6 = math.random(1,7)
- result6 = result6 - ".0"
- result7 = math.random(1,7)
- result7 = result7 - ".0"
- result8 = math.random(1,7)
- result8 = result8 - ".0"
- result9 = math.random(1,7)
- result9 = result9 - ".0"
- term.setCursorPos(25,5)
- mon = peripheral.wrap("right")
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write("*******")
- mon.setCursorPos(2,2)
- mon.write(result1.."|"..result2.."|"..result3)
- mon.setCursorPos(2,3)
- mon.write(result4.."|"..result5.."|"..result6)
- mon.setCursorPos(2,4)
- mon.write(result7.."|"..result8.."|"..result9)
- mon.setCursorPos(1,5)
- mon.write("*******")
- term.setCursorPos(1,3)
- print("Debug Info:")
- print("Results: "..result1.."|"..result2.."|"..result3)
- print(" "..result4.."|"..result5.."|"..result6)
- print(" "..result7.."|"..result8.."|"..result9)
- if result1 == result2 and result2 == result3 then
- print("Row Match, Top Row")
- winner()
- cpayout = 0
- while cpayout < camount do
- redstone.setOutput("bottom",true)
- sleep(0.2)
- redstone.setOutput("bottom",false)
- sleep(0.2)
- cpayout = cpayout +1
- end
- os.reboot()
- elseif result4 == result5 and result5 == result6 then
- print("Row Match, Middle Row")
- winner()
- cpayout = 0
- while cpayout < camount do
- redstone.setOutput("bottom",true)
- sleep(0.2)
- redstone.setOutput("bottom",false)
- sleep(0.2)
- cpayout = cpayout +1
- end
- os.reboot()
- elseif result7 == result8 and result8 == result9 then
- print("Row Match, Bottom Row")
- winner()
- cpayout = 0
- while cpayout < camount do
- redstone.setOutput("bottom",true)
- sleep(0.2)
- redstone.setOutput("bottom",false)
- sleep(0.2)
- cpayout = cpayout +1
- end
- os.reboot()
- elseif result1 == result5 and result5 == result9 then
- print("Diagonal Match From top to bottom.")
- winner()
- cpayout = 0
- while cpayout < camount do
- redstone.setOutput("bottom",true)
- sleep(0.2)
- redstone.setOutput("bottom",false)
- sleep(0.2)
- cpayout = cpayout +1
- end
- os.reboot()
- elseif result7 == result5 and result5 == result3 then
- print("Diagonal Match From bottom to top.")
- winner()
- cpayout = 0
- while cpayout < camount do
- redstone.setOutput("bottom",true)
- sleep(0.2)
- redstone.setOutput("bottom",false)
- sleep(0.2)
- cpayout = cpayout +1
- end
- os.reboot()
- else
- print("There was No Match")
- Loser()
- 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("left") then
- if redstone.getInput("left") == true then
- slots()
- else
- shell.run("clear",1)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement