Advertisement
adamg765

rowtop

Jan 22nd, 2017
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. local width = 61
  2.  
  3. local torches = 2
  4.  
  5. local function refuel()
  6.     if turtle.getFuelLevel() == 0 then
  7.         local prev = turtle.getSelectedSlot()
  8.         turtle.select(1)
  9.         if not turtle.refuel(1) then
  10.             print('Need more fuel')
  11.             while not turtle.refuel(1) do
  12.                 sleep(1)
  13.             end
  14.         end
  15.         turtle.select(prev)
  16.     end
  17. end
  18.  
  19. local function checkForTorch(x)
  20.     if (x+3) % 6 == 0 then
  21.         turtle.placeDown()
  22.     end
  23. end
  24.            
  25. turtle.select(torches)
  26. turtle.turnLeft()
  27. turtle.turnLeft()
  28.  
  29. for i = 1, width-1 do
  30.     refuel()
  31.     checkForTorch(i)
  32.     turtle.forward()
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement