Advertisement
Guest User

Untitled

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