Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- i=0
- m = peripheral.wrap("back")
- m.clear()
- if fs.exists("compteur_reacteur") then
- h = fs.open("compteur_reacteur", "r")
- time = h.readAll()
- h.close()
- else
- time = 0
- end
- while true do
- if redstone.getInput("top",true) then
- time = time + 1
- i = i + 1
- else
- end
- local day = math.floor(time/86400)
- local hrs = math.floor((time-day*86400)/3600)
- local mins = math.floor((time-(hrs+day*24)*3600)/60)
- local sec = math.floor(time-day*86400-hrs*3600-mins*60)
- if i==300 then
- redstone.setOutput("left",true)
- h = fs.open("compteur_reacteur", "w")
- h.write(time)
- h.close()
- i=0
- else
- redstone.setOutput("left",false)
- end
- shell.run("clear")
- m.setTextScale(3)
- m.write(string.format('% 3d:%02d:%02d:%02d',day,hrs,mins,sec))
- sleep(1)
- end
- --crée par sshikamaru // Citez moi ainsi que le serveur Sphère-ville si vous utilisez ou modifiez ce code.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement