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

Macro that posts a message in text channel whenever a Natural 1 or 20 is rolled for an attack?

Im a fan of Darkest Dungeon and for my CoS campaign I'd love to have the various sayings the Narrator says pop-up on Nat 1's and 20s.
1713374434
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Customizable Roll Listener is good for this.
1713374489

Edited 1713374540
Gauss
Forum Champion
Hi DM Deadman,  Which character sheet are you using? If you don't know the name please supply a screenshot of the character sheet. You will most likely need an API Script for this, such as what Keith mentioned. 
5E OGL
1713382653
Gauss
Forum Champion
DM Deadman said: 5E OGL Do you mean the D&D 5e by Roll20 character sheet? (There is no character sheet called the 5e OGL)
Yes
1713396256
Gauss
Forum Champion
Yeah, your best bet is Keiths suggestion. I am pretty sure there is no way for you to do it without a Mod (API script). 
I dont know how to write the macro code for that, any suggestions?
Can either of you help with the macro code for this?
A most basic example: !crl \\create, name=Narrator Fumble, text=##, roll=fumble \\You fumble! What you'll want to do is create a Rollable Table.  If you name it NarratorFumbles and populate it with various things the Narrator says when someone rolls a Nat1, then the CRL command would look like this: !crl \\create, name=Narrator Fumble, text=##, roll=fumble \\[[1t[NarratorFumbles]]] Do the same thing for Nat20s and change 'Fumble' to 'Success' or 'Critical'.
Is there a way to have it send out like an /em from a Narrator character sheet? Like this,
So I set it up with the following but its still not displaying the text I put in the rollable table,
First, just to confirm, you have loaded the Customizable Roll Listener script, right? You should see an output in chat if you use the !crl command. Don't create a macro with the !crl command.  Run it a single time by simply entering it into the chat window.  Then open the Customizable Roll Listener character that the script autogenerates, and you should see an Ability (on the Attributes and Abilities page). Here's an example of what mine looks like for 'Concentration': What should happen after you have run the !crl \\create, name=Narrator Fumble, text=##, roll=fumble \\[[1t[NarratorFumbles]]] command a single time is if a character rolls a critical fumble, the script is watching all the chat messages and recognizes the fumble, then it automatically rolls on the NarratorFumbles table for you. But I just tried it out myself, and using the inline roll command (double square brackets) breaks the CRL script and prevents it from creating the Ability.  It's been a while since I've used CRL, so I'll have to play around with it to see if there's a simple solution.
1713553136
Gold
Forum Champion
I have a Mod (API script) for this, // Github:&nbsp; &nbsp;<a href="https://github.com/shdwjk/Roll20API/blob/master/AnnouncRoll/AnnouncRoll.js" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/AnnouncRoll/AnnouncRoll.js</a> // By:&nbsp; &nbsp; &nbsp; &nbsp;The Aaron, Arcane Scriptomancer // Contact:&nbsp; <a href="https://app.roll20.net/users/104025/the-aaron" rel="nofollow">https://app.roll20.net/users/104025/the-aaron</a> var AnnounceRoll = AnnounceRoll || (function() { &nbsp; &nbsp; 'use strict'; &nbsp; &nbsp; var version = '0.2.1', &nbsp; &nbsp; &nbsp; &nbsp; lastUpdate = 1427604233, &nbsp; &nbsp; checkInstall = function() {&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; log('-=&gt; AnnounceRoll v'+version+' &lt;=-&nbsp; ['+(new Date(lastUpdate*1000))+']'); &nbsp; &nbsp; }, &nbsp; &nbsp; handleInput = function(msg) { &nbsp; &nbsp; &nbsp; &nbsp; var rolldata,out=[]; &nbsp; &nbsp; &nbsp; &nbsp; if (msg.type !== "rollresult") { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; rolldata = JSON.parse(msg.content); &nbsp; &nbsp; &nbsp; &nbsp; _.each(rolldata.rolls,function(r){ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if('R' === r.type &amp;&amp; 20 === r.sides) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _.each(r.results, function(roll){ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; switch(roll.v) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case 1: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; out.push('&lt;div style="color: #009900;font-weight: bold"&gt;Natural 1.. What happens? (Narrative)&lt;/div&gt;'); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case 20: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; out.push('&lt;div style="color: #009900;font-weight: bold"&gt;NATURAL 20! (Narrative opportunity)&lt;/div&gt;'); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; }); &nbsp; &nbsp; &nbsp; &nbsp; if(out.length) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sendChat('',out.join('')); &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; }, &nbsp; &nbsp; registerEventHandlers = function() { &nbsp; &nbsp; &nbsp; &nbsp; on('chat:message', handleInput); &nbsp; &nbsp; }; &nbsp; &nbsp; return { &nbsp; &nbsp; &nbsp; &nbsp; CheckInstall: checkInstall, &nbsp; &nbsp; &nbsp; &nbsp; RegisterEventHandlers: registerEventHandlers &nbsp; &nbsp; }; }()); on('ready',function() { &nbsp; &nbsp; 'use strict'; &nbsp; &nbsp; AnnounceRoll.CheckInstall(); &nbsp; &nbsp; AnnounceRoll.RegisterEventHandlers(); });
Jarren said: First, just to confirm, you have loaded the Customizable Roll Listener script, right? You should see an output in chat if you use the !crl command. Don't create a macro with the !crl command.&nbsp; Run it a single time by simply entering it into the chat window.&nbsp; Then open the Customizable Roll Listener character that the script autogenerates, and you should see an Ability (on the Attributes and Abilities page). Here's an example of what mine looks like for 'Concentration': What should happen after you have run the !crl \\create, name=Narrator Fumble, text=##, roll=fumble \\[[1t[NarratorFumbles]]] command a single time is if a character rolls a critical fumble, the script is watching all the chat messages and recognizes the fumble, then it automatically rolls on the NarratorFumbles table for you. But I just tried it out myself, and using the inline roll command (double square brackets) breaks the CRL script and prevents it from creating the Ability.&nbsp; It's been a while since I've used CRL, so I'll have to play around with it to see if there's a simple solution. So following your steps, I had this pop-up in the chat maybe I need to mess with this?