Where can I see how many Robots are in my network?
Where can I see how many Robots are in my network?
Where can I see how many Logistics Robots and Construction Robots I've got in my network, in total?
Re: Where can I see how many Robots are in my network?
Mouse over a logistic chest, it will tell you how many robots in the same logistic network.
Koub - Please consider English is not my native language.
Re: Where can I see how many Robots are in my network?
That means:Koub wrote:Mouse over a logistic chest, it will tell you how many robots in the same logistic network.
- Any logistic robot
- Construction robots that currently have a job.
Read this carefully so you can understand that one can only know how many construction robots are there in a network by issuing a huge job (like destroying 2 chests full of stuff).
Re: Where can I see how many Robots are in my network?
I already did that. It showed me a figure of 50, which is suspiciously round, and also far lower than what I expected.Koub wrote:Mouse over a logistic chest, it will tell you how many robots in the same logistic network.
Re: Where can I see how many Robots are in my network?
Chances are you have some robots in a chest, or maybe you have picked some while removing a roboport that contained some, ...
Koub - Please consider English is not my native language.
-
- Manual Inserter
- Posts: 2
- Joined: Fri Apr 24, 2015 3:58 pm
- Contact:
Re: Where can I see how many Robots are in my network?
You can use these lua codes to get the "active" count of bots.
/c game.player.print(game.player.force.getentitycount("logistic-robot"))
/c game.player.print(game.player.force.getentitycount("construction-robot"))
These commands do not count the bots that are in storage/robo-ports.
Hope it helps
/c game.player.print(game.player.force.getentitycount("logistic-robot"))
/c game.player.print(game.player.force.getentitycount("construction-robot"))
These commands do not count the bots that are in storage/robo-ports.
Hope it helps
Re: Where can I see how many Robots are in my network?
If we're throwing lua at the problem, you can use this. It counts all active and inactive robots in the network, but misses the ones flying over gaps in coverage.
Code: Select all
/c robots = {};
roboports = {};
logistic = 0;
construction = 0;
recurse = function(r)
id = r.position.x .. "," .. r.position.y;
if (roboports[id] or r.force.name ~= game.player.force.name) then return end;
roboports[id] = true;
logistic = logistic + r.getinventory(1).getitemcount("logistic-robot");
construction = construction + r.getinventory(1).getitemcount("construction-robot");
ids = {};
for _, robot in ipairs(game.findentitiesfiltered{area={{r.position.x-50, r.position.y-50}, {r.position.x+50, r.position.y+50}}, name="construction-robot"}) do;
id = robot.position.x .. "," .. robot.position.y;
if ((ids[id] or not robots[id]) and robot.force.name == game.player.force.name) then;
construction = construction + 1;
ids[id] = true;
robots[id] = true;
end;
end;
for _, robot in ipairs(game.findentitiesfiltered{area={{r.position.x-50, r.position.y-50}, {r.position.x+50, r.position.y+50}}, name="logistic-robot"}) do;
id = robot.position.x .. "," .. robot.position.y;
if ((ids[id] or not robots[id]) and robot.force.name == game.player.force.name) then;
logistic = logistic + 1;
ids[id] = true;
robots[id] = true;
end;
end;
for _, roboport in ipairs(game.findentitiesfiltered{area={{r.position.x-48.5, r.position.y-48.5}, {r.position.x+48.5, r.position.y+48.5}}, name="roboport"}) do;
recurse(roboport);
end;
end;
p = game.player.character.position;
roboport = game.findentitiesfiltered{area={{p.x-48.5, p.y-48.5}, {p.x+48.5, p.y+48.5}}, name="roboport"}[1];
if (roboport) then;
recurse(roboport);
game.player.print("Robots in network: Construction:" .. construction .. " Logistic:" .. logistic);
else;
game.player.print("Not in range of a roboport.");
end
-
- Burner Inserter
- Posts: 7
- Joined: Thu May 21, 2015 7:29 pm
- Contact:
Re: Where can I see how many Robots are in my network?
This script was made by a streaming friend of mine to help out my stream goal of 1k bots per follower, the only thing this script doesnt include is bots held on inserters. Check out my stream at www.twitch.com/DeamonEngineer
All credit of this script is Loren1350
Code: Select all
/c
local ls,cs="logistic-robot","construction-robot";
local log,con = game.forces.player.getentitycount(ls),game.forces.player.getentitycount(cs);
for c in game.getchunks() do
for _,port in pairs(game.findentitiesfiltered{area={{c.x*32,c.y*32},{c.x*32+32,c.y*32+32}}}) do
con=con+port.getitemcount(cs);
log=log+port.getitemcount(ls) end end
for _,p in pairs(game.players) do p.print(con..cs..", "..log..ls) end