Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = { ... }
- local startSlot = tonumber(args[1])
- local turtleCount = tonumber(args[2])
- os.loadAPI("QuarryUtils.lua")
- os.loadAPI("WorkerBuild.lua")
- shell.run("gen.lua")
- local partSize = math.ceil(#map / gen.partCount)
- rednet.open("left")
- _G.pieces = {}
- for i=0,turtleCount-1 do
- turtle.select(i + startSlot)
- turtle.place()
- peripheral.call("front","turnOn")
- sleep(1/10)
- rednet.broadcast(QuarryUtils, "QuarryUtils")
- id, message, protocol = rednet.receive("QuarryDone")
- local mapPart = {}
- for i = i*partSize + 1, math.min(#map, (i+1) * partSize) do
- table.insert(mapPart, map[i])
- end
- _G.pieces[i] = mapPart
- rednet.broadcast(
- {
- grassHeight = gen.grassHeight,
- vOffset = gen.vOffset,
- hOffset = #map - i*partSize,
- map = mapPart,
- build = WorkerBuild.build
- },
- "QuarryOptions"
- )
- end
Advertisement
Add Comment
Please, Sign In to add comment