Content Patcher

Content Patcher

378k Downloads

[Automate] add option to ignore certain "machines"

DannyDaemonic opened this issue ยท 1 comments

commented

I happen to have a few trees near some automation groups and the fruit is being picked automatically. I like seeing the fruit on the trees and while I could cut down and replant the fruit trees to prevent it from happening, this isn't ideal. I've also noticed a few berries from bushes getting unintentionally stuffed into chests, and while that doesn't bother me, I could see how it could bother others as you miss out on your foraging bonuses.

An option to ignore things like this already exists for the Shipping Bin, where the AutomationFactory returns null for the shipping bin. Having an AutomateFruitTrees and AutomateBushes option would seem to be sufficient but other users might have different things they'd rather not have automated (or acting as a connector). Alternatively, an array setting similar to ConnectorNames could be used to pass in an array of items not to automate.

If a config option for a list of ignored machines is added, the shipping bin option could be removed. You would probably need a bit of code to migrate legacy settings similar to what's done with LookupAnything in LoadConfig but it'd be as simple as prepending "Shipping Bin" to the front of the array of ignored machines when there's an AutomateShippingBin setting of true. It looks like most of the work would be checking each machine name in the GetFor methods of AutomationFactory. I don't know the code well enough, but it may be easier to check the names in the MachineGroupFactory class after you have the IAutomatable object.

commented

Added in the upcoming Automate 1.18 using the new MachineOverrides field. Thanks for the suggestion!