Sivarias

CC_turtle_!chunk

Oct 10th, 2013
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. --!chunk
  2. --This is a customizable chunk by layer where the number of layers is customizable
  3. print("This code clears a customizable room that is one block above and below the turtle")
  4. print("I need an enderchest in slot one")
  5. sleep(1)
  6. print("")
  7. print("I dig down boss")
  8. print("I dig layers 3 blocks high")
  9. print("How many layers am I digging?")
  10. z=tonumber(read())
  11. print("Left or Right from where I'm facing? (L/R)?")
  12. u=read()
  13. b=0
  14. k=1
  15. j=1
  16. if (64*z+8*z)<=turtle.getFuelLevel() then
  17. modem.transmit(channel, 128, "Minion "..os.getComputerLabel().." has started strip mining!")
  18. v=1
  19. for k=1, z, 1 do
  20. if k==1 then
  21. t.down()
  22. t.down()
  23. t.digDown()
  24. b=b+2
  25. else
  26. t.down()
  27. t.down()
  28. t.down()
  29. t.digDown()
  30. b=b+3
  31. end
  32. y=16
  33. x=15
  34. if u=="L" then
  35. u=2
  36. elseif u=="R" then
  37. u=1
  38. else
  39. print("Incorrect input, restart and try again!")
  40. end
  41. for j=1, y do
  42. for i=1, x do
  43. t.forward()
  44. t.digUp()
  45. t.digDown()
  46. end
  47. if turtle.getItemCount(16)~=0 then
  48. shell.run("ender")
  49. end
  50. if j==y then
  51. t.right()
  52. t.right()
  53. else
  54. if u==1 then
  55. t.right()
  56. t.forward()
  57. t.digUp()
  58. t.digDown()
  59. t.right()
  60. u=2
  61. elseif u==2 then
  62. t.left()
  63. t.forward()
  64. t.digUp()
  65. t.digDown()
  66. t.left()
  67. u=1
  68. end
  69. end
  70. end
  71. end
  72. modem.transmit(128, channel, "Minion "..os.getComputerLabel().." has finished layer "..k.." of "..z.." sir!")
  73. else
  74. print("Not enough fuel Boss!, refuel me please!")
  75. end
  76. for o=1, b, 1 do
  77. t.up()
  78. end
  79. modem.transmit(channel, 128, "Minion "..os.getComputerLabel().." has finished chunk stripping!")
Advertisement
Add Comment
Please, Sign In to add comment