mod communicating with the outside world
Posted: Wed Nov 22, 2023 10:59 am
hello!
first thing first, my english is broken, i'll do my best (sorry in advance)
so! i'd love to make a mod that allow you to monitor and manage you factory through your phone via an app, by this i mean:
- read/write in the chat
- kick/ban/mute/promote player (if admin)
- see progression of and be able to change current research
- manage trains (modify their schedule)
- activate/deactivate interruptors
- save/save and quit the game
- see electric network / production and consumption state
- send a notification when bitters attack / there is a power outage / a research is finished / a rocket is launched
all of thoses thing are not really a problem, the problem is (like the title said) communicating with outside...
so i've started by looking for the Lua socket module and of course it doesn't work with factorio that have it's very own Lua implementation so HTTP request isn't an option too... (wich seems to make people really mad really quick on the forum for some reasons), after that i've come across this article https://medium.com/expected-behavior/in ... 5d63fecdd0 that's one step! now i have a (pretty terrible) way to extract data from factorio to the outside world, next thing is to import commands from the outside world into factorio, some research later i've find two things:
- factorio implement RCon (Remote Console) wich look pretty easy to access https://pypi.org/project/factorio-rcon-py/
- clusterio mod exist
so here are my questions: can we add custom commands to RCon via mod ? can clusterio help me with what i want to achieve ? or is there an easier way than what i've found to make factorio communicate with outside ?
thanks in advance, have a good day!
first thing first, my english is broken, i'll do my best (sorry in advance)
so! i'd love to make a mod that allow you to monitor and manage you factory through your phone via an app, by this i mean:
- read/write in the chat
- kick/ban/mute/promote player (if admin)
- see progression of and be able to change current research
- manage trains (modify their schedule)
- activate/deactivate interruptors
- save/save and quit the game
- see electric network / production and consumption state
- send a notification when bitters attack / there is a power outage / a research is finished / a rocket is launched
all of thoses thing are not really a problem, the problem is (like the title said) communicating with outside...
so i've started by looking for the Lua socket module and of course it doesn't work with factorio that have it's very own Lua implementation so HTTP request isn't an option too... (wich seems to make people really mad really quick on the forum for some reasons), after that i've come across this article https://medium.com/expected-behavior/in ... 5d63fecdd0 that's one step! now i have a (pretty terrible) way to extract data from factorio to the outside world, next thing is to import commands from the outside world into factorio, some research later i've find two things:
- factorio implement RCon (Remote Console) wich look pretty easy to access https://pypi.org/project/factorio-rcon-py/
- clusterio mod exist
so here are my questions: can we add custom commands to RCon via mod ? can clusterio help me with what i want to achieve ? or is there an easier way than what i've found to make factorio communicate with outside ?
thanks in advance, have a good day!