Auto Trash


Allows saving of different logistic request setups Enable autotrash only in certain logistic networks Load your spidertron with different setups with a single click Load one or more preset after respawning Trash unrequested items

Content
3 years ago
0.13 - 1.1
37.9K
Logistic network

b [solved]"Item stack count has to a be positive number" error

5 years ago
(updated 5 years ago)

Putting aside a typo in the error message, I just installed the mod. I had some logistic requests set to 0, so that I can adjust a slider easily when I need it, without having to look for an item. However, when I clicked "Save" in "Logistics configuration" I got the following error:

Item stack count has to a be positive number
stack traceback:
AutoTrash/gui.lua:30: in function 'set_requests'
AutoTrash/gui.lua:528: in function 'save_changes'
AutoTrash/control.lua:563: in function <AutoTrash/control.lua:544>
[C]: in function 'pcall'
AutoTrash/gui.lua:544: in function <AutoTrash/control.lua:543>

I understand what's wrong and why I got the error, but I think it should be handled better. Is it possible to avoid printing the stack trace? Even better would be to actually ignore those requests that are set to 0 or simply save them, as all the other requests (which is what the base game allows).

5 years ago
(updated 5 years ago)

That is actually a Factorio bug (and typo) in the modding API. (I'll post a report)
If you can set a request to 0 in the UI you should be able to do so via the API call too.

The latest AutoTrash update will just clear the corresponding slot. I'm aware that's also inconsistent with the base game but my code is so old that is the quickest fix without me getting paranoid about breaking something :D

5 years ago

Fair enough :)

You don't have to tell me about issues with modding API... I have just updated one of my mods - changelog: "Removed workarounds for fixed bugs. Added workarounds for introduced bugs."

New response