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

[Help] Improving my secret dice roll command...

Ok, so here's what I have... // Make a roll only the GM can see. Do NOT use any double square brackets for inline rolls! // Usage: !sroll diceroll if (msg.type == "api" && command == "!sroll") { msg.content = msg.content.replace("!sroll", ""); msg.content = msg.content.trim(); sendChat("Secret Roll by " + msg.who, "/w gm [[" + msg.content + " ]]"); } ... and I want to make it so that when you use !sroll it lets you do any kind of dice roll with all the square and curly brackets you want and then sends it to the GM in a whisper from a source other than the person triggering the script.
1388861321
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
//API:Events:ChatMessage:processAPIswitch:common:broll********************************************** roll20API.processAPIbroll = function() { if(roll20API.Dice == undefined){ sendChat("API", "/w " + roll20API.FirstName + " You must send a valide dice roll with this command."); sendChat("API", "/w " + roll20API.FirstName + " Example: /broll (1d100+20) to hide in shadows."); sendChat("API", "/w " + roll20API.FirstName + " Example: /broll 1d100"); }else{ sendChat(roll20API.FirstName + " (Blind)", "/gmroll " + roll20API.message); sendChat("API", "/w " + roll20API.FirstName + " Blind roll sent to GM (" + roll20API.message + ")"); }; }; This is what I use for "!broll" (Blind Roll) Tells the GM who it is from... and tells the player the dice was sent. Earlier in the process I check for a valid dice roll.
Do the players actually use /broll or !broll ?
1388947299

Edited 1388947622
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
!broll... Macro example: !broll 1d100 % for thieving skills • @{Pick_Pockets}% Pick Pockets • @{Find_Remove}% Find/Remove Traps • @{Move_Silently}% Move Silently • @{Hide_Shadows}% Hide in Shadows • @{Detect_Noise}% Detect Noise Player see as a whisper: (From API): Blind roll sent to GM (1d100 % for thieving skills) GM sees as a whisper: Steve (Blind):(To GM) rolling 1d100 % for thieving skills ( 16)= 1
Ah, cool.