Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Advertisement Create a free account

Capturing Chat Log message and saving them for later review

1637402426
Here is what I am trying to do.  I'm going to start running "tournaments" in my homebrew setting.  The city where we are adventuring has a long standing tradition of regular tournaments (think something Rome).  So much so that the most popular competitors gain celebrity like status.  What I want to do is to be able to create "Trading Cards" for my players PC's as they compete in the tournaments. So I would like to be able to capture any players roll from the chat and "save" it somewhere I can easily get it (in an easy to parsed form) so I can create stats for the back of the trading cards. Any thoughts?
1637405647
Slowglass
Pro
API Scripter
Is the Chat Archive not sufficient. You have the entire chat of the game and it is easy to copy and paste stuff from it Go to Game page and select "Chat Archive" from the "Content" dropdown
1637649707
I am looking at the chat archive, but it contains SO much other data (the file I saved was over 100K in size) and that is a LOT of data to look through.  I was hoping there would be a way to just capture the various templates (using 5e sheet) to avoid all other noise.
1637679783
I regularly clear my chat archive (pretty much after each game) because I've had it become corrupted before (which can mess up your game until you clear it).  So what I do is go into the external chat archive after the game, make sure I have clicked "Show on one page", then right-click and 'save as'.  Then I can go back to any previous session that I want if I need to reference something specific.  It gets saved as a basic local html page, so you could search through it if needed, but that will still take a bit of time; or you can take screenshots from it as well. If you're looking for more of an ongoing tracking or calculation of stats (how many times did a character hit, how much damage, etc.) that would either require a custom script in game, or for you to go back through whatever chat archive you have and parse through it.  I haven't heard of anyone else who has done something similar and has a solution already made for this.
1637702183
Oosh
Sheet Author
You can look in this thread for some ideas.The mutation observer at the top could be run in your browser console to grab HTML as it's posted to chat, decide whether to keep it or not based on the template <div>, and push it to an array. Or you can write an API script to log() the rolls you're interested in, and use the Ace method further down to grab those from the API log. In both cases, you'll need a method of pushing that data to your own server or other script. Or you can manually save it from the browser periodically (this needs manual intervention through, browser security prevents automatic access to your local file system). Alternatively, you can just post-process the chat archive. Write a Node script to scrub the JS and CSS, then split the HTML into an array of posts, and filter out the ones you don't want. This will require some fine regex surgery and will need to be hand-written for each roll template's data. I would highly recommend the API log method, as it's by far the cleanest data output. The HTML doesn't contain all the roll info, and isolating reliable numbers from the roll templates is annoyingly specific work - your code won't be reusable for anything else, really.
1637877585
I would live to use the Chat Archive, but when I try to clear it -- it doesn't clear.  I still see the same things every time.
1637877938
GiGs
Pro
Sheet Author
API Scripter
Are you clearing it from inside a game, or from the campaign launch game before you start a game? The first method is just to clear up the chat form while you are playing, but doesnt touch the actual chat data so it is restored on a refresh. The second method does delete actual data permanently. If you're using the second method and your chat log isnt clearing, that's a problem because if the chat log gets too big you might find your campaign unusuable. You should take it up with roll20 support.
1637878734
I'm using the 2nd method