Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --contatore del gas v1 (c) lego11
- term.clear()
- term.setCursorPos(1,1)
- local metricubi = 0
- function refresh()
- term.setCursorPos(1,3)
- end
- print("Compagnia Generale Contatori S.A. (New Radeon)")
- print("")
- rhandle = assert(fs.open("metricubi", "r"), "ERRORE: file metri cubi non presente")
- rawmc = rhandle.readAll()
- metricubi = tonumber(rawmc)
- rhandle.close()
- while true do
- os.pullEvent("redstone")
- if redstone.getInput("back") == true then
- metricubi = metricubi + 1
- refresh()
- print(metricubi.." m³")
- whandle = assert(fs.open("metricubi", "w"), "TOC ERROR")
- whandle.write(tostring(metricubi))
- whandle.close()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment