Advertisement
Helium

dynplacer

Apr 26th, 2013
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.87 KB | None | 0 0
  1. input = {...}
  2. direct = input[1]
  3. -- direction :
  4. quant = input[2]
  5.  
  6. -- SLOT ASSIGNMENT
  7. -- Remote 1
  8. -- Dynamite 15
  9. -- Extra fuel 16
  10.  
  11. function refuel()
  12.     distfuel = quant * 2 + 1000
  13.     if turtle.getFuelLevel() <= distfuel then
  14.         turlle.select(16)
  15.         turtle.refuel()
  16.     end
  17. end
  18.  
  19. function walkForward()
  20.     while turtle.forward() == false do
  21.         turtle.dig()
  22.     end
  23. end
  24.  
  25. function triwalkForward()
  26.     for go = 1, 3 do
  27.         walkForward()
  28.         turtle.digUp()
  29.     end
  30. end
  31.  
  32. function walkDown()
  33.     while turtle.down == false do
  34.         turtle.digDown()
  35.     end
  36. end
  37.  
  38. function placeDyn()
  39.     turtle.select(1)
  40.     turtle.placeUp()
  41.     turtle.select(15)
  42.     turtle.placeUp()
  43. end
  44.  
  45. function tunnelForward()
  46.     walkForward()
  47.     turtle.digUp()
  48.     walkForward()
  49.     turtle.digUp()
  50.     for cycle = 1, quant - 1 do
  51.         placeDyn()
  52.         triwalkForward()
  53.     end
  54.     placeDyn()
  55. end
  56.  
  57. if direct == "forward" then
  58.     tunnelForward()
  59. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement