Advertisement
Vorakh

Livello Carburante Turtle (Beta)

Mar 20th, 2013 (edited)
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.88 KB | None | 0 0
  1. -- Programma serbatoio Turtle con Avvisi
  2. -- Programma di Vorakh
  3.  
  4. fRiserva = 100
  5. fLvl = 500
  6. fuel = turtle.getFuelLevel()
  7.  
  8. -- Controllo presenza carburante nel turtle
  9. if fuel > 0 then
  10.     print("Livello Carburante: "..fuel)
  11.     -- Controllo se il carburantè è sotto il livello di "riserva")
  12.     if fuel < fRiserva then
  13.         print("Carburante in riserva, consigliato rifornirlo")
  14.     end
  15. else
  16.     print("Carburante Esaurito")
  17.     print("Inserire Carburante/Carbone/Legno nello 2° slot")
  18.     tempFuel = Fuel
  19.     -- Ciclo di ricarica del turtle fino a
  20.     flag = 1
  21.     while (tempFuel < fLvl) and flag do
  22.         turtle.select(2)
  23.         count = turtle.getItemCount(2)
  24.         if count > 0 then
  25.             turtle.refuel()
  26.             tempFuel = turtle.getFuelLevel()
  27.         else
  28.             print("Turtle ricaricato con il carburante nello slot")
  29.             flag = 0
  30.         end
  31.     end
  32.     print("Turtle rifornito a sufficenza")
  33.     print("Livello Carburante: "..fuel)
  34. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement