Habnef4

Untitled

Mar 13th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.01 KB | None | 0 0
  1. print("\n")
  2. print("****************")
  3. print("Starting strip mining program by Habnef4")
  4. print("****************")
  5. print("\n")
  6. print("Checking for coal/charcoal in slot one.")
  7. local ToFillFuel = turtle.getItemSpace(1)
  8. local CurrentFuel = turtle.getFuelLevel()
  9. local MaxFuel = turtle.getFuelLimit()
  10. os.sleep(1)
  11. if ToFillFuel==64 then
  12.     print("\n")
  13.     print("****************")
  14.     print("Nothing in slot one.")
  15.     print("Ending program to avoid errors.")
  16.     return
  17. else print("Found items in slot one.")
  18. end
  19.  
  20. local SlotOne = turtle.getItemDetail(1).name
  21. print("\n\n")
  22. os.sleep(1)
  23. if SlotOne == "minecraft:coal" then
  24.     print("\n")
  25.     print("****************")
  26.     print("Found coal/charcoal in slot one.")
  27. else
  28.     print("Non coal/charcoal item found in slot one.")
  29.     print("Ending program to avoid errors.")
  30.     return
  31. end
  32. print("Refuelling")
  33. if MaxFuel - CurrentFuel >= 15000 then
  34.     print("Low on fuel. Refilling until at 5000 fuel.")
  35.     while true do
  36.     turtle.refuel()
  37.     end
  38. else
  39.     os.sleep(1)
  40.     print("All fueled up.")
  41.  
  42. end
Advertisement
Add Comment
Please, Sign In to add comment