Panakotta00 / FicsIt-Networks

Control, Monitor, Manage and Automate your Satisfactory.
https://ficsit.app/mod/FicsItNetworks
GNU General Public License v3.0
158 stars 51 forks source link

Feature Request: Access actual production rate #54

Closed SebastianHD closed 4 years ago

SebastianHD commented 4 years ago

I'm looking for a method to access the target production rate of a machine. Alternatively, I can calculate it from the clockspeed and recipe standard rate. Is there a way to automatically get the recipe rate? I did find recipe:getDuration(), but I would still need to know how many items are created for each cycle.

Panakotta00 commented 4 years ago

For the item amount per cycle you can just use the machines "getRecipe()" function and then read the products with the "getProducts()" function.

https://docs.ficsit.app/ficsit-networks/0.0.1/lua/api/Adapter.html#_recipe_getrecipe https://docs.ficsit.app/ficsit-networks/0.0.1/lua/api/Inventory.html#_itemcount_getproducts

you should then be able to use "getDuration()" of the recipe and "potential" of the machine to combine it to a item rate... I'm not 100% sure though

SebastianHD commented 4 years ago

Thanks for the quick response. Unfortunately, :getDuration()/.potential is just the same thing as .cycleTime. Well, actually, the .cycleTime (along with .productivity) fails to update sometimes, but that is a known game bug. 60/.cycleTime gives the cycle frequency [per min], but doesn't give the production rate. It needs to be multiplied by the number of items produced for each cycle.

Example: the .getDuration() for normal Quartz Crystal recipe is 8 seconds. 60/.getDuration() gives 7.5 per min, but the production rate is 22.5 per min, since it produces 3 for each cycle.

Panakotta00 commented 4 years ago

As said... you can get the amount of items per cycle by using the getRecipe() and getProducts() functions. Plz checkout the discord server for more discussion about that topic ^^