Computercraft thingies
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

floor.lua 512B

12345678910111213141516171819202122232425262728293031323334
  1. local args = {...}
  2. os.loadAPI("/lib/mturtle")
  3. local mx = tonumber(args[1])
  4. local mz = tonumber(args[2])
  5. local origin = mturtle.getPos()
  6. local placeFunc
  7. if args[3] == nil then
  8. placeFunc = function()
  9. mturtle.selectItem()
  10. turmle.placeDown()
  11. end
  12. else
  13. placeFunc = loadstring(args[3])
  14. end
  15. for x = 1, mx do
  16. for z = 1, mz - 1 do
  17. placeFunc()
  18. mturtle.forward()
  19. end
  20. if x < mx then
  21. placeFunc()
  22. mturtle.alterturn(x)
  23. mturtle.forward()
  24. mturtle.alterturn(x)
  25. end
  26. end
  27. placeFunc()
  28. mturtle.goTo(origin)