Guest User

miner

a guest
Oct 14th, 2014
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.35 KB | None | 0 0
  1. term.clear()
  2. term.setCursorPos(1,1)
  3.  
  4. local function dig()
  5.   for i = 1, 8 do
  6.       repeat until not turtle.digUp()
  7.       turtle.placeDown()
  8.       while not turtle.forward() do
  9.        turtle.dig()
  10.       end
  11.   end
  12. end
  13.  
  14. local function smartForward()
  15.   while not turtle.forward() do
  16.     if turtle.detect() then
  17.       turtle.dig()
  18.     elseif turtle.attack() then
  19.       print("Aggressive life forms detected!")
  20.     else
  21.       print("Impossible to move forward!")
  22.       return false
  23.     end
  24.   end
  25.   return false
  26. end
  27.  
  28. local function smartTorch()
  29.   while not turtle.place() do
  30.     if turtle.detect() then
  31.       turtle.dig()
  32.     end
  33.   end
  34. end
  35.      
  36.      
  37. local function torch()
  38.   turtle.select(16)
  39.   turtle.turnRight()
  40.   turtle.digUp()
  41.   turtle.dig()
  42.   smartTorch()
  43.   turtle.place()
  44.   turtle.turnLeft()
  45.   turtle.select(1)
  46. end
  47.  
  48. print("How Far?")
  49. x = read()
  50. while true do
  51.   for all = 1, x do
  52.  
  53.     smartForward()
  54.    
  55.     torch()
  56.    
  57.     dig()
  58.    
  59.     torch()
  60.    
  61.   end
  62.  
  63.    turtle.turnLeft()
  64.    turtle.turnLeft()
  65.   for i = 1, x*0.50 do
  66.     turtle.forward()
  67.     smartForward()
  68.   end
  69.   turtle.turnRight()
  70.   for z = 3, 14 do
  71.     turtle.select(y)
  72.     turtle.drop()
  73.   end
  74.  
  75.   turtle.turnLeft()
  76.   turtle.forward()
  77.   turtle.turnLeft()
  78.   turtle.forward()
  79.   turtle.forward()
  80.   turtle.forward()
  81.   turtle.turnLeft()
  82. end
Advertisement
Add Comment
Please, Sign In to add comment