Page 1 of 1

Control ARGB fans on biter attack

Posted: Fri Oct 11, 2024 4:59 am
by borgiedude
I'm looking for a way to make my ARGB fans flash red when the on_entity_destroyed() event fires.
My ARGB software can link to a batch file, but factorio lua mods cannot execute batch files for mod safety reasons.
I'm wondering if anyone has suggestions for how I might get the ARGB software (Cooler Master's Master+) to talk to Factorio and know when on_entity_destroyed() is occurring.

Re: Control ARGB fans on biter attack

Posted: Sat Oct 12, 2024 3:55 am
by borgiedude
So I'm now thinking I can write a Python script to look for the red warning icon and trigger a batch file from that to control the ARGB. I'll post progress if I make it work.

Re: Control ARGB fans on biter attack

Posted: Sat Oct 12, 2024 3:09 pm
by Silari
Probably easier to use a mod in the game to log when the alert warning occurs, and have something monitor the factorio log for new lines and trigger the batch file if it sees that line appear. Does require a mod in-game though.

Re: Control ARGB fans on biter attack

Posted: Sat Oct 12, 2024 6:04 pm
by sparr
Mods writing to the log file and then a process outside the game reading the log file is a common approach for something like this.

Re: Control ARGB fans on biter attack

Posted: Sat Oct 12, 2024 9:30 pm
by borgiedude
Thank you for the suggestions, I'll try both approaches and see what works best. I like the idea of not needing to mod the game so I can still get steam achievements and have it work on online servers, but I see that writing to a log file would be a much more reliable way of achieving this result.

Re: Control ARGB fans on biter attack

Posted: Thu Oct 17, 2024 11:34 am
by borgiedude
For anyone browsing the internet looking for something like this, I'll post a github link to a python library where I've hacked together something that works using pyautogui to monitor the Factorio UI and click on a program in the background (the argb controller) to make changes. I hope it is of use to someone.

https://github.com/borgiedude/FactorioA ... Controller