Control ARGB fans on biter attack

Place to get help with not working mods / modding interface.
borgiedude
Burner Inserter
Burner Inserter
Posts: 10
Joined: Fri Sep 22, 2023 10:01 pm
Contact:

Control ARGB fans on biter attack

Post 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.
borgiedude
Burner Inserter
Burner Inserter
Posts: 10
Joined: Fri Sep 22, 2023 10:01 pm
Contact:

Re: Control ARGB fans on biter attack

Post 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.
User avatar
Silari
Filter Inserter
Filter Inserter
Posts: 531
Joined: Sat Jan 27, 2018 10:04 pm
Contact:

Re: Control ARGB fans on biter attack

Post 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.
sparr
Smart Inserter
Smart Inserter
Posts: 1444
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: Control ARGB fans on biter attack

Post 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.
borgiedude
Burner Inserter
Burner Inserter
Posts: 10
Joined: Fri Sep 22, 2023 10:01 pm
Contact:

Re: Control ARGB fans on biter attack

Post 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.
borgiedude
Burner Inserter
Burner Inserter
Posts: 10
Joined: Fri Sep 22, 2023 10:01 pm
Contact:

Re: Control ARGB fans on biter attack

Post 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
Post Reply

Return to “Modding help”