Jump to content

Chat extractor


Recommended Posts

Dear all,

I've made a little Python program which extracts the chat history of players from the mainlog.html. This gives you a record of who said what during the game and in the lobby. Even if you were a player, you can see the spectator chat using this.

All of the chat history, commands received and program outputs are contained within mainlog.html, but this file is very large and messy to read. This is why I made a program that is dedicated to extracting the chat part.

The future improvements will be automatically matching the player ID to the names so that it's more intuitive to read; it would also be possible to see at exactly when each message was sent / received.

To use the program, copy it to the same folder as your mainlog.html and run in console. An example output:

image.thumb.png.7d30bf9ebf1c1915908e67465c65141c.png

The /allies marker means the chat was sent to the sender's allies. Similarly for /observers. Lobby chats and game setup chats will be recorded as well:

image.thumb.png.40882e6097904b9ee7cea73771897321.png

 

Hope you like it!

Heli

  • Like 4
  • Thanks 2
Link to comment
Share on other sites

23 minutes ago, alre said:

remember that all lobby chat is available on discord. downloading it is also possible through external tools although not totally ok with the terms and conditions of discord.

I'm not a discord user. Are there other ways to access the lobby chat? Is it using some kind of open source chat client or is it scrambled to only compatible with 0AD clients?

3 hours ago, Yekaterina said:

Btw pls share your source code 

Sorry I forgot to attach the source code, I will post an upgraded version tonight.

Link to comment
Share on other sites

12 hours ago, Helicity said:

Dear all,

I've made a little Python program which extracts the chat history of players from the mainlog.html. This gives you a record of who said what during the game and in the lobby. Even if you were a player, you can see the spectator chat using this.

All of the chat history, commands received and program outputs are contained within mainlog.html, but this file is very large and messy to read. This is why I made a program that is dedicated to extracting the chat part.

The future improvements will be automatically matching the player ID to the names so that it's more intuitive to read; it would also be possible to see at exactly when each message was sent / received.

To use the program, copy it to the same folder as your mainlog.html and run in console. An example output:

image.thumb.png.7d30bf9ebf1c1915908e67465c65141c.png

The /allies marker means the chat was sent to the sender's allies. Similarly for /observers. Lobby chats and game setup chats will be recorded as well:

image.thumb.png.40882e6097904b9ee7cea73771897321.png

 

Hope you like it!

Heli

Another invention to read enemy chat?
as far as its /allies either enemy or your ally it will be logged 

Link to comment
Share on other sites

4 hours ago, alre said:

remember that all lobby chat is available on discord. downloading it is also possible through external tools although not totally ok with the terms and conditions of discord.

That's no longer the case. The bridge wasn't updated to A26 and eventually got shut donw.

  • Like 1
Link to comment
Share on other sites

13 minutes ago, Helicity said:

I am not sure how to do that, but it would be cheating!

i think it does on both sides. When enemy or your teammate uses /ally both the Net messages are logged so it's kind of literally reading enemy messages too. I'm not against the whole idea but telling you so incase you can make a patch around it before giving it out to everyone. Won't be fun to see enemies messages :) 

Link to comment
Share on other sites

On 20/03/2023 at 7:07 PM, Helicity said:

I've made a little Python program which extracts the chat history of players from the mainlog.html.

Thanks for releasing the source code for mainlog_extractor.py. What license do you choose for it? The FSF suggests using Apache License 2.0 for small programs.

I hope that players will have integrity and not use this to cheat during gameplay. And, I hope that people will use this program for good purposes like reporting in-game verbal abuse by others.

Edited by Norse_Harold
Link to comment
Share on other sites

Here's an independently developed chat extractor that by default displays only those chat messages that the logging player should be able to see. To use it, install python3, and copy 0adextract_chat.py to the logs directory within the 0ad user data directory. Start a Terminal or command prompt, change directory to the 0ad logs directory, and start the program with information about your lobby user name (and rating) by passing a command line argument. Here's a demonstration of how to start the program once you have changed directory to the 0ad logs directory. Replace "Helicity (1377)" with your lobby username and rating. If you have no rating then exclude the parentheses.

python3 0adextract_chat.py --player-name "Helicity (1377)"

After the match is finished, you can read all player chat with Helicity's mainlog_extractor.py script or by passing --show-all-chat to 0adextract_chat.py.

Please don't use this to cheat. There are many good purposes for this software, including reporting player misconduct, making links copyable to clipboard without using autociv, remembering cool or funny moments from past games, and saving songs generated by ChatGPT and pasted by Larsvandijk.

0adextract_chat.py

Edited by Norse_Harold
  • Like 3
Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...