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

Warhammer Fantasy Roleplay 3rd Edition Dice Script Help

Hello! I found this thread that is a little old but has a dice rolling script for 3e that I was keen to try out. When I save it I get "Unexpected token ILLEGAL Restarting sandbox due to script changes... Spinning up new sandbox... Unexpected token ILLEGAL" I've searched the forums and looked for any mention of the term token in the script and that kind of thing. I also looked at the debugging API scripts page but whilst I am a nerd this is not my area of expertise. I have sent a message to the author of the script and I'll update here if they reply. Can anyone shed any light on this? Tell me where to start looking? What calls to start logging? Thank you, S
1427256582
The Aaron
Pro
API Scripter
It looks like the script got cut off. The last line is "return resu", but should probably be more like: return result; } I'd start with doing that and seeing if it works. Post back with details. Also, is that your only script?
Thanks Aaron for the prompt reply. It is the only script. I added your suggestions (kicking myself for not spotting that) and it still doesn't work.
1427286012
The Aaron
Pro
API Scripter
Ok. I'll try and pull it down later and see if I can spot the issue. :)
1427288408
The Aaron
Pro
API Scripter
OK. Got it working. There were a few minor issues. I think the one you were hitting was a carriage return in the middle of a couple of the urls. Anyway, here is the corrected version: // name: script_wfrp // author: omonubi (<a href="mailto:omonubi@hotmail.com" rel="nofollow">omonubi@hotmail.com</a>) // description: // This script rolls a certain number of WFRP 3rd Edition dice, and both displays and summarizes the result, in graphical format. // The number of each type of WFRP 3e die to be rolled is specified by entering up to 7 digits, each digit representing one type of die. // The order of the digits are: // B - Characteristic // R - Reckless // C - Conservative // E - Expertise // F - Fortune // X - Challenge // M - Misfortune // E.G. '!wfrp 3021231' // Typing '!wfrp' alone rolls a single Characteristic die. // Typing '!wfrp ?' display a short-hand reminder of the dice types and expected order ('BRCWFXM'). // Styles var STYLE_DICE = "height:15px; width:15px; "; var STYLE_DICE_RESULTS = "height:30px; width:30px; "; // Graphics source URLs var WFRP_GRXURL_CHALLENGE_BLANK = "<a href="https://s3.amazonaws.com/files.d20.io/images/4321234/Bw0SBdlGvrgAm15Ht5hNnQ/thumb.gif?1402251734" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4321234/Bw0SBdlGvrgAm15Ht5hNnQ/thumb.gif?1402251734</a>"; var WFRP_GRXURL_CHALLENGE_BANE = "<a href="https://s3.amazonaws.com/files.d20.io/images/4321237/mqPlZxexnLTzSAk0nd3FSA/thumb.gif?1402251741" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4321237/mqPlZxexnLTzSAk0nd3FSA/thumb.gif?1402251741</a>"; var WFRP_GRXURL_CHALLENGE_BANES = "<a href="https://s3.amazonaws.com/files.d20.io/images/4321239/b7Nbhoy5V92RUCdGQa1jiA/thumb.gif?1402251746" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4321239/b7Nbhoy5V92RUCdGQa1jiA/thumb.gif?1402251746</a>"; var WFRP_GRXURL_CHALLENGE_STAR = "<a href="https://s3.amazonaws.com/files.d20.io/images/4321236/ihO2hE2NDmSHo3y_WM3uhQ/thumb.gif?1402251737" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4321236/ihO2hE2NDmSHo3y_WM3uhQ/thumb.gif?1402251737</a>"; var WFRP_GRXURL_CHALLENGE_FAILURE = "<a href="https://s3.amazonaws.com/files.d20.io/images/4321241/mdcwuEyiThLSh9XaLmy9sQ/thumb.gif?1402251751" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4321241/mdcwuEyiThLSh9XaLmy9sQ/thumb.gif?1402251751</a>"; var WFRP_GRXURL_CHALLENGE_FAILURES = "<a href="https://s3.amazonaws.com/files.d20.io/images/4321242/ilE8MnH9o7qChMLsoyqMfA/thumb.gif?1402251755" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4321242/ilE8MnH9o7qChMLsoyqMfA/thumb.gif?1402251755</a>"; var WFRP_GRXURL_CHAR_BLANK = "<a href="https://s3.amazonaws.com/files.d20.io/images/4320431/k7EHhkNAK7Fuzi_wO-YRWw/thumb.gif?1402246289" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4320431/k7EHhkNAK7Fuzi_wO-YRWw/thumb.gif?1402246289</a>"; var WFRP_GRXURL_CHAR_BOON = "<a href="https://s3.amazonaws.com/files.d20.io/images/4320432/Cs-9vIOiKJRkunzKkM5xjQ/thumb.gif?1402246293" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4320432/Cs-9vIOiKJRkunzKkM5xjQ/thumb.gif?1402246293</a>"; var WFRP_GRXURL_CHAR_SUCCESS = "<a href="https://s3.amazonaws.com/files.d20.io/images/4320433/1kDEwavvDTJzeWSS1GqSpg/thumb.gif?1402246297" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4320433/1kDEwavvDTJzeWSS1GqSpg/thumb.gif?1402246297</a>"; var WFRP_GRXURL_CONSERVE_BLANK = "<a href="https://s3.amazonaws.com/files.d20.io/images/4320961/XFtB4Djk0XzdvX-SjvWpfw/thumb.gif?1402250080" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4320961/XFtB4Djk0XzdvX-SjvWpfw/thumb.gif?1402250080</a>"; var WFRP_GRXURL_CONSERVE_BOON = "<a href="https://s3.amazonaws.com/files.d20.io/images/4320963/fPQ3vhtUgSVRhYAdNmoUDQ/thumb.gif?1402250084" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4320963/fPQ3vhtUgSVRhYAdNmoUDQ/thumb.gif?1402250084</a>"; var WFRP_GRXURL_CONSERVE_BOONSUCCESS = "<a href="https://s3.amazonaws.com/files.d20.io/images/4320964/3XxfCPKnEMZlbHOtq1FmZg/thumb.gif?1402250088" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4320964/3XxfCPKnEMZlbHOtq1FmZg/thumb.gif?1402250088</a>"; var WFRP_GRXURL_CONSERVE_DELAY = "<a href="https://s3.amazonaws.com/files.d20.io/images/4321758/vOmsyM7FH-a9yiOI1bJ3CQ/thumb.gif?1402255442" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4321758/vOmsyM7FH-a9yiOI1bJ3CQ/thumb.gif?1402255442</a>"; var WFRP_GRXURL_CONSERVE_DELAYSUCCESS = "<a href="https://s3.amazonaws.com/files.d20.io/images/4320965/fa4yXF7NGCCo647sg0mSoQ/thumb.gif?1402250092" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4320965/fa4yXF7NGCCo647sg0mSoQ/thumb.gif?1402250092</a>"; var WFRP_GRXURL_CONSERVE_SUCCESS = "<a href="https://s3.amazonaws.com/files.d20.io/images/4320966/w2XWTcM6y2cq26G6GG6CNg/thumb.gif?1402250096" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4320966/w2XWTcM6y2cq26G6GG6CNg/thumb.gif?1402250096</a>"; var WFRP_GRXURL_EXPERT_BLANK = "<a href="https://s3.amazonaws.com/files.d20.io/images/4321072/0v4x0BgwG_iC-cH9wjYmzg/thumb.gif?1402250759" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4321072/0v4x0BgwG_iC-cH9wjYmzg/thumb.gif?1402250759</a>"; var WFRP_GRXURL_EXPERT_BOON = "<a href="https://s3.amazonaws.com/files.d20.io/images/4321073/NJoYB0i_wpATtcWILq5NOQ/thumb.gif?1402250763" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4321073/NJoYB0i_wpATtcWILq5NOQ/thumb.gif?1402250763</a>"; var WFRP_GRXURL_EXPERT_COMET = "<a href="https://s3.amazonaws.com/files.d20.io/images/4321075/1O2_HEk0Lj0-LLWiUl07yA/thumb.gif?1402250767" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4321075/1O2_HEk0Lj0-LLWiUl07yA/thumb.gif?1402250767</a>"; var WFRP_GRXURL_EXPERT_SUCCESS = "<a href="https://s3.amazonaws.com/files.d20.io/images/4321077/trEec1ILEjJ7wHmfjAXDtw/thumb.gif?1402250770" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4321077/trEec1ILEjJ7wHmfjAXDtw/thumb.gif?1402250770</a>"; var WFRP_GRXURL_EXPERT_SUCCESSPLUS = "<a href="https://s3.amazonaws.com/files.d20.io/images/4321599/vryNF_fn1VAemxrQ9IuSkQ/thumb.gif?1402254349" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4321599/vryNF_fn1VAemxrQ9IuSkQ/thumb.gif?1402254349</a>"; var WFRP_GRXURL_FORTUNE_BLANK = "<a href="https://s3.amazonaws.com/files.d20.io/images/4320217/LR5kj1_cve-TN4JwCfiWwg/thumb.gif?1402244607" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4320217/LR5kj1_cve-TN4JwCfiWwg/thumb.gif?1402244607</a>"; var WFRP_GRXURL_FORTUNE_BOON = "<a href="https://s3.amazonaws.com/files.d20.io/images/4320219/LHvVt3vEM7bcvhHuR_kKMw/thumb.gif?1402244616" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4320219/LHvVt3vEM7bcvhHuR_kKMw/thumb.gif?1402244616</a>"; var WFRP_GRXURL_FORTUNE_SUCCESS = "<a href="https://s3.amazonaws.com/files.d20.io/images/4320220/yVZAHjr8ZTEfnXQ38ooCZQ/thumb.gif?1402244621" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4320220/yVZAHjr8ZTEfnXQ38ooCZQ/thumb.gif?1402244621</a>"; var WFRP_GRXURL_MISFORTUNE_BLANK = "<a href="https://s3.amazonaws.com/files.d20.io/images/4321358/MVGbNi-Idtk0ACvWdcs8PA/thumb.gif?1402252487" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4321358/MVGbNi-Idtk0ACvWdcs8PA/thumb.gif?1402252487</a>"; var WFRP_GRXURL_MISFORTUNE_BANE = "<a href="https://s3.amazonaws.com/files.d20.io/images/4321359/4GR3fEcJOKYyYmhwsI859w/thumb.gif?1402252491" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4321359/4GR3fEcJOKYyYmhwsI859w/thumb.gif?1402252491</a>"; var WFRP_GRXURL_MISFORTUNE_FAILURE = "<a href="https://s3.amazonaws.com/files.d20.io/images/4321360/bii4ffB3d8m_bSy1QqcnLA/thumb.gif?1402252494" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4321360/bii4ffB3d8m_bSy1QqcnLA/thumb.gif?1402252494</a>"; var WFRP_GRXURL_RECKLESS_BLANK = "<a href="https://s3.amazonaws.com/files.d20.io/images/4320811/Waq2OBme-YrAu_zkHtKQdw/thumb.gif?1402248995" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4320811/Waq2OBme-YrAu_zkHtKQdw/thumb.gif?1402248995</a>"; var WFRP_GRXURL_RECKLESS_BANE = "<a href="https://s3.amazonaws.com/files.d20.io/images/4320810/raRXwKkMyLAecqSHCD21pA/thumb.gif?1402248992" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4320810/raRXwKkMyLAecqSHCD21pA/thumb.gif?1402248992</a>"; var WFRP_GRXURL_RECKLESS_BOONS = "<a href="https://s3.amazonaws.com/files.d20.io/images/4320808/wSI0dXwcqmp0RI7zD5FEfQ/thumb.gif?1402248985" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4320808/wSI0dXwcqmp0RI7zD5FEfQ/thumb.gif?1402248985</a>"; var WFRP_GRXURL_RECKLESS_BOONSUCCESS = "<a href="https://s3.amazonaws.com/files.d20.io/images/4320813/HMJEaSv5rY3aKFm-5kMjdw/thumb.gif?1402248999" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4320813/HMJEaSv5rY3aKFm-5kMjdw/thumb.gif?1402248999</a>"; var WFRP_GRXURL_RECKLESS_EXERT = "<a href="https://s3.amazonaws.com/files.d20.io/images/4321761/GbSMoA2KSPjcS8e0vX-v9g/thumb.gif?1402255446" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4321761/GbSMoA2KSPjcS8e0vX-v9g/thumb.gif?1402255446</a>"; var WFRP_GRXURL_RECKLESS_EXERTSUCCESS = "<a href="https://s3.amazonaws.com/files.d20.io/images/4320814/BA5YNq3JPKtbgjd-Hn-tnA/thumb.gif?1402249003" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4320814/BA5YNq3JPKtbgjd-Hn-tnA/thumb.gif?1402249003</a>"; var WFRP_GRXURL_RECKLESS_SUCCESSES = "<a href="https://s3.amazonaws.com/files.d20.io/images/4320809/gz_ULSgaj_AGj81f-YnxPA/thumb.gif?1402248989" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4320809/gz_ULSgaj_AGj81f-YnxPA/thumb.gif?1402248989</a>"; // Global result counts var gNumSuccesses = 0; var gNumBoons = 0; var gNumStars = 0; var gNumComets = 0; var gIsExerted = false; var gIsDelayed = false; // Main on("chat:message", function (msg) { 'use strict'; // Exit if not an api command if (msg.type !== "api") { return; } // Get the API Chat Command //msg.who = msg.who.replace(" (GM)", ""); //msg.content = msg.content.replace("(GM) ", ""); var command = msg.content.split(/\s+/)[0]; if (command === "!wfrp") { var strPool = msg.content.substring(6,13); var strOutput = "&lt;div&gt;&lt;u&gt;Rolling (" + strPool + ")...&lt;/u&gt;&lt;/div&gt;"; if (strPool.substring(0,1) === "?") { sendChat("player|" + msg.playerid, "/direct !wfrp BRCEFXM"); return; } ClearCounts(); //rest global variables // Loop through dice counts and make rolls strOutput += "&lt;div&gt;"; var numCharacteristic = 0; if (msg.content.substring(6,7) === "") { numCharacteristic = 1; } else { numCharacteristic = msg.content.substring(6,7); } if (numCharacteristic &gt; 0) { strOutput += RollCharacteristic(numCharacteristic); } var numReckless = msg.content.substring(7,8); if (numReckless &gt; 0) strOutput += RollReckless(numReckless); var numConservative = msg.content.substring(8,9); if (numConservative &gt; 0) strOutput += RollConservative(numConservative); var numExpertise = msg.content.substring(9,10); if (numExpertise &gt; 0) strOutput += RollExpertise(numExpertise); var numFortune = msg.content.substring(10,11); if (numFortune &gt; 0) strOutput += RollFortune(numFortune); var numChallenge = msg.content.substring(11,12); if (numChallenge &gt; 0) strOutput += RollChallenge(numChallenge); var numMisfortune = msg.content.substring(12,13); if (numMisfortune &gt; 0) strOutput += RollMisfortune(numMisfortune); strOutput += "&lt;/div&gt;"; sendChat("player|" + msg.playerid, "/direct " + strOutput + NetResults()); } }); // Resets global variable counts function ClearCounts() { 'use strict'; gNumSuccesses = 0; gNumBoons = 0; gNumStars = 0; gNumComets = 0; gIsExerted = false; gIsDelayed = false; } // Tabulates and displays cumulative results function NetResults(){ 'use strict'; var strOutput = "&lt;div&gt;&lt;u&gt;Net Results:&lt;/u&gt;&lt;/div&gt;&lt;div&gt;"; if (gNumSuccesses &gt; 0) { for (var a = 0; a &lt; gNumSuccesses; a++) { strOutput += "&lt;img style='" + STYLE_DICE_RESULTS + "' src='" + WFRP_GRXURL_CHAR_SUCCESS + "'/&gt;" } } if (gNumSuccesses &lt; 0) { for (var a = 0; a &lt; Math.abs(gNumSuccesses); a++) { strOutput += "&lt;img style='" + STYLE_DICE_RESULTS + "' src='" + WFRP_GRXURL_CHALLENGE_FAILURE + "'/&gt;" } } if (gNumBoons &gt; 0) { for (var a = 0; a &lt; gNumBoons; a++) { strOutput += "&lt;img style='" + STYLE_DICE_RESULTS + "' src='" + WFRP_GRXURL_FORTUNE_BOON + "'/&gt;" } } if (gNumBoons &lt; 0) { for (var a = 0; a &lt; Math.abs(gNumBoons); a++) { strOutput += "&lt;img style='" + STYLE_DICE_RESULTS + "' src='" + WFRP_GRXURL_MISFORTUNE_BANE + "'/&gt;" } } if (gNumStars &gt; 0) { for (var a = 0; a &lt; gNumStars; a++) { strOutput += "&lt;img style='" + STYLE_DICE_RESULTS + "' src='" + WFRP_GRXURL_CHALLENGE_STAR + "'/&gt;" } } if (gNumComets &gt; 0) { for (var a = 0; a &lt; gNumComets; a++) { strOutput += "&lt;img style='" + STYLE_DICE_RESULTS + "' src='" + WFRP_GRXURL_EXPERT_COMET + "'/&gt;" } } if (gIsExerted) strOutput += "&lt;img style='" + STYLE_DICE_RESULTS + "' src='" + WFRP_GRXURL_RECKLESS_EXERT + "'/&gt;" if (gIsDelayed) strOutput += "&lt;img style='" + STYLE_DICE_RESULTS + "' src='" + WFRP_GRXURL_CONSERVE_DELAY + "'/&gt;" strOutput += "&lt;/div&gt;"; return strOutput; } // Rolls challenge dice function RollChallenge (numDice) { 'use strict'; var result = ""; for (var a = 0; a &lt; numDice; a++) { switch(randomInteger(8)) { case 1: result += "&lt;img style='" + STYLE_DICE +"' src='" + WFRP_GRXURL_CHALLENGE_BLANK + "'/&gt;"; break; case 2: result += "&lt;img style='" + STYLE_DICE +"' src='" + WFRP_GRXURL_CHALLENGE_BANE + "'/&gt;"; gNumBoons--; break; case 3: result += "&lt;img style='" + STYLE_DICE +"' src='" + WFRP_GRXURL_CHALLENGE_BANES + "'/&gt;"; gNumBoons -= 2; break; case 4: result += "&lt;img style='" + STYLE_DICE +"' src='" + WFRP_GRXURL_CHALLENGE_STAR + "'/&gt;"; gNumStars++; break; case 5: case 6: result += "&lt;img style='" + STYLE_DICE +"' src='" + WFRP_GRXURL_CHALLENGE_FAILURE + "'/&gt;"; gNumSuccesses--; break; case 7: case 8: result += "&lt;img style='" + STYLE_DICE +"' src='" + WFRP_GRXURL_CHALLENGE_FAILURES + "'/&gt;"; gNumSuccesses -= 2; break; } } return result; } // Rolls characteristic dice function RollCharacteristic (numDice) { 'use strict'; var result = ""; for (var a = 0; a &lt; numDice; a++) { switch(randomInteger(8)) { case 1: case 2: result += "&lt;img style='" + STYLE_DICE +"' src='" + WFRP_GRXURL_CHAR_BLANK + "'/&gt;"; break; case 3: case 4: result += "&lt;img style='" + STYLE_DICE +"' src='" + WFRP_GRXURL_CHAR_BOON + "'/&gt;"; gNumBoons++; break; case 5: case 6: case 7: case 8: result += "&lt;img style='" + STYLE_DICE +"' src='" + WFRP_GRXURL_CHAR_SUCCESS + "'/&gt;"; gNumSuccesses++; break; } } return result; } // Rolls conservative dice function RollConservative (numDice) { 'use strict'; var result = ""; for (var a = 0; a &lt; numDice; a++) { switch(randomInteger(10)) { case 1: result += "&lt;img style='" + STYLE_DICE +"' src='" + WFRP_GRXURL_CONSERVE_BLANK + "'/&gt;"; break; case 2: case 3: result += "&lt;img style='" + STYLE_DICE +"' src='" + WFRP_GRXURL_CONSERVE_BOON + "'/&gt;"; gNumBoons++; break; case 4: result += "&lt;img style='" + STYLE_DICE +"' src='" + WFRP_GRXURL_CONSERVE_BOONSUCCESS + "'/&gt;"; gNumBoons++; gNumSuccesses++; break; case 5: case 6: result += "&lt;img style='" + STYLE_DICE +"' src='" + WFRP_GRXURL_CONSERVE_DELAYSUCCESS + "'/&gt;"; gIsDelayed = true; gNumSuccesses++; break; case 7: case 8: case 9: case 10: result += "&lt;img style='" + STYLE_DICE +"' src='" + WFRP_GRXURL_CONSERVE_SUCCESS + "'/&gt;"; gNumSuccesses++; break; } } return result; } // Rolls expertise dice function RollExpertise (numDice) { 'use strict'; var result = ""; for (var a = 0; a &lt; numDice; a++) { switch(randomInteger(6)) { case 1: result += "&lt;img style='" + STYLE_DICE +"' src='" + WFRP_GRXURL_EXPERT_BLANK + "'/&gt;"; break; case 2: case 3: result += "&lt;img style='" + STYLE_DICE +"' src='" + WFRP_GRXURL_EXPERT_BOON + "'/&gt;"; gNumBoons++; break; case 4: result += "&lt;img style='" + STYLE_DICE +"' src='" + WFRP_GRXURL_EXPERT_SUCCESS + "'/&gt;"; gNumSuccesses++; break; case 5: a--; // Exploding Success result += "&lt;img style='" + STYLE_DICE +"' src='" + WFRP_GRXURL_EXPERT_SUCCESSPLUS + "'/&gt;"; gNumSuccesses++; break; case 6: result += "&lt;img style='" + STYLE_DICE +"' src='" + WFRP_GRXURL_EXPERT_COMET + "'/&gt;"; gNumComets++; break; } } return result; } // Rolls fortune dice function RollFortune (numDice) { 'use strict'; var result = ""; for (var a = 0; a &lt; numDice; a++) { switch(randomInteger(6)) { case 1: case 2: case 3: result += "&lt;img style='" + STYLE_DICE +"' src='" + WFRP_GRXURL_FORTUNE_BLANK + "'/&gt;"; break; case 4: result += "&lt;img style='" + STYLE_DICE +"' src='" + WFRP_GRXURL_FORTUNE_BOON + "'/&gt;"; gNumBoons++; break; case 5: case 6: result += "&lt;img style='" + STYLE_DICE +"' src='" + WFRP_GRXURL_FORTUNE_SUCCESS + "'/&gt;"; gNumSuccesses++; break; } } return result; } // Rolls misfortune dice function RollMisfortune (numDice) { 'use strict'; var result = ""; for (var a = 0; a &lt; numDice; a++) { switch(randomInteger(6)) { case 1: case 2: case 3: result += "&lt;img style='" + STYLE_DICE +"' src='" + WFRP_GRXURL_MISFORTUNE_BLANK + "'/&gt;"; break; case 4: result += "&lt;img style='" + STYLE_DICE +"' src='" + WFRP_GRXURL_MISFORTUNE_BANE + "'/&gt;"; gNumBoons--; break; case 5: case 6: result += "&lt;img style='" + STYLE_DICE +"' src='" + WFRP_GRXURL_MISFORTUNE_FAILURE + "'/&gt;"; gNumSuccesses--; break; } } return result; } // Rolls reckless dice function RollReckless (numDice) { 'use strict'; var result = ""; for (var a = 0; a &lt; numDice; a++) { switch(randomInteger(10)) { case 1: case 2: result += "&lt;img style='" + STYLE_DICE +"' src='" + WFRP_GRXURL_RECKLESS_BLANK + "'/&gt;"; break; case 3: case 4: result += "&lt;img style='" + STYLE_DICE +"' src='" + WFRP_GRXURL_RECKLESS_BANE + "'/&gt;"; gNumBoons--; break; case 5: result += "&lt;img style='" + STYLE_DICE +"' src='" + WFRP_GRXURL_RECKLESS_BOONS + "'/&gt;"; gNumBoons += 2; break; case 6: result += "&lt;img style='" + STYLE_DICE +"' src='" + WFRP_GRXURL_RECKLESS_BOONSUCCESS + "'/&gt;"; gNumBoons++; gNumSuccesses++; break; case 7: case 8: result += "&lt;img style='" + STYLE_DICE +"' src='" + WFRP_GRXURL_RECKLESS_EXERTSUCCESS + "'/&gt;"; gIsExerted = true; gNumSuccesses++; break; case 9: case 10: result += "&lt;img style='" + STYLE_DICE +"' src='" + WFRP_GRXURL_RECKLESS_SUCCESSES + "'/&gt;"; gNumSuccesses += 2; break; } } return result; }
That is totally awesome. Thank you so much!
1427310027
The Aaron
Pro
API Scripter
no worries! =D
Aaron, Did this script ever make it into the official repository? Should it? It would be nice if other people could find it and use it?
1431294535
The Aaron
Pro
API Scripter
I didn't add it. It's not my script, but I suppose I could put it in there... Ok, sent a pull request. I'll PM the original Author and let them know as well.
Thanks, I tried to reach the original author before I posted but I didn't hear anything back. Cheers for your help.