Advertisement
Guest User

Untitled

a guest
Feb 16th, 2019
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 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 = 0 end
  17. turtle.select(slot)
  18. end
  19. end
  20.  
  21. function select_material()
  22. take(b_def)
  23. end
  24.  
  25. function move_down()
  26. while not turtle.detectDown then
  27. turtle.down()
  28. end
  29.  
  30. function build_layer(width)
  31. turtle.up()
  32. for i = 1, 4 do
  33. for i = 0, width - 1 do
  34. turtle.forward()
  35. select_material()
  36. turtle.placeDown()
  37. end
  38. turtle.turnRight()
  39. end
  40. end
  41.  
  42. function build_rectangle(width, height)
  43. for i = 1, height do
  44. build_layer(width)
  45. end
  46. end
  47.  
  48. turtle.refuel()
  49. build_rectangle(width, height)
  50. move_down()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement