Advertisement
Kukuta

LOL

Jan 18th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. print("I need a width!")
  2. local width = read()
  3. width = width + 0
  4. print("I need a height!")
  5. local height = read()
  6. height = height + 0
  7. xoff = 0
  8. yoff = 0
  9. n = 1
  10.  
  11. function Slice(wh,ht)
  12. for j = 1, wh do
  13. column(ht)
  14. if n % 2 == 1 then
  15. turtle.turnLeft()
  16. turtle.dig()
  17. turtle.forward()
  18. turtle.turnLeft()
  19. n = n + 1
  20. else
  21. turtle.turnRight()
  22. turtle.dig()
  23. turtle.forward()
  24. turtle.turnRight()
  25. n = n + 1
  26. end
  27. end
  28. end
  29.  
  30. function column(ht)
  31. for i = 1, ht do
  32. turtle.digDown()
  33. if i < ht then
  34. turtle.dig()
  35. turtle.forward()
  36. end
  37. end
  38. end
  39.  
  40. function getBack()
  41. turtle.turnLeft()
  42.  
  43. for i = 1, width do
  44. turtle.dig()
  45. turtle.forward()
  46. end
  47.  
  48. turtle.turnRight()
  49. for j = 1, height - 1 do
  50. turtle.dig()
  51. turtle.forward()
  52. end
  53. turtle.turnLeft()
  54. turtle.turnLeft()
  55. end
  56.  
  57. function emptyInventory()
  58. local xd = 0
  59. turtle.turnLeft()
  60. turtle.turnLeft()
  61. succes,data = turtle.inspect()
  62. while data.name ~= "minecraft:chest" do
  63. turtle.up()
  64. xd = xd + 1
  65. succes,data = turtle.inspect()
  66. end
  67.  
  68. for k = 1, 16 do
  69. turtle.select(k)
  70. turtle.drop()
  71. end
  72.  
  73. turtle.turnLeft()
  74. turtle.turnLeft()
  75. turtle.select(1)
  76. for l = 1 , xd do
  77. turtle.down()
  78. end
  79. end
  80.  
  81.  
  82.  
  83.  
  84. while true do
  85. if turtle.getItemCount(16) > 0 then
  86. emptyInventory()
  87. end
  88. Slice(width,height)
  89. getBack()
  90. turtle.down()
  91. n = 1
  92. end
  93. print("yoff:")
  94. print(yoff)
  95. print("xoff:")
  96. print(xoff)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement