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

Twitch Chat: Alternative to selecting a token through the API

Continuation of thread: <a href="https://app.roll20.net/forum/post/3483040/selecting-a-token-through-the-api" rel="nofollow">https://app.roll20.net/forum/post/3483040/selecting-a-token-through-the-api</a> As mentioned in another thread, I'm trying to wire Twitch chat into Roll20 to enable viewer interactions. It seems, though, that I'm hitting many existing shortcomings to make the experience personalize to the viewer. In this case, I was hoping to select the token with the same name as the twitch viewer and trigger initiative, for example. Equivalent to clicking the character sheet while the token was selcted. Perhaps there is an alternative, though? Below is the command entered into chat when selecting the char sheet. Can it be modified to not require the token to be selected? @{TWITCH|wtype}&amp;{template:simple} {{rname=^{init-u}}} {{mod=@{TWITCH|initiative_bonus}}} {{r1=[[@{TWITCH|initiative_style}+@{TWITCH|initiative_bonus}@{TWITCH|pbd_safe}[INIT] &amp;{tracker}]]}} {{normal=1}} @{TWITCH|charname_output}
1532743626
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
The initiative can be rolled without having a token selected, but to send it to the tracker requires a token to be selected.
1532787919
The Aaron
Pro
API Scripter
Your best bet it to use an API script to add the token.&nbsp; You could either have the script listen to chat messages and pick up on when an initiative is rolled from the character sheet, then find the token representing that character on player page and add it to the turn order, or call the initiative script directly.&nbsp; I have a script you could probably use for the latter case: <a href="https://github.com/shdwjk/Roll20API/blob/master/InitiativeAssistant/InitiativeAssistant.js" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/InitiativeAssistant/InitiativeAssistant.js</a>