Accessing chat history locally for custom display hardware

How, what and why to code in BYOND.
Post Reply
pewdiepieofficial
Joined: Mon Nov 20, 2023 5:26 pm
Byond Username: Pewdiepieofficial2

Accessing chat history locally for custom display hardware

Post by pewdiepieofficial » #712133

Hey all, long time player first time poster. I've been wanting to get back into SS13 after a couple years hiatus and also exercise my programming muscles a bit with a dumb side project. I've been running into a brick wall and I'm hoping I can get some insight from the community.

I've been attempting to find a way to access the messages from the chat window in real time to feed to a python script that will drive an external display of some sort, maybe an LED matrix or a receipt printer or something, but so far I've had no luck. I'm not new to programming by any means but most of my experience is along the lines of embedded systems and using python for data science-y things. I don't really have any specific goal I'm trying to accomplish with this, just have some fun messing around with hardware odds and ends I have laying around during some free time.

I figure the messages must be cached locally somewhere, since I can exit a game a reload it and the messages reappear, but I cannot for the life of me figure out how the system works. So far I've tried searching through the files under Documents/BYOND/cache and capturing network traffic to/from the game using Wireshark but nothing I've seen so far looks anything like a chat messages. Another avenue I tried is looking into the code behind the "Save chat log" button, which seems to indicate that there is a JavaScript class called ChatRenderer that stores the messages, but I'm not sure if this is accessible to the user at all or how I would go about doing that. I guess worst case scenario I can take screen captures of the chat portion of the window and run OCR on it, but that seems rather clunky.

I will say that looking through the tgstation codebase has given me a new appreciation of the work that went into this game. The number of moving parts almost overwhelming.

Please move this post if it doesn't belong here. I'm new to the forum and this seemed like a good starting point.
User avatar
oranges
Code Maintainer
Joined: Tue Apr 15, 2014 9:16 pm
Byond Username: Optimumtact
Github Username: optimumtact
Location: #CHATSHITGETBANGED

Re: Accessing chat history locally for custom display hardware

Post by oranges » #712184

they're stored in internet explorers local storage
Post Reply

Who is online

Users browsing this forum: No registered users