Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TimeMultiplier = 60
- CycleTime = 45
- CooldownTime = 1
- function turnOn() rs.setOutput("back", true) end
- function turnOff() rs.setOutput("back", false) end
- while true do
- print("How many cycles should run?")
- write("Cycles> ")
- numCycles = read()
- for i=1,numCycles do
- term.clear()
- term.setCursorPos(1, 1)
- print("+-----------------------------------------------+")
- print("| Refuel Reactor |")
- print("| Press ENTER when refueled |")
- print("+-----------------------------------------------+")
- --[[while true do
- event, arg = os.pullEvent()
- if event == "key" and arg == 28 then break end
- end--]]
- term.clear()
- term.setCursorPos(1, 1)
- print("+-----------------------------------------------+")
- print("| Reactor is running |")
- print("| Time Left: |")
- print("+-----------------------------------------------+")
- turnOn()
- timeleft = CycleTime
- for i=1, CycleTime do
- if timeleft < 10 then CT = tostring(timeleft).." " else CT = tostring(timeleft) end
- term.setCursorPos(1, 3)
- term.clearLine()
- print("| Time Left: "..CT.." |")
- sleep(TimeMultiplier)
- timeleft = timeleft-1
- end
- turnOff()
- term.clear()
- term.setCursorPos(1, 1)
- print("+-----------------------------------------------+")
- print("| Reactor is cooling down |")
- print("| Time Left: |")
- print("+-----------------------------------------------+")
- timeleft = CooldownTime
- if CooldownTime ~= 0 then
- for i=1, CooldownTime do
- if timeleft <10 then CdT = tostring(timeleft).." " else CdT = tostring(timeleft) end
- term.setCursorPos(28, 3)
- print(CdT.." |")
- sleep(TimeMultiplier)
- timeleft = timeleft-1
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement