Advertisement
punchin

CC_Plant

Jun 4th, 2014
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.83 KB | None | 0 0
  1. args = {...}
  2.  
  3. if not args[1] then
  4.     print("Please tell me how far to go.")
  5.     return
  6. end
  7.  
  8. local len = args[1]
  9.  
  10. local function invCheck()
  11.     count = turtle.getItemCount(1)
  12.     print(count)
  13.     if count == 1 then
  14.     print("Refilling slot 1.")
  15.         for i=2,16 do
  16.             if turtle.compareTo(i) then
  17.                 print("Found same block in slot " .. i .. ".")
  18.                 turtle.select(i)
  19.                 turtle.transferTo(1,63)
  20.                 turtle.select(1)
  21.                 break
  22.             end
  23.         end
  24.     end
  25. end
  26.  
  27. for i=1,len do
  28.     while not turtle.forward() do
  29.         turtle.dig()
  30.     end
  31.     invCheck()
  32.     while turtle.detectDown() do
  33.         turtle.digDown()
  34.     end
  35.     turtle.placeDown()
  36. end
  37. --[[
  38. for i=1,len do
  39.     while not turtle.back() do
  40.         turtle.turnRight()
  41.         turtle.turnRight()
  42.         while turtle.detect() do
  43.             turtle.attack()
  44.             turtle.dig()
  45.         end
  46.         turtle.turnRight()
  47.         turtle.turnRight()
  48.     end
  49. end]]--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement