How to Use Optional Parameters
Posted: Tue May 15, 2018 1:17 pm
According to the docs I should be able to call LuaLogisticNetwork.get_item_count(item, member). Item and member are both optional string parameters. I only want to pass a member parameter to the function (i.e. I want a total item count but only from storage chests). I don't know how to do this. If I don't pass the item parameter it thinks the member parameter is the item parameter (because im only passing one parameter) and tries to get me an item count for "storage", which isn't a valid item and so it returns an error. If I pass an empty string, a nil value or anything that isn't a valid item it returns an error.
How can I run this function but only pass the member parameter?
How can I run this function but only pass the member parameter?