Advertisement
punchin

CC_Lava Tank Filler

Feb 24th, 2015
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.67 KB | None | 0 0
  1. local args = {...}
  2. if args[1] then
  3.     local mdist = args[1]
  4. end
  5.  
  6. local dist = 0
  7.  
  8. while true do
  9.     if (dist == mdist) then
  10.         break
  11.     end
  12.     if not turtle.forward() then -- Hit a wall, return to start
  13.         break
  14.     end
  15.     dist = dist + 1
  16.     turtle.select(1)
  17.     while not turtle.placeUp() do -- Placing tank
  18.         turtle.digUp()
  19.         turtle.attackUp()
  20.     end
  21.     turtle.select(2)
  22.     if not turtle.placeDown() then -- No lava below, return to start
  23.         turtle.select(1)
  24.         turtle.digUp()
  25.         break
  26.     end
  27.     if not turtle.placeUp() then -- Tank full, return to start
  28.         turtle.select(1)
  29.         turtle.digUp()
  30.         break
  31.     end
  32.     turtle.select(1)
  33.     turtle.digUp()
  34. end
  35.  
  36. for i=1,dist do
  37.     turtle.back()
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement