Advertisement
Guest User

Untitled

a guest
Feb 16th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 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 build_layer(width)
  26. turtle.up()
  27. for i = 1, 4 do
  28. for i = 0, width - 1 do
  29. turtle.forward()
  30. turtle.placeDown()
  31. end
  32. turtle.turnRight()
  33. end
  34. end
  35.  
  36. function build_rectangle(width, height)
  37. for i = 1, height do
  38. build_layer(width)
  39. end
  40. end
  41.  
  42. turtle.refuel()
  43. build_rectangle(width, height)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement