adamg765

destroyFloor

Mar 8th, 2017
77
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local length = 61
  2. local width = 61
  3.  
  4. local function refuel()
  5.     if turtle.getFuelLevel() < 50 then
  6.         local prev = turtle.getSelectedSlot()
  7.         turtle.select(1)
  8.         if not turtle.refuel(4) then
  9.             print('Need more fuel')
  10.             while not turtle.refuel(4) do
  11.                 sleep(3)
  12.             end
  13.         end
  14.         turtle.select(prev)
  15.     end
  16. end
  17.  
  18. local function tryForwards()
  19.     refuel()
  20.     while not turtle.forward() do
  21.         if turtle.detect() then
  22.             turtle.dig()
  23.             sleep(.5)
  24.             while turtle.detect() do
  25.                 turtle.dig()
  26.                 sleep(.5)
  27.             end
  28.         elseif turtle.attack() then
  29.         else
  30.             sleep(1)
  31.         end
  32.     end
  33. end
  34.  
  35. local function turnAround(i)
  36.     turtle.placeDown()
  37.     if i%2 == 1 then
  38.         turtle.turnRight()
  39.         tryForwards()
  40.         turtle.turnRight()
  41.     else
  42.         turtle.turnLeft()
  43.         tryForwards()
  44.         turtle.turnLeft()
  45.     end
  46. end
  47. turtle.select(2)
  48. for i = 1, length-1, 1 do
  49.     for j = 1, width-1, 1 do
  50.         refuel()
  51.         tryForwards()
  52.     end
  53.     turnAround(i)
  54. end
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×