Advertisement
aregrubb

stair placer

Nov 24th, 2017
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1. function refuel()
  2.         repeat
  3.                 turtle.select(1)
  4.                 if turtle.getItemCount( turtle.getSelectedSlot() ) == 0 then
  5.                     print("Out of fuel! Put fuel in first slot.")
  6.                     print("Press any key to continue")
  7.                     os.pullEvent("key")
  8.                 end
  9.         until turtle.getItemCount( turtle.getSelectedSlot() ) > 0
  10.         if turtle.getFuelLevel() ~= "unlimited" and turtle.getFuelLevel() < 1 then
  11.                     print("refueling")
  12.                     turtle.refuel(1)           
  13.         end
  14. end
  15.  
  16. steps = tonumber(read())
  17.  
  18. for a = 1,steps,1 do
  19.         refuel()
  20.         turtle.select(2)
  21.         turtle.placeDown()
  22.         turtle.back()
  23.         turtle.down()
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement