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

Little Issue with blindcheck mod

1670670897

Edited 1671753919
Hi all, here's a script from stephen s. i use to have my players send me a blindcheck :&nbsp; /*jshint esversion: 9 */ // OPen and Blind Checks for the 5th Edition OGL by Roll20 // Create a token action macro called "OpenChecks" with the action "!OpenChecks" // Create a token action macro called "BlindChecks" with the action "!BlindChecks" // Give all your players access to both. const OpenBlindChecks = (() =&gt; { const buildTable = (values) =&gt; { let getMod = (g) =&gt; { return g ? g.mod : -5; }; let s = { div: `display: block; ` + `min-height:60px; ` + `margin: 5px 0px 0px -30px; ` + `padding:0px 5px 0px 5px; ` + `border: 0px none; ` + `border-radius: 6px 6px 6px 6px; ` + `box-shadow: 2px 2px 4px 2px #000; ` + `background-color: #fff; ` + `background-image: url('${values.blind ? "<a href="https://i.imgur.com/UCIUXyr.jpg" rel="nofollow">https://i.imgur.com/UCIUXyr.jpg</a>" : "<a href="https://i.imgur.com/vjL1blE.jpg" rel="nofollow">https://i.imgur.com/vjL1blE.jpg</a>" }'); ` + //<a href="https://i.imgur.com/UCIUXyr.jpg" rel="nofollow">https://i.imgur.com/UCIUXyr.jpg</a> <a href="https://i.imgur.com/vjL1blE.jpg" rel="nofollow">https://i.imgur.com/vjL1blE.jpg</a> `text-align: left; ` + `white-space: pre-wrap;`, tbl_top: `width: 90%; margin: auto;`, img: `background-color: transparent; ` + `border: none ;` + `max-height: 60px; ` + `padding: 5px; ` + `margin: auto; !important`, name: `font-weight: bold; ` + `font-size: 120%; ` + `font-style: italic; ` + `text-align: center; ` + `line-height: 18px; ` + `padding: 0px 5px 0px;`, blurb: `font-style: italic; ` + `text-align: center; ` + `line-height:18px; ` + `padding: 0px 5px 0px;`, rolls: `text-align: center; ` + `line-height:18px; ` + `padding: 0px 5px 0px;`, inlinestyle: `display: inline-block; ` + `min-width:18px; ` + `min-height:18px; ` + `background: white; ` + `border: 1px solid black; ` + `font-style: normal; ` + `text-align: center; ` + `line-height:18px; ` + `padding: 0px:` + `color: black;`, inlineclass: `inlinerollresult showtip tipsy-n-right`, tbl_abl: `width: 90%; margin: auto;`, th: `font-weight: bold; ` + `text-align: center; ` + `line-height:18px; ` + `padding: 0px 5px 0px;`, td: `text-align: center; ` + `line-height:18px; ` + `padding: 0px 5px 0px;"`, tbl_skl: `width: 90%; margin: auto;`, tr_even: `background-color: ${values.blind ? "#cfd2d0" : "#e0e5c1" };`, //cfd2d0 //e0e5c1 ${values.blind ? "cfd2d0" : "e0e5c1" } tr_odd: `background-color: ${values.blind ? "#eeeeee" : "#ffffff" };` //transparent #ffffff ${values.blind ? "#eeeeee" : "#ffffff" } }; let passive = `Passive Wisdom:&amp;nbsp;` + `&lt;span class="${s.inlineclass}" style="${s.inlinestyle}" title="10 + ${getMod(values.mods.perception_bonus)}"&gt;` + `${10 + getMod(values.mods.perception_bonus)}` + `&lt;/span&gt;`; let inlineRoll = (props) =&gt; { return `&lt;span class="${s.inlineclass}" style="${s.inlinestyle}" title="${props.t1}"&gt;${props.r1}&lt;/span&gt;&amp;#171;-&amp;#187;&lt;span class="${s.inlineclass}" style="${s.inlinestyle}" title="${props.t2}"&gt;${props.r2}&lt;/span&gt;`; }; let rawRoll = inlineRoll({ t1: `Rolling 1d20(${values.frst})`, r1: values.frst, t2: `Rolling 1d20(${values.scnd})`, r2: values.scnd}); let abilityRow = (oe, l, m, sa) =&gt; { return `&lt;tr style="${oe}"&gt;` + `&lt;td style="${s.td}"&gt;` + `${l}` + `&lt;/td&gt;` + `&lt;td style="${s.rolls}"&gt;` + `${inlineRoll({ t1: `Rolling 1d20(${values.frst})+${m}`, r1: values.frst + m, t2: `Rolling 1d20(${values.scnd})+${m}`, r2: values.scnd + m })}` + `&lt;/td&gt;` + `&lt;td style="${s.rolls}"&gt;` + `${inlineRoll({ t1: `Rolling 1d20(${values.frst})+${sa}`, r1: values.frst + sa, t2: `Rolling 1d20(${values.scnd})+${sa}`, r2: values.scnd + sa })}` + `&lt;/td&gt;` + `&lt;/tr&gt;`; }; let abilityList = [ {oddeven: s.tr_even, label: 'Force', mod: getMod(values.mods.strength_mod), save: getMod(values.mods.strength_save_bonus)}, {oddeven: s.tr_odd, label: 'Dextérité', mod: getMod(values.mods.dexterity_mod), save: getMod(values.mods.dexterity_save_bonus)}, {oddeven: s.tr_even, label: 'Constitution', mod: getMod(values.mods.constitution_mod), save: getMod(values.mods.constitution_save_bonus)}, {oddeven: s.tr_odd, label: 'Intelligence', mod: getMod(values.mods.intelligence_mod), save: getMod(values.mods.intelligence_save_bonus)}, {oddeven: s.tr_even, label: 'Sagesse', mod: getMod(values.mods.wisdom_mod), save: getMod(values.mods.wisdom_save_bonus)}, {oddeven: s.tr_odd, label: 'Charisme', mod: getMod(values.mods.charisma_mod), save: getMod(values.mods.charisma_save_bonus)} ]; let skillRow = (oe, l, m, sa) =&gt; { return `&lt;tr style="${oe}"&gt;` + `&lt;td style="${s.td}"&gt;` + `${l}` + `&lt;/td&gt;` + `&lt;td style="${s.rolls}"&gt;` + `${inlineRoll({ t1: `Rolling 1d20(${values.frst})+${m}`, r1: values.frst + m, t2: `Rolling 1d20(${values.scnd})+${m}`, r2: values.scnd + m })}` + `&lt;/td&gt;` + `&lt;/tr&gt;`; }; let skillList = [ {oddeven: s.tr_odd, label: 'Arcane', mod: getMod(values.mods.arcana_bonus)}, {oddeven: s.tr_even, label: 'Perception', mod: getMod(values.mods.perception_bonus)}, {oddeven: s.tr_odd, label: 'Escamotage', mod: getMod(values.mods.sleight_of_hand_bonus)}, {oddeven: s.tr_even, label: 'Discretion', mod: getMod(values.mods.stealth_bonus)}, {oddeven: s.tr_odd, label: 'Survie', mod: getMod(values.mods.survival_bonus)}, {oddeven: s.tr_even, label: 'Religion', mod: getMod(values.mods.religion_bonus)}, {oddeven: s.tr_odd, label: 'Histoire', mod: getMod(values.mods.history_bonus)}, {oddeven: s.tr_even, label: 'Invetigation', mod: getMod(values.mods.investigation_bonus)}, {oddeven: s.tr_odd, label: 'Perspicacité', mod: getMod(values.mods.insight_bonus)}, ]; values.message = `` + `&lt;div style="${s.div}"&gt;` + `&lt;table style="${s.tbl_top}"&gt;` + `&lt;tr&gt;` + `&lt;td rowspan="3"&gt;` + `&lt;img style="${s.img}" src="${values.url}"&gt;` + `&lt;/td&gt;` + `&lt;td style="${s.name}"&gt;` + `${values.name}` + `&lt;/td&gt;` + `&lt;/tr&gt;` + `&lt;tr&gt;` + `&lt;td style="${s.blurb}"&gt;` + `${passive}` + `&lt;/td&gt;` + `&lt;/tr&gt;` + `&lt;tr&gt;` + `&lt;td style="${s.rolls}"&gt;` + `${rawRoll}` + `&lt;/td&gt;` + `&lt;/tr&gt;` + `&lt;/table&gt;` + `&lt;br&gt;` + `&lt;table style="${s.tbl_abl}"&gt;` + `&lt;tr&gt;` + `&lt;td style="${s.th}"&gt;` + `Ability` + `&lt;/td&gt;&lt;td style="${s.th}"&gt;` + `Check` + `&lt;/td&gt;` + `&lt;td style="${s.th}"&gt;` + `Save` + `&lt;/td&gt;` + `&lt;/tr&gt;`; abilityList.forEach( (row) =&gt; { values.message = values.message + abilityRow(row.oddeven, row.label, row.mod, row.save); }); values.message = values.message + `&lt;/table&gt;` + `&lt;br&gt;` + `&lt;table style="${s.tbl_abl}"&gt;` + `&lt;tr&gt;` + `&lt;td style="${s.th}"&gt;` + `Ability` + `&lt;/td&gt;&lt;td style="${s.th}"&gt;` + `Check` + `&lt;/td&gt;` + `&lt;/tr&gt;`; skillList.forEach( (row) =&gt; { values.message = values.message + skillRow(row.oddeven, row.label, row.mod); }); values.message = values.message + `&lt;/table&gt;` + `&lt;br&gt;` + `&lt;/div&gt;`; return values.message; }; const getAttributes = (values) =&gt; { let attrNames = [ 'strength_mod', 'dexterity_mod', 'constitution_mod', 'intelligence_mod', 'wisdom_mod', 'charisma_mod', 'strength_save_bonus', 'dexterity_save_bonus', 'constitution_save_bonus', 'intelligence_save_bonus', 'wisdom_save_bonus', 'charisma_save_bonus', 'athletics_bonus', 'acrobatics_bonus', 'animal_handling_bonus', 'arcana_bonus', 'deception_bonus', 'history_bonus', 'insight_bonus', 'intimidation_bonus', 'investigation_bonus', 'medicine_bonus', 'nature_bonus', 'perception_bonus', 'performance_bonus', 'persuasion_bonus', 'religion_bonus', 'sleight_of_hand_bonus', 'stealth_bonus', 'survival_bonus', 'passive_wisdom' ]; values.attr = filterObjs( (a) =&gt; { if ( a.get('characterid') == values.cid &amp;&amp; a.get('type') === 'attribute' &amp;&amp; attrNames.includes(a.get('name')) ) { return true; } else { return false; } }); values.mods = {}; values.attr.forEach( (a) =&gt; { let key = a.get('name'); let mod = a.get('current'); let lbl = a.get('name') .replace(/_mod/gi,'') .replace(/_bonus/gi,'') .replace(/_/g, ' '); values.mods[a.get('name')] = { key: a.get('name'), mod: (Number(mod)||~~mod) || 0, lbl: lbl }; }); sendChat('QuantumRoll', '[[2d20]]', function(qr) { values.frst = qr[0].inlinerolls[0].results.rolls[0].results[0].v; values.scnd = qr[0].inlinerolls[0].results.rolls[0].results[1].v; buildTable(values); if (values.blind) { sendChat(values.who, `/w gm ${values.message}`); sendChat('API - Jet Caché', `/w ${values.who} Jet Caché envoyé. Je suis sûr que ca va aller...`); }else{ sendChat(values.who, values.message); } }); }; const handleInput = (msg) =&gt; { let values = {}; values.msg = msg; values.tok = getObj( values.msg.selected[0]._type, values.msg.selected[0]._id); values.cha = getObj( 'character', values.tok.get('represents')); if (values.cha) { values.cid = values.cha.get('id'); let imgsrc = values.tok.get('imgsrc'); values.url = imgsrc === '/images/character.png' ? '<a href="https://i.imgur.com/MpqETqe.png" rel="nofollow">https://i.imgur.com/MpqETqe.png</a>' : imgsrc; values.name = values.cha.get('name'); values.blind = msg.content.startsWith("!BlindChecks"); values.who = values.msg.who .substring(0, values.msg.who.indexOf(' (GM)')); } getAttributes(values); }; on("ready",() =&gt; { on('chat:message', (msg_orig) =&gt; { if (msg_orig.type === 'api' &amp;&amp; (msg_orig.content.startsWith("!OpenChecks") || msg_orig.content.startsWith("!BlindChecks")) &amp;&amp; msg_orig.selected &amp;&amp; msg_orig.selected.length == 1 ) { handleInput(_.clone(msg_orig)); } }); }); return { }; })(); I have a little issue with that because this script (from what i understand looking a it) is supposed to whisp a short message to the sender telling him that the check is sent to the gm.. but it actually doesn't... so my players never know if the check is done or not.... Is there something wrong in the code ? Thx for your help
Is there a solution available somewhere ? Any help appreciated.
Hello all,&nbsp; I'm still struggling with this issue.&nbsp; I really don't understand why the script doesn't output the message to the player that made the blindcheck call. Any Idea how to correct this ?
up ?
1671767212
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Sorry Lionel, I'd like to help, but that's not a script I've ever used. Stephen doesn't post to the forums very often anymore, but you could try a PM:&nbsp; Stephen S.
i did ...:(
1671807242
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Got it. The instructions in the comments are wrong. It tells you to use !cpenchecks and !blindchecks, but the commands are actually&nbsp; !OpenChecks and !BlindChecks. The capitalization is different. You might want to try this revision from the Aaron . I'm not entirely sure what the difference is, but if Aaron posts a revision to someone's code, it's usually with a good reason.
1671825063
timmaugh
Pro
API Scripter
Hey, Lionel... nothing jumps out to me as being wrong. What system is this for, if I wanted to mock something up to test?
1671825549
The Aaron
Forum Champion
API Scripter
Change this line: sendChat('API - Jet Caché', `/w ${values.who} Jet Caché envoyé. Je suis sûr que ca va aller...`); to: sendChat('API - Jet Caché', `/w "${values.who}" Jet Caché envoyé. Je suis sûr que ca va aller...`); and see if that fixes it.
Actually i already tried that.&nbsp; Just tried it again with no luck.&nbsp; I know it fixed it for some other people, but not in my game... weird?
timmaugh said: Hey, Lionel... nothing jumps out to me as being wrong. What system is this for, if I wanted to mock something up to test? 5e (and roll20 sheet if it matters.) The instructions in the comments are wrong. It tells you to use !cpenchecks and !blindchecks, but the commands are actually&nbsp; !OpenChecks and !BlindChecks. The capitalization is different. I have the right macro too...
1672009243
The Aaron
Forum Champion
API Scripter
Try adding this before the sendChat: Log( `/w "${values.who}" Jet Caché envoyé. Je suis sûr que ca va aller...`); And then check if you are getting logging in the Mods Console. If you are, copy past what's in the log here, maybe we can spot the issue.&nbsp;
here's what i get in the console when i send the command.&nbsp; "Handle input!" {"content":"!BlindChecks","playerid":"-MU9DlniH2uVfqN15tl8","selected":[{"_id":"-NJvlsxp6APm5rTdQo1B","_type":"graphic"}],"type":"api","who":"GM (GM)","unlock":{"zeroframe":"-NKCiCMpT1WrzJSNKEZB"},"apitrigger":"ZeroFrame-NKCiCMpT1WrzJSNKEZC","origcontent":"!BlindChecks","parsedinline":[]} "Handle input!" {"content":"&lt;div style=\"display: block; min-height:60px; margin: 5px 0px 0px -30px; padding:0px 5px 0px 5px; border: 0px none; border-radius: 6px 6px 6px 6px; box-shadow: 2px 2px 4px 2px #000; background-color: #fff; background-image: url('<a href="https://i.imgur.com/UCIUXyr.jpg" rel="nofollow">https://i.imgur.com/UCIUXyr.jpg</a>'); text-align: left; white-space: pre-wrap;\"&gt;&lt;table style=\"width: 90%; margin: auto;\"&gt;&lt;tr&gt;&lt;td rowspan=\"3\"&gt;&lt;img style=\"background-color: transparent; border: none ;max-height: 60px; padding: 5px; margin: auto; !important\" src=\"<a href="https://s3.amazonaws.com/files.d20.io/images/308458652/DbHTlq018NeVLbvtCjWpbw/thumb.png?16653096515\&quot;&gt;&lt;/td&gt;&lt;td" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/308458652/DbHTlq018NeVLbvtCjWpbw/thumb.png?16653096515\"&gt;&lt;/td&gt;&lt;td</a> style=\"font-weight: bold; font-size: 120%; font-style: italic; text-align: center; line-height: 18px; padding: 0px 5px 0px;\"&gt;Konrad&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=\"font-style: italic; text-align: center; line-height:18px; padding: 0px 5px 0px;\"&gt;Perception Passive:&amp;nbsp;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"10 + 5\"&gt;15&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"&gt;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(12)\"&gt;12&lt;/span&gt;&amp;#171;-&amp;#187;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(19)\"&gt;19&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br&gt;&lt;table style=\"width: 90%; margin: auto;\"&gt;&lt;tr&gt;&lt;td style=\"font-weight: bold; text-align: center; line-height:18px; padding: 0px 5px 0px;\"&gt;Ability&lt;/td&gt;&lt;td style=\"font-weight: bold; text-align: center; line-height:18px; padding: 0px 5px 0px;\"&gt;Check&lt;/td&gt;&lt;td style=\"font-weight: bold; text-align: center; line-height:18px; padding: 0px 5px 0px;\"&gt;Save&lt;/td&gt;&lt;/tr&gt;&lt;tr style=\"background-color: #cfd2d0;\"&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"\"&gt;Force&lt;/td&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"&gt;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(12)+-1\"&gt;11&lt;/span&gt;&amp;#171;-&amp;#187;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(19)+-1\"&gt;18&lt;/span&gt;&lt;/td&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"&gt;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(12)+1\"&gt;13&lt;/span&gt;&amp;#171;-&amp;#187;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(19)+1\"&gt;20&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=\"background-color: #eeeeee;\"&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"\"&gt;Dextérité&lt;/td&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"&gt;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(12)+4\"&gt;16&lt;/span&gt;&amp;#171;-&amp;#187;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(19)+4\"&gt;23&lt;/span&gt;&lt;/td&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"&gt;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(12)+6\"&gt;18&lt;/span&gt;&amp;#171;-&amp;#187;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(19)+6\"&gt;25&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=\"background-color: #cfd2d0;\"&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"\"&gt;Constitution&lt;/td&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"&gt;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(12)+2\"&gt;14&lt;/span&gt;&amp;#171;-&amp;#187;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(19)+2\"&gt;21&lt;/span&gt;&lt;/td&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"&gt;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(12)+2\"&gt;14&lt;/span&gt;&amp;#171;-&amp;#187;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(19)+2\"&gt;21&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=\"background-color: #eeeeee;\"&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"\"&gt;Intelligence&lt;/td&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"&gt;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(12)+2\"&gt;14&lt;/span&gt;&amp;#171;-&amp;#187;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(19)+2\"&gt;21&lt;/span&gt;&lt;/td&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"&gt;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(12)+2\"&gt;14&lt;/span&gt;&amp;#171;-&amp;#187;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(19)+2\"&gt;21&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=\"background-color: #cfd2d0;\"&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"\"&gt;Sagesse&lt;/td&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"&gt;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(12)+3\"&gt;15&lt;/span&gt;&amp;#171;-&amp;#187;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(19)+3\"&gt;22&lt;/span&gt;&lt;/td&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"&gt;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(12)+3\"&gt;15&lt;/span&gt;&amp;#171;-&amp;#187;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(19)+3\"&gt;22&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=\"background-color: #eeeeee;\"&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"\"&gt;Charisme&lt;/td&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"&gt;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(12)+2\"&gt;14&lt;/span&gt;&amp;#171;-&amp;#187;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(19)+2\"&gt;21&lt;/span&gt;&lt;/td&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"&gt;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(12)+2\"&gt;14&lt;/span&gt;&amp;#171;-&amp;#187;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(19)+2\"&gt;21&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br&gt;&lt;table style=\"width: 90%; margin: auto;\"&gt;&lt;tr&gt;&lt;td style=\"font-weight: bold; text-align: center; line-height:18px; padding: 0px 5px 0px;\"&gt;Ability&lt;/td&gt;&lt;td style=\"font-weight: bold; text-align: center; line-height:18px; padding: 0px 5px 0px;\"&gt;Check&lt;/td&gt;&lt;/tr&gt;&lt;tr style=\"background-color: #eeeeee;\"&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"\"&gt;Arcane&lt;/td&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"&gt;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(12)+2\"&gt;14&lt;/span&gt;&amp;#171;-&amp;#187;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(19)+2\"&gt;21&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=\"background-color: #cfd2d0;\"&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"\"&gt;Perception&lt;/td&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"&gt;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(12)+5\"&gt;17&lt;/span&gt;&amp;#171;-&amp;#187;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(19)+5\"&gt;24&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=\"background-color: #eeeeee;\"&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"\"&gt;Escamotage&lt;/td&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"&gt;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(12)+4\"&gt;16&lt;/span&gt;&amp;#171;-&amp;#187;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(19)+4\"&gt;23&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=\"background-color: #cfd2d0;\"&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"\"&gt;Discretion&lt;/td&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"&gt;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(12)+6\"&gt;18&lt;/span&gt;&amp;#171;-&amp;#187;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(19)+6\"&gt;25&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=\"background-color: #eeeeee;\"&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"\"&gt;Survie&lt;/td&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"&gt;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(12)+5\"&gt;17&lt;/span&gt;&amp;#171;-&amp;#187;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(19)+5\"&gt;24&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=\"background-color: #cfd2d0;\"&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"\"&gt;Religion&lt;/td&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"&gt;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(12)+2\"&gt;14&lt;/span&gt;&amp;#171;-&amp;#187;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(19)+2\"&gt;21&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=\"background-color: #eeeeee;\"&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"\"&gt;Histoire&lt;/td&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"&gt;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(12)+2\"&gt;14&lt;/span&gt;&amp;#171;-&amp;#187;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(19)+2\"&gt;21&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=\"background-color: #cfd2d0;\"&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"\"&gt;Invetigation&lt;/td&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"&gt;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(12)+4\"&gt;16&lt;/span&gt;&amp;#171;-&amp;#187;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(19)+4\"&gt;23&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=\"background-color: #eeeeee;\"&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"\"&gt;Perspicacité&lt;/td&gt;&lt;td style=\"text-align: center; line-height:18px; padding: 0px 5px 0px;\"&gt;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(12)+3\"&gt;15&lt;/span&gt;&amp;#171;-&amp;#187;&lt;span class=\"inlinerollresult showtip tipsy-n-right\" style=\"display: inline-block; min-width:18px; min-height:18px; background: white; border: 1px solid black; font-style: normal; text-align: center;&nbsp; line-height:18px;&nbsp; padding: 0px:color: black;\" title=\"Rolling 1d20(19)+3\"&gt;22&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br&gt;&lt;/div&gt;","playerid":"API","target":"gm","target_name":"GM","type":"whisper","who":"GM"} "Handle input!" {"content":" Jet Caché envoyé. Je suis sûr que ca va aller...","playerid":"API","target":"gm","target_name":"GM","type":"whisper","who":"API - Jet Caché"}
1672093372

Edited 1672093865
Oosh
Sheet Author
API Scripter
So.... just to get this straight, you can see the 2nd message in the log (with all the HTML in it), but you can't see this message at all? Jet Caché envoyé. Je suis sûr que ca va aller... It's odd that it's logging properly, but not visible in the chat bar. I guess you could try getting rid of the dash and the accented 'e' from the 'who' part of the sendChat command, API - Jet Caché, but I doubt either of them are problems. Edit - ahhhhhh, wait a minute. Try changing this (last part of the handleInput function near the end of the script) values.who = values.msg.who .substring(0, values.msg.who.indexOf(' (GM)')); to this: values.who = values.msg.who.replace(/\s*\(GM\)/, ''); I.... don't think I've ever used substring() before. It has some truly horrible behaviour to it, so I doubt I ever will, either. "Just like slice(), but worse!" would sum it up well. Swapping the arguments around if it looks like the programmer messed them up? Get the hell out of town, send me an error so I can learn to use the method properly. Yuck.
Bingo !!! you nailed it !!! I've been trying to look for that value.who anywhere, but as i can't code at (nearly) all, i just didn't understand what was teh function....&nbsp; but it's all solved now !!!! thx a lot
1672159886
The Aaron
Forum Champion
API Scripter
Oh!! &nbsp;Nice catch Oosh! There a better way to handle that than substrings, I should fix that.&nbsp;
1672170333
vÍnce
Pro
Sheet Author
FYI: I've also updated my PF Community and PF Official hacks of Stephen's script with these latest changes as well. <a href="https://app.roll20.net/forum/permalink/10116748/" rel="nofollow">https://app.roll20.net/forum/permalink/10116748/</a>
Finally, i'm happy that i insisted that much ... i'm usually worried to be a little bit too much a pain ITA... lol