Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local s = peripheral.wrap("bottom")
- local function clear()
- term.clear()
- term.setCursorPos(1, 1)
- end
- local function waitForInput()
- print("Caricare il reattore e premere un tasto")
- print("By Sevcon Atomic")
- os.pullEvent("key")
- clear()
- end
- local function formatTime(time)
- local hours = math.floor(time / 3600)
- local minutes = math.floor((time % 3600) / 60)
- local seconds = time % 60
- return string.format("%02d:%02d:%02d", hours, minutes, seconds)
- end
- clear()
- while true do
- local uuid, state, title, tab = s.get(1)
- if not tab then
- print("Errore nella comunicazione con il reattore")
- print("By Sevcon Atomic")
- sleep(1)
- clear()
- return
- end
- if tab.timeLeft == 0 then
- waitForInput()
- end
- clear()
- print("Caricamento automatico materiale da arricchire in funzione")
- print("Tempo rimanente: " .. formatTime(tab.timeLeft))
- print("By Sevcon Atomic")
- rs.setBundledOutput("back", 2)
- if tab.timeLeft < 10 then
- clear()
- rs.setBundledOutput("back", 32)
- print("Attesa esaurimento uranio")
- sleep(30)
- print("Caricamento uranio")
- rs.setBundledOutput("back", 1)
- sleep(30)
- clear()
- rs.setBundledOutput("back", 0)
- end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment