Advertisement
Guest User

Untitled

a guest
Feb 16th, 2019
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. local width, height = ...
  2.  
  3. b_def = "minecraft:planks"
  4. b_win = "minecraft:glass_pane"
  5. b_spc = "minecraft:log"
  6.  
  7. function take(name)
  8. while true do
  9. item = turtle.getItemDetail()
  10. if item then
  11. if item.name == name then
  12. return true
  13. end
  14. end
  15. slot = turtle.getSelectedSlot() + 1
  16. if slot > 16 then slot = 1 end
  17. turtle.select(slot)
  18. end
  19. end
  20.  
  21. function select_material(index, edge)
  22. take(b_def)
  23. if (index % 2) == 0 then
  24. take(b_win)
  25. end
  26. end
  27.  
  28. function move_down()
  29. while not turtle.detectDown() do
  30. turtle.down()
  31. end
  32. end
  33.  
  34. function build_layer(width)
  35. turtle.up()
  36. for i = 1, 4 do
  37. for i = 0, width - 1 do
  38. turtle.forward()
  39. select_material(i, w)
  40. turtle.placeDown()
  41. end
  42. turtle.turnRight()
  43. end
  44. end
  45.  
  46. function build_rectangle(width, height)
  47. for i = 1, height do
  48. build_layer(width)
  49. end
  50. end
  51.  
  52. turtle.refuel()
  53. build_rectangle(width, height)
  54. move_down()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement