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 .
×
Create a free account

Chat Parsing To Handouts

I know this has been discussed to some degree and there are some hurdles but I am looking for scripting that might solve what I am trying to do for my players The Issue:  Too much clutter in the chat The Goal:  Have commands that move chat to handouts so they don't show up in chat at all including a handout for combat rolls, OOC chat, emoted chat, etc What this would look like: Player types API command  plus handout tag and the chat is grabbed and placed in that handout ..  Example.  Chat-OOC I will see you later >> would add "I will see you later" to the OOC chat while Chat-Combat /roll 1d20+8 >> places this roll result in the combat chat.  Or even better a button when you roll a macro from the sheet it prompts "which handout do you want to send this to?" We are doing a significant amount of rp in the chat and also rolling / commenting in different conversations but it gets very crowded and hard to organize what is what. I have seen NoteLog (By Aaron) and this allows me to set up something to send information to handouts for each script i run with a different handout name and changing the command name.  The limitation here seems to be that I can't /roll into it or /e into it or pull a conversation as xyz into it.  I can copy paste the results of something into it but that doesn't fix the chat issue really.   Are there any good chat parsing API scripts out there already?  How hard is this to program?  Is this currently under development?
1594744144
The Aaron
Roll20 Production Team
API Scripter
I'm not aware of any specialized scripts. NoteLog is about as close as it gets.  The difficulty, outside getting players to use it correctly, would be getting other things, like character sheet rolls, into it. Other API scripts targeting it would also be a challenge. There is also the problem of updating the handout efficiently (at one time there was an artificial system put in place to prevent rapid updates to handouts for performance reasons, not sure it's still active).  I'm not aware of any active development on such a system. I can envision what it would be like, and if you just wanted to handle chat, that wouldn't be too difficult to create an MVP of. You could even set something up that harvested chat messages and placed them in a default handout archive, possibly with the ability to move them. 
What I did was create a separate game called Player Journal and that way I can use it to transmogrophy characters in for the purposes of chat as since I can get two separate chat windows that way but this requires all players to run two games at once.  Ideally I could parse combat rolls to one chat window, ic to another, OOC to a third and so forth.  Is there a way to grab all chat .. look for keywords and then spit them out in separate chat windows with API programming?  I used to MUD ( a long time ago) and used a program called TinTin to do this for me.
1594824947
The Aaron
Roll20 Production Team
API Scripter
The issue is that by the time the API sees a chat message, it's already in chat.  Even if they could get the message before it's posted to chat, they have no facility for preventing it from being posted.  Probably using a third party chatting program to segregate various chat streams would be easier. But then you wouldn't have access to macros and scripts.   I guess it's suggestion time...
1594837137

Edited 1594837310
timmaugh
Forum Champion
API Scripter
Is there a way to (in order) declare an alias for the built-in sendChat function and then mask that original sendChat with a new one? Meaning if you declared: const origChat = ... // <== where the magic would have to happen and then declared: const sendChat = (sendAs = "", msg = "", toHo = "" ) => {     if (toHo) {         /*... send msg to designated handout... */     } else {         origChat(sendAs, msg);     } }; ... then built-in calls to the chat would go to chat, as per usual, and anything you wanted to redirect to a handout would instead go to the name you fed to the handout. You'd have to have a script that would implement this: !myfancyscript --ho#OOC-Chat --msg#I need a break from kicking so many butts at once. BRB ...which would call our new sendChat with the appropriate argument in the toHo parameter. The great trick of the whole thing is being able to maintain a reference to the original sendChat function even when you override it... not sure that can even be done... but maybe Aaron or another expert could answer that part. If you could do that, then maybe the OP's problem could be solved.
1594840416
The Aaron
Roll20 Production Team
API Scripter
That half works.  You can shadow the real sendChat() with a fake sendChat(), and it absolutely will get all calls to sendChat.  Unfortunately, you can't capture a reference to the real sendChat(), so there'd be no going back.
could you just keep the "Master Chat" but use the clone to analyze the results of the copy chat and send those to the handouts and then you could keep your Master chat just closed and use it for reference?  Could you take the chat "reports" after the chat decides what they will look like and then turn them into handout reports.  I realize this might lose formatting and stuff because the handouts don't understand that .. but .. could it take it as a picture and send it to the handout as a picture? Also .. what is the hurdle of changing the chat display to multiple chat displays in roll20 as an option?  like other chat tabs that could be used and popped out?  people could use the main chat by default and then use the tab for the second chat option if they need it.  I mean there is a journal tab and a jukebox tab and a macro tab and a compendium tab so why not a chat2 tab with its own separate input and output?
1594841361
The Aaron
Roll20 Production Team
API Scripter
For the API, there are a few options: 1) Have all scripts buy-in by calling an output function other than sendChat() which can be directed where desired 2) Force scripts to use a different sendChat() function by "bookending" all other scripts in a scope with its own sendChat() replacement. As for updating the user interface to have multiple chat areas, that's a question for Roll20.  The answer would likely be "that's a great idea, make a suggestion for it."  Speculation as to the technical side of doing it is that it would be a very large system to manage what goes where, with sweeping implications to anything that has the capability to put something in the chat.
1594842313
timmaugh
Forum Champion
API Scripter
As I made the mistake (comically) at one point, I hadn't limited a script to listen for only an API call and for its own handle... so it ran with every chat. Oops. But you could maybe use this to your advantage... *if* you could tell, after the fact, what should go where. I *think* you could blunt-force it by maintaining a library of { apiHandle: handoutName } and/or some combination of { msgTextIdentifier: handoutName } to direct the scraped content to the appropriate handout (if one was identified)... the outcome being that *everything* would go to the chat, as per usual, and anything that you could detect another location for would *also* go to the handout.
1594842534
The Aaron
Roll20 Production Team
API Scripter
Yeah, that would be a much easier approach. 
Yeah .. that could work so if you put OOC anywhere (end or beginning) of what you say it will remove the OOC tag and bump it into the OOC folder as the next line of communication in there.  You could in essence leave the chat closed and your handouts open .. Best solution so far I found is running a second game and using it for speak as and doing rolling in the main game chat.  At least the rolls don't clutter up the in game conversation anymore.  And that window is re sizable and movable so players can customize it.  It would be nicer to have a second chat pop out in game.  I'm tempted to make a 3rd game for just OOC stuff .. that means all my players are running 3 roll20 games simultaneously to play one game.  Seems like it would tax roll 20 less to create customized chat tabs. I understand its not so simple as just popping in a few lines of code.  Obviously they are very busy.  Over the years I have seem the game improve and improve and improve some more so Kudos to the team!