maxsupermanhd / FactoCord-3.0

Factorio bidirectional Discord bridge bot for Linux servers with control functionality.
Apache License 2.0
14 stars 10 forks source link

Modified control.lua to show the reason a player died in discord. #49

Closed credomane closed 1 year ago

credomane commented 1 year ago

The topic came up a few hours on the discord of the Factorio server I play on to have death messages included in the reason a person died. So I poked around and modified the control.lua file included with FactoCord to do so. Everything functions without errors in SP and a client-hosted server but since I haven't tested with FactoCord+headless I can't be positive it works as intended.

Now death messages sent to discord will be 0000-00-00 00:00:00 [DISCORD] **credomane** died to a Small biter. when possible instead of always being 0000-00-00 00:00:00 [DISCORD] **credomane** has died.

Galapagon commented 1 year ago

I've modified the control.lua in my ...ahem test environment and will update the results of testing.

Galapagon commented 1 year ago

Seems to unfortunately only cause "Table" to be shown in the logs, breaks discord integration.

credomane commented 1 year ago

Yeah....our testing didn't go so well. Seems the lua function of print doesn't process localised_strings and just prints "table" while all the different ways of Factorio added ways of printing things do. So much for easy. Back to the drawing board.

credomane commented 1 year ago

I haven't tested it with @Galapagon on his server running FactoCord, yet. However, I did test it on a locally hosted headless server and it looks like it is working fine.

image

credomane commented 1 year ago

Galapagon and I did some testing. It works! image