csmit195

Refuel

Jul 29th, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.31 KB | None | 0 0
  1. for i = 1, 16 do -- loop through the slots
  2.   turtle.select(i) -- change to the slot
  3.   if turtle.refuel(0) then -- if it's valid fuel
  4.     local halfStack = math.ceil(turtle.getItemCount(i)/2) -- work out half of the amount of fuel in the slot
  5.     turtle.refuel(halfStack) -- consume half the stack as fuel
  6.   end
  7. end
Add Comment
Please, Sign In to add comment