BrineUtil

Untitled

Feb 22nd, 2021
433
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. local args = { ... }
  2. local startSlot = tonumber(args[1])
  3. local turtleCount = tonumber(args[2])
  4.  
  5. os.loadAPI("QuarryUtils.lua")
  6. os.loadAPI("WorkerBuild.lua")
  7.  
  8. shell.run("gen.lua")
  9. local partSize = math.ceil(#map / gen.partCount)
  10.  
  11. rednet.open("left")
  12.  
  13. _G.pieces = {}
  14.  
  15. for i=0,turtleCount-1 do
  16. turtle.select(i + startSlot)
  17. turtle.place()
  18. peripheral.call("front","turnOn")
  19. sleep(1/10)
  20. rednet.broadcast(QuarryUtils, "QuarryUtils")
  21. id, message, protocol = rednet.receive("QuarryDone")
  22. local mapPart = {}
  23. for i = i*partSize + 1, math.min(#map, (i+1) * partSize) do
  24. table.insert(mapPart, map[i])
  25. end
  26. _G.pieces[i] = mapPart
  27.  
  28. rednet.broadcast(
  29. {
  30. grassHeight = gen.grassHeight,
  31. vOffset = gen.vOffset,
  32. hOffset = #map - i*partSize,
  33. map = mapPart,
  34. build = WorkerBuild.build
  35. },
  36. "QuarryOptions"
  37. )
  38. end
Advertisement
Add Comment
Please, Sign In to add comment