Sivarias

CC_turtle_!excavate_(non-working)

Oct 14th, 2013
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. --!excavate
  2. --This clears a fully customizable area
  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. sleep(1)
  9. print("I dig layers 3 blocks high")
  10. print("How many layers am I digging?")
  11. z=tonumber(read())
  12. print("Left or Right from where I'm facing? (L/R)?")
  13. u=read()
  14. b=0
  15. print("How many blocks forward?")
  16. x=tonumber(read())-1
  17. print("How many blocks wide?")
  18. y=tonumber(read())
  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. if u=="L" or "l" then
  33. u=2
  34. elseif u=="R" or "r" then
  35. u=1
  36. else
  37. print("Incorrect input, restart and try again!")
  38. break
  39. end
  40. if (x*y*z+4*z)<=turtle.getFuelLevel() then
  41. modem.transmit(channel, 128, "Minion "..os.getComputerLabel().." has started strip mining!")
  42. v=1
  43. for j=1, y do
  44. for i=1, x do
  45. t.forward()
  46. t.digUp()
  47. t.digDown()
  48. end
  49. if turtle.getItemCount(16)~=0 then
  50. shell.run("ender")
  51. end
  52. if j==y then
  53. t.right()
  54. t.right()
  55. else
  56. if u==1 then
  57. t.right()
  58. t.forward()
  59. t.digUp()
  60. t.digDown()
  61. t.right()
  62. u=2
  63. elseif u==2 then
  64. t.left()
  65. t.forward()
  66. t.digUp()
  67. t.digDown()
  68. t.left()
  69. u=1
  70. end
  71. end
  72. modem.transmit(128, channel, "Minion "..os.getComputerLabel().." has finished layer "..j.." of "..z.." sir!")
  73. end
  74. else
  75. print("Not enough fuel Boss!, refuel me please!")
  76. end
  77. end
  78. for o=1, b, 1 do
  79. t.up()
  80. end
  81. modem.transmit(channel, 128, "Minion "..os.getComputerLabel().." has finished chunk stripping!")
Advertisement
Add Comment
Please, Sign In to add comment