Advertisement
Birog

Platform bauen

Jan 29th, 2013
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.73 KB | None | 0 0
  1. local function refuel()
  2.     local fuelLevel = turtle.getFuelLevel()
  3.     if fuelLevel == "unlimited" or fuelLevel > 0 then
  4.         return
  5.     end
  6.    
  7.     local function tryRefuel()
  8.         for n=1,16 do
  9.             if turtle.getItemCount(n) > 0 then
  10.                 turtle.select(n)
  11.                 if turtle.refuel(1) then
  12.                     turtle.select(1)
  13.                     return true
  14.                 end
  15.             end
  16.         end
  17.         turtle.select(1)
  18.         return false
  19.     end
  20.    
  21.     if not tryRefuel() then
  22.         print( "Add more fuel to continue." )
  23.         while not tryRefuel() do
  24.             sleep(1)
  25.         end
  26.         print( "Resuming Tunnel." )
  27.     end
  28. end
  29. turtle.up()
  30. for 1=1,7 do
  31.  refuel()
  32.  for u=1,7 do
  33.   turtle.placeDown()
  34.   turtle.forward()
  35.  end
  36.  for y=1,7 do
  37.   turtle.back()
  38.  end
  39.  turtle.turnRight()
  40.  turtle.forward()
  41.  turtle.turnLeft()
  42. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement