daenor

diggyhole

Jul 6th, 2012
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.54 KB | None | 0 0
  1. --[[
  2.  
  3.         turtle digging programm
  4.        
  5. ]]--
  6.  
  7. --clear page
  8. term.clear()
  9.  
  10.  
  11. --main loop
  12. for i=1, 2 do
  13.     --set inv slot to 1
  14.     turtle.select(1)
  15.  
  16.     --check for full inv.
  17.     while turtle.getItemCount(9) == 0 do
  18.  
  19.         --check for blocks to mine
  20.         if turtle.detect()== true then
  21.             turtle.dig()
  22.         end
  23.  
  24.         if turtle.detectDown() == true then
  25.             turtle.digDown()
  26.         end
  27.    
  28.         if turtle.detectUp() == true then
  29.             turtle.digUp()
  30.         end
  31.    
  32.         turtle.forward()
  33.     end
  34.     --drop inventory
  35.     for j=1 , 10 do
  36.         turtle.select(1)
  37.         turtle.drop()
  38.     end
  39. end
Advertisement
Add Comment
Please, Sign In to add comment