I suggest instead of creating variables for for the totals, supply the robot type instead of the variable name. This doesn't come into play in vanilla factorio, but it's very useful for extensibility and mods. Some mods add upgraded logistics and construction robots and it would be great if once the upgraded robots are produced, there can be an automated way to swap them out. This can be done with the newly introduced feature if it provides the types of robots instead of variables like "T". Ie. it would say "Construction Bot MK1" and "Construction Bot Mk2" etc.
Another key feature needed would be that when an inserter next to a roboport wants to remove a robot, that one is requested to fly to that roboport. This is important because the inserters might never actually remove any robots if they never land at that roboport in a large network. This feature might be tricky with the current implementation of factorio depending on how it was designed, so if this isn't possible, a very acceptable workaround is to add the ability to request certain robot types to always come land at a certain roboport in a certain quantity. In other words say at a roboport hooked up to the circuit network that 10 Logistics MK1, 10 Logistics MK2, 10 Construction MK1, and 10 Construction MK2 robots should always land here. This way the inserters removing the old robots would always be guaranteed to be able to do so. I think this system would fit very well into the current design of the game because landing at a roboport could be considered a job just like repairing an entity or picking up and delivering goods. Once landed, the robots could stay permanently or for a miniumum of say 5 seconds, to give the inserter time to remove them.
Having these two closely related features would really allow automation of roboport robots and I would really like it if this was implemented. After all, this game is about automation and modding, and this area could use some improvement.
In summary the two features required are:
- allow reading total robots in network by type instead of variables. So "Construstion Bot MK1", "Construstion Bot MK2", "Logistics Bot MK1", "Logistics Bot MK2" instead of "Y" and "T" for the total robots.
- request robots to fly to a roboport when an inserter wants to remove them or allow setting a number of each type of robot (including ones added by mods) to land at a roboport indefinitely or for 5-10 seconds minimum