Sivarias

CC_turtle_!tunnel

Oct 9th, 2013
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. --!tunnel
  2. --This is simple user friendly tunneling program
  3. print("I will mine a 2x2 tunnel placing a torch every 5 blocks and return to the space to the right of my original position.")
  4. print("")
  5. sleep(0.5)
  6. print("I need torches in slot one Boss!")
  7. sleep(0.5)
  8. print("I can also lay a floor if you put a Cobblestone in slot 3!")
  9. local torch=1
  10. local cobblestone=3
  11. sleep(1)
  12. print("How many torches can I place Boss? ")
  13. local x=read()
  14. local y=(x+1)*12
  15. channel=os.getComputerID()
  16. modem.transmit(128, channel, "Minion "..os.getComputerLabel().." has started tunneling, Sir!")
  17. if y>=turtle.getFuelLevel() then
  18. print("Sorry boss, I don't have enough fuel")
  19. sleep(0.5)
  20. print("Give me fuel and try again")
  21. else
  22. local z=0
  23. t.up()
  24. t.digUp()
  25. for i=1, x, 1 do
  26. for j=1, 5, 1 do
  27. t.forward()
  28. z=z+1
  29. if not turtle.detectDown() then
  30. turtle.select(cobblestone)
  31. turtle.placeDown()
  32. end
  33. t.digUp()
  34. t.digDown()
  35. end
  36. t.up()
  37. t.dig()
  38. t.right()
  39. t.dig()
  40. t.down()
  41. t.left()
  42. turtle.select(torch)
  43. turtle.placeUp()
  44. end
  45. t.right()
  46. t.forward()
  47. t.digUp()
  48. t.right()
  49. for j=1, z do
  50. t.forward()
  51. if not turtle.detectDown() then
  52. turtle.select(cobblestone)
  53. turtle.placeDown()
  54. end
  55. t.digUp()
  56. end
  57. end
  58.  
  59. --Now he sends a message to a central computer
  60. modem.transmit(128, channel, "Minion "..os.getComputerLabel().." has finished a tunnel, Sir!")
Advertisement
Add Comment
Please, Sign In to add comment