Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. local tArgs = {...}
  2. local height = tonumber(tArgs[1])
  3. local length = tonumber(tArgs[2])
  4. local up = true
  5. local slot = 1
  6.  
  7. turtle.select(slot)
  8.  
  9. for j = 1, length, 1 do
  10. for i = 1,height,1 do
  11.  
  12. if turtle.getItemCount(slot) == 0 then
  13. slot = slot + 1
  14. turtle.select(slot)
  15. local success, data = turtle.inspect()
  16. if not data.name ~= "minecraft:stone" or not data.name ~= "minecraft:glass" then
  17. turtle.dig()
  18. turtle.place()
  19. print("Block name: ", data.name)
  20. end
  21. else
  22. local success, data = turtle.inspect()
  23. if data.name ~= "minecraft:stone" or data.name ~= "minecraft:glass" then
  24. turtle.dig()
  25. turtle.place()
  26. print("Block name: ", data.name)
  27. end
  28. end
  29.  
  30. if i < height then
  31. if up == true then
  32. turtle.up()
  33. else
  34. turtle.down()
  35. end
  36.  
  37. else
  38.  
  39. if j < length then
  40. turtle.turnRight()
  41. turtle.forward()
  42. turtle.turnLeft()
  43. if up == false then
  44. up = true
  45. else
  46. up = false
  47. end
  48. else
  49. if up == true then
  50. for i = 1, height - 1, 1 do
  51. turtle.down()
  52. end
  53. end
  54. end
  55.  
  56. end
  57.  
  58. end
  59. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement