Rwd208

Turtle Strip Miner

Jul 22nd, 2013
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.26 KB | None | 0 0
  1. local steps = 0
  2. local left = 0
  3. local back = 0
  4. local right = 0
  5. local z = true
  6. local long = 0
  7. local torchslot = 2
  8. local fuelslot = 1
  9.  
  10. print"Fuel in slot 1"
  11. print"64 Torches in slot 2"
  12. print"Important! 64 torches!"
  13. print"It will go for 190 meters!"
  14. print"Because than the torches"
  15. print"will run out"
  16. print"Press enter to start!"
  17. print"Robertd208 Strip Miner"
  18. read(input)
  19.  
  20.  
  21. while z == true do
  22.         repeat
  23.                         turtle.dig()
  24.                         turtle.forward()
  25.                         turtle.digUp()
  26.                         turtle.digDown()
  27.                         steps = steps + 1
  28.         until steps == 3
  29.         steps = 0
  30.         turtle.turnLeft()
  31.          
  32.         repeat
  33.                         turtle.dig()
  34.                         turtle.forward()
  35.                         turtle.digUp()
  36.                         turtle.digDown()
  37.                         left = left + 1
  38.         until left == 6
  39.         left = 0
  40.         turtle.turnRight()
  41.         turtle.turnRight()
  42.  
  43.         repeat
  44.                         turtle.dig()
  45.                         turtle.forward()
  46.                         turtle.digUp()
  47.                         turtle.digDown()
  48.                         back = back + 1
  49.         until back == 6
  50.         back = 0
  51.          
  52.         repeat
  53.                         turtle.dig()
  54.                         turtle.forward()
  55.                         turtle.digUp()
  56.                         turtle.digDown()
  57.                         right = right + 1
  58.         until right == 6
  59.         right = 0
  60.         turtle.turnLeft()
  61.         turtle.turnLeft()
  62.          
  63.         repeat
  64.                         turtle.dig()
  65.                         turtle.forward()
  66.                         turtle.digUp()
  67.                         turtle.digDown()
  68.                         back = back + 1
  69.         until back == 6
  70.         back = 0
  71.         turtle.turnRight()
  72.          
  73.         long = long + 1
  74.                
  75.                 if turtle.getFuelLevel() < 80 then
  76.                                                 turtle.select(fuelslot)
  77.                                                 turtle.refeul()
  78.                 end
  79.  
  80.         turtle.select(torchslot)
  81.         turtle.placeDown()
  82. end
  83.  
  84. if(long == 500) then
  85.         z = false
  86. end
Advertisement
Add Comment
Please, Sign In to add comment