Advertisement
MrDionesalvi

redstone

Dec 11th, 2020 (edited)
543
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.63 KB | None | 0 0
  1. -- Contatore Liquidi by CFG
  2. -- Prodcut Key:  111020DICAS
  3.  
  4. lato = "back"
  5.  
  6. valore = 8
  7.  
  8. timer = 1
  9.  
  10.  
  11. function read()
  12.  
  13.     local handle = fs.open("log", "r")
  14.     if handle then
  15.         text = handle.readLine()
  16.         handle.close()
  17.     end
  18.  
  19.     return tonumber(text)
  20.  
  21.  
  22. end
  23.  
  24. function write(numero)
  25.  
  26.        
  27.     local handler = fs.open("log", "w")
  28.     handler.write(numero)
  29.     handler.close()
  30.  
  31.  
  32. end
  33.  
  34.  
  35.  
  36. numero = read()
  37.  
  38.  
  39.  
  40. while true do
  41.     if redstone.getInput(lato) then
  42.  
  43.         term.clear()
  44.  
  45.         numero = numero + valore
  46.         write(numero)
  47.  
  48.         print(numero)
  49.     end
  50.  
  51.     os.sleep(0.1)
  52. end
  53.  
  54.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement