Advertisement
mauza

TowerBuilder

Jun 6th, 2021 (edited)
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. function place()
  2. slot = turtle.getSelectedSlot()
  3. slot_count = turtle.getItemCount()
  4. if slot_count == 0 then
  5. slot = slot + 1
  6. if slot == 17 then
  7. print("You are out of building material")
  8. os.exit()
  9. end
  10. turtle.select(slot)
  11. end
  12. turtle.placeDown()
  13. end
  14.  
  15. local args = { ... }
  16.  
  17. l = args[1]
  18. w = args[2]
  19. h = args[3]
  20.  
  21. for z = 1, h, 1 do
  22. turtle.up()
  23. place()
  24. for x = 1, l, 1 do
  25. turtle.forward()
  26. place()
  27. end
  28. turtle.turnLeft()
  29. for y = 1, w, 1 do
  30. turtle.forward()
  31. place()
  32. end
  33. turtle.turnLeft()
  34. for x = 1, l, 1 do
  35. turtle.forward()
  36. place()
  37. end
  38. turtle.turnLeft()
  39. for y = 1, w, 1 do
  40. turtle.forward()
  41. place()
  42. end
  43. turtle.turnLeft()
  44. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement