SHOW:
|
|
- or go back to the newest paste.
| 1 | ftotale = fs.open("numero", "r")
| |
| 2 | totale = tonumber(ftotale.readAll()) | |
| 3 | ftotale.close() | |
| 4 | ||
| 5 | contatore = 0 | |
| 6 | ||
| 7 | while true do | |
| 8 | if rs.getInput("right") == true then
| |
| 9 | contatore = contatore + 8 | |
| 10 | ||
| 11 | totale = totale + 8 | |
| 12 | ||
| 13 | ||
| 14 | term.setCursorPos(1,1) | |
| 15 | term.setTextColor(colors.yellow) | |
| 16 | term.write("CONTEGGIO CAROTE")
| |
| 17 | term.setCursorPos(1,3) | |
| 18 | term.setTextColor(colors.lime) | |
| 19 | term.write("Giornaliero Totale")
| |
| 20 | term.setTextColor(colors.white) | |
| 21 | term.setCursorPos(1,5) | |
| 22 | term.write(contatore) | |
| 23 | term.setCursorPos(15,5) | |
| 24 | term.write(totale) | |
| 25 | ||
| 26 | ||
| 27 | fgiornaliero = fs.open("giornaliero", "w")
| |
| 28 | fgiornaliero.write(contatore) | |
| 29 | fgiornaliero.close() | |
| 30 | ||
| 31 | ftotale2 = fs.open("numero", "w")
| |
| 32 | ftotale2.write(totale) | |
| 33 | ftotale2.close() | |
| 34 | ||
| 35 | end | |
| 36 | sleep(0.1) | |
| 37 | end |