deltreey

fuel

Feb 8th, 2015
485
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.26 KB | None | 0 0
  1. function canRefuel()
  2.     return turtle.getItemCount(16) > 0
  3. end
  4.  
  5. function fuelUp()
  6.     local oldSlot = turtle.getSelectedSlot()
  7.     if (canRefuel()) then
  8.         turtle.select(16)
  9.         turtle.refuel(1)
  10.         turtle.select(oldSlot)
  11.     else
  12.         print('Error: no fuel')
  13.     end
  14. end
Advertisement
Add Comment
Please, Sign In to add comment