Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("right")
- local miners = {}
- local loaders = {}
- local power = {}
- local fuelBosses = {}
- local tArgs = {...}
- function findTurtles()
- local gotMsg = true
- local id, msg, dist
- rednet.broadcast("checkIn")
- while gotMsg do
- id,msg,dist = rednet.receive(1)
- if msg == "Miner" then
- print(id..":"..msg)
- miners[#miners+1] = id
- elseif msg == "chunkloader" then
- print(id..":"..msg)
- loaders[#loaders+1] = id
- elseif msg == "power" then
- print(id..":"..msg)
- power[#power+1] = id
- elseif msg == "fuelBoss" then
- print(id..":"..msg)
- fuelBosses[#fuelBosses+1] = id
- miners[#miners+1] = id
- elseif msg == "Done" then
- else
- print("Done")
- gotMsg = false
- end
- end
- end
- function powerTurnleft()
- for x,y in pairs(power) do
- rednet.send(y, "powerTL")
- end
- end
- function minersTurnleft()
- for x,y in pairs(miners) do
- rednet.send(y, "minersTL")
- end
- end
- function fuelbossTurnleft()
- for x,y in pairs(fuelboss) do
- rednet.send(y, "minersTL")
- end
- end
- function loadersTurnleft()
- for x,y in pairs(loaders) do
- rednet.send(y,"chunkTL")
- end
- end
- function turnLeft()
- turtle.turnLeft()
- for i=1,7 do
- turtle.forward()
- end
- turtle.turnLeft()
- end
- turnTurtles()
- for i = 1,1 do
- powerTurnleft()
- sleep(5)
- minersTurnleft()
- sleep(5)
- fuelbossTurnleft()
- sleep(5)
- turnLeft()
- loadersTurnleft()
- end
Advertisement
Add Comment
Please, Sign In to add comment