ecco7777

CC ecco excavate

Sep 29th, 2018
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.63 KB | None | 0 0
  1. args={...}
  2. if args[1]~=nil then
  3. n=tonumber(args[1])
  4. end
  5.  
  6. function digC()
  7.     isFull()
  8.     turtle.digUp()
  9.     turtle.dig()
  10.     turtle.digDown()
  11. end
  12.  
  13. function digL(n)
  14.     for i=1,n do
  15.         digC()
  16.         turtle.forward()
  17.     end
  18. end
  19.  
  20. function dump()
  21.     turtle.select(1)
  22.     turtle.placeUp()
  23.     for idump=2,16 do
  24.         turtle.select(idump)
  25.         turtle.dropUp()
  26.     end
  27.     turtle.select(1)
  28.     turtle.digUp()
  29. end
  30.  
  31. function isFull()
  32.     if turtle.getItemCount(16)>0 then
  33.         dump()
  34.     end
  35. end
  36. n=1
  37. while true do
  38.     digL(n)
  39.     turtle.turnRight()
  40.     digL(n)
  41.     turtle.turnRight()
  42.     n=n+1
  43. end
Add Comment
Please, Sign In to add comment