Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1,1)
- print("Press 'S' to start a race or 'P' to start a practice. Please note that for races there is a 3 minute yellow light lap")
- input = read()
- if (input == "s" or input == "S") then
- time = 180
- term.clear()
- print("Running pre-race practice...")
- while (time > 8) do
- term.setCursorPos(1,2)
- term.write(time.." Seconds till race")
- rs.setBundledOutput("top", colors.white)
- sleep(1)
- rs.setBundledOutput("top", colors.yellow)
- term.clearLine()
- time = time - 1
- end
- sleep(3)
- rs.setBundledOutput("top", colors.red)
- sleep(1)
- rs.setBundledOutput("top", colors.combine(colors.red + colors.blue))
- sleep(1)
- rs.setBundledOutput("top", colors.combine(colors.red, colors.blue, colros.purple))
- sleep(1)
- rs.setBundledOutput("top", colors.combine(colors.red, colors.blue, colors.purple, colors.black))
- sleep(1)
- rs.setBundledOutput("top", colors.combine(colors.red, colors.blue, colors.purple, colors.black, colors.brown))
- sleep(1)
- rs.setBundledOutput("top", colors.green)
- term.clear()
- term.setCursorPos(1,1)
- print("Press 'E' to end the race, 'Y' to put the race into yellow, or 'R' to put the race into red")
- while not (input2 == "E" or input2 == "e") do
- if (input2 == "Y" or input2 == "y") then
- time = 180
- while (time > 0) do
- term.clear()
- term.setCursorPos(1,2)
- term.write(time.." seconds left of yellow time")
- rs.setBundledOutput("top", colors.white)
- sleep(1)
- rs.setBundledOutput("top", colors.yellow)
- term.clearLine()
- time = time - 1
- end
- end
- if (input2 == "R" or input2 == "r") then
- term.clear()
- term.setCursorPos(1,1)
- print("Race is in red. To restart race please reboot computer by pressing any key.")
- rs.setBundledOutput("top", colors.combine(colors.red, colors.blue, colors.purple, colors.black, colors.brown))
- os.pullEvent("key")
- os.reboot()
- end
- term.clear()
- term.setCursorPos(1,1)
- print("Press 'E' to end the race, 'Y' to put the race into yellow, or 'R' to put the race into red")
- input2 = read()
- end
- elseif (input == "P" or input == "p") then
- time = 300
- term.clear()
- print("Running Practice...")
- while (time > 0) do
- term.setCursorPos(1,1)
- term.write(time.." seconds left")
- rs.setBundledOutput("top", colors.white)
- sleep(1)
- rs.setBundledOutput("top", colors.yellow)
- term.clearLine()
- time = time - 1
- end
- else
- os.reboot()
- end
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment