Advertisement
GladdeSnaak

Refuel test

Apr 26th, 2021 (edited)
616
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.43 KB | None | 0 0
  1.  
  2. function checkFuel()
  3.     count = 0
  4.     fuelLevel = turtle.getFuelLevel()
  5.         while fuelLevel <= 10 and repcount <= 5000 do
  6.             for i = 1,16 do
  7.                 turtle.select(i)
  8.                 itemInfo = turtle.getItemDetail()
  9.                     if itemInfo ~= nil then
  10.                         if itemInfo.name == "minecraft:coal" then
  11.                             turtle.refuel()
  12.                             print("Refueled ", itemInfo["count"], " coal from slot", i)
  13.                         end
  14.                     end
  15.             end
  16.             count = count + 1
  17.         end
  18. end
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement