How to know that a laboratory is working?
Posted: Thu May 25, 2017 12:34 pm
I'm working on a mod to calculate the utilization of various buildings. I mean to calculate how many percentage of the last minute the building was "working". I found no universal flag for this, even though the game animates the buildings while they are working (i.e. the factory shows some moving parts, the drills are moving, the furnaces making fire, the laboratories shows sparkles, etc).
Here is what i found so far:
- assembling machines are working if is_crafting() returns true. Easy.
- furnaces are working is is_crafting() and crafting_progress < 1.0. Is there an easier way? is_crafting() stays true when the furnace is full, that's why i need to check the progress.
- mining-drills do not have is_mining() so i compare the mining_progress with the previous one and if it's not the same then the mining drill is working. This also sounds a bit complicated, is there an easier way?
- but i could not find anything for labs. How can i check if a lab is working? I found no attributes to get the progress, even though the game shows a progress bar.
Thanks for any ideas.
Here is what i found so far:
- assembling machines are working if is_crafting() returns true. Easy.
- furnaces are working is is_crafting() and crafting_progress < 1.0. Is there an easier way? is_crafting() stays true when the furnace is full, that's why i need to check the progress.
- mining-drills do not have is_mining() so i compare the mining_progress with the previous one and if it's not the same then the mining drill is working. This also sounds a bit complicated, is there an easier way?
- but i could not find anything for labs. How can i check if a lab is working? I found no attributes to get the progress, even though the game shows a progress bar.
Thanks for any ideas.