Advertisement
feedmecookies

Blockhouse maker

Feb 25th, 2022
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. function clear(text)
  2. term.clear()
  3. term.setCursorPos(1,1)
  4. term.write(text)
  5. term.setCursorPos(1,2)
  6. end
  7.  
  8. clear("Enter the Width of the house")
  9. width = tonumber(read())
  10. clear("Enter the Height of the house")
  11. height = tonumber(read())
  12. blocks = height*width*4+(height*4)
  13. turtle.select(1)
  14. while blocks ~= 0 do
  15. if blocks >= 64 then
  16. turtle.suckDown(64)
  17. blocks = blocks-64
  18. turtle.select(turtle.getSelectedSlot()+1)
  19. else
  20. turtle.suckDown(blocks)
  21. blocks = 0
  22. turtle.select(1)
  23. end
  24.  
  25. end
  26. turtle.forward()
  27.  
  28. for i = 1, height do
  29. for n = 0, 3 do
  30. for t = 0, width do
  31. turtle.forward()
  32. if turtle.getItemCount(turtle.getSelectedSlot()) == 0 then
  33. turtle.select(turtle.getSelectedSlot()+1)
  34. end
  35. turtle.placeDown()
  36. end
  37. turtle.turnRight()
  38. end
  39. turtle.up()
  40. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement