adamg765

scaleside

Jun 29th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local top = 51
  2. local bottom = 46
  3. local width = 63
  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 returnToFloor()
  20.     turtle.turnRight()
  21.     while not turtle.forward() do
  22.         turtle.dig()
  23.         sleep(.5)
  24.     end
  25.     turtle.turnLeft()
  26. end
  27.  
  28. for i = 1, width, 1 do
  29.     turtle.dig()
  30.  
  31.     for j = bottom + 1, top - 1, 1 do
  32.         refuel()
  33.         if i % 2 == 1 then
  34.             turtle.up()
  35.         else
  36.             turtle.down()
  37.         end
  38.         turtle.dig()
  39.     end    
  40.     returnToFloor()
  41. end
Add Comment
Please, Sign In to add comment