Discord <-> Factorio Chat Utilities deprecated

by Rsslone

Allows cross communication between Discord chat and Factorio chat. WOW!

Utilities
3 years ago
0.17 - 1.1
133

g Server crashes - Soltion:

4 years ago
(updated 4 years ago)

Hello,

If you type something other than "/" commands into the server console the server crashes, because the on_console_chat event object doesn't contain a player_index when the chat message comes from the server console.

The solution:

script.on_event(defines.events.on_console_chat, function(event)
    game.write_file("ChatLog.log","\r\n[" .. (event.player_index and game.players[event.player_index].name or "Server") .. "]" .. event.message, false, 0)
  end)

Also, note the ", 0" at the end of the function! No need to save the log files on the clients as well. Only on the server is sufficient.

Chris

P.S.: I even went a step further and just copied the four event handlers from your control.lua directly into the control.lua of the savegame. No need for my clients to dowload an additional mod ;-)

3 years ago

Oh nice I'll implement this. I'm not a very good programmer and this was duct tapped together for something to do one afternoon, so any interest in it is amazing to me lol.

Cheers.

New response