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] Blind Roll script SyntaxError

1412968888
vÍnce
Pro
Sheet Author
I'm using the blind roll (!broll) script found from this archived post, Hide player dice roll from the player on("chat:message", function(msg) { var cmdName = "!broll "; var msgTxt = msg.content; var msgWho = msg.who; var msgFormula = msgTxt.slice(cmdName.length); if(msg.type == "api" && msgTxt.indexOf(cmdName) !== -1) { sendChat(msgWho, "/gmroll " + msgFormula); sendChat(msgWho, "/w " + msgWho + " secret roll sent to GM (" + msgFormula + ")"); }; }); When I perform a !broll from chat the output is what's expected. However, when I check the API output console, it shows {"name":"SyntaxError","expected":["\"(\"","\".\"","\"[\"","\"abs(\"","\"ceil(\"","\"d\"","\"floor(\"","\"round(\"","\"t\"","\"{\"","[ |\\t]","[+|\\-]","[0-9]"],"found":"A","message":"Expected \"(\", \".\", \"[\", \"abs(\", \"ceil(\", \"d\", \"floor(\", \"round(\", \"t\", \"{\", [ |\\t], [+|\\-] or [0-9] but \"A\" found.","offset":0,"line":1,"column":1} {"who":"error","type":"error","content":"There was an error with your formula. Please try again."} Those are actually two separate lines. (wrap issue...) Total js newb. Suggestions? Thanks.
1412969411
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
"!broll 1d6" The code as written wont support the math you are trying to apply.
1412970497
Lithl
Pro
Sheet Author
API Scripter
What is the roll you're attempting? At a guess, you're trying to use a character's attribute that doesn't exist, and the character's name begins with A.
1412972574

Edited 1412972712
vÍnce
Pro
Sheet Author
I'm actually just wanting to pull some info from a target token !broll AC: @{target|bar1} HP: @{target|bar3} So, I'm not "rolling" per say. The data gets sent fine to the chat window. The characters name in this example is "Kyra". The !broll is only one line of a token macro and I'm running the macro while logged in as the GM. Could a GM essentially using !broll to himself cause the error? EDIT: update. No. Just tried running the !broll logged in as a player, same errors in console.
The function you posted will only work on things that work with "/gmroll" (because the first thing it does is replaces "!broll" with "/gmroll" and resubmits it). You'll probably want to replace the "/gmroll" in the function with "/w gm" to send arbitrary blind whispers to the GM.
1412983854

Edited 1412984301
vÍnce
Pro
Sheet Author
Using "/w gm" removes the syntaxerror, but it also negates the purpose of the blindroll. I don't want the player to know the the HP and AC of their target. My idea was to allow players a macro that targets a token, rolls the attack and damage (in case they hit), displays this info in open chat, while also sending the GM the HP and AC of their target. I thought the !broll script would work, but I didn't realize it can only be used for rolling dice. Bummer.
It's impossible to hide the HP and AC. The player can just make a macro that does /w Name @{target||bar1} and get the current value of bar1. They can also replace bar1 with any attribute name they can think of and fish for the values.
1412986229
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Encryption for the value... just saying.
1412987445

Edited 1412987507
vÍnce
Pro
Sheet Author
I'm not worried about the players cheating. Grabbing the AC and HP from a monster in a macro that only the GM can see should be childs play for roll20, but sadly there doesn't seem to be a way to do it. The purpose of a blind roll, I assume, was to not let a player know the extent of their success or failure. "Was I spotted by the Kings guard?", "Did I disable the trap, completely?", "Did the constable believe my story?" Many GM's will roll this for the players. I like that a player can initiate the action without immediately knowing the outcome. I was just trying to add this little modecum of "Dm-only" info into a single attack macro. It's a trivial thing and I'm not sure why I've wasted this much effort on it. lol
1412992178
Gen Kitty
Forum Champion
You can have blind rolls! You want to go get HoneyBadger's Power Card Script <a href="https://app.roll20.net/forum/post/1054686/script-power-cards" rel="nofollow">https://app.roll20.net/forum/post/1054686/script-power-cards</a> and check out the --whisp| option. I'm using it myself.
That's a bit overkill for just a simple blind roll, lol.
1412992765
vÍnce
Pro
Sheet Author
Thanks GenKittly. Trying to get my head wrapped around my newly acquired Mentor benefits... I've seen some cool screenshots of the Power Card in action. Putting on my reading glasses.
1412996358
Gen Kitty
Forum Champion
Hey, HB, you're the only one with a script I know of that does blind rolls /properly/. I guess there's no kill like overkill. And after all the hours I've put into writing cards, it seems super simple now. x.x
1412997933
vÍnce
Pro
Sheet Author
The PowerCrads are way cool. Just started making an attack card and playing with the --whisper| I was disappointed that I couldn't send just one line of the macro to the GM, it appears to send the entire card. DO NOT CRINGE HoneyBadger, but I found that I could actually enter a second !power tag in the macro and it would kick out a second card (title only), but I could call the AC and HP of the targeted token and send it with the whisper| tag. Yeah! I'm sure I'm totally doing this wrong. I'll continue to mess around. PowerCards look very promising.
1413006936

Edited 1413007025
Lithl
Pro
Sheet Author
API Scripter
!broll uses the /gmroll command, which is the same syntax as the /roll command -- it expects a dice expression. However if you're dead-set on using !broll without modification, you could use !broll [AC: @{target|bar1} HP: @{target|bar3}] d0 The single brackets denotes a comment. The GM will receive a roll of "0", as well as the text you're trying to send. Another option might be to break it up onto two lines: !broll [AC:] @{target|bar1} !broll [HP:] @{target|bar3}
1413007787
vÍnce
Pro
Sheet Author
Thanks Brian. !broll [AC: @{target|bar1} HP: @{target|bar3}] d0 Works. Ugly, but it works. Yeah! The second example still kicks out syntax errors. I haven't given up on using !broll just yet, but I think using the PowerCard script with --whisper| might solve my issues.
1413031643

Edited 1413031727
Since players are going to be using these macros, they're going to see that you're using bar1 and bar3 for AC/HP. As I said before, they can just send a whisper to themselves like... /w HoneyBadger AC @{target||bar1} | HP @{target||bar3}/@{target||bar3|max} ... and see the stats you're trying to hide from them. The only way to truly hide the stats would be to use the API for everything and obfuscate all rolls, including damage rolls and tell them they did minor, moderate, heavy, damage or something. Smart players can figure out how much hp something has after a few hits and what the target number is to hit the monster after a few attack rolls.
1413041731
vÍnce
Pro
Sheet Author
You're right HB. I'm not worried about my players trying to "game" the system. If they want to go that route, and I highly doubt it since it's not the game we play, then so be it. It was more about getting a single macro that the player could use that would; 1. Announces their attack and target 2. Openly roll attack\damage\etc., for expediency 3. Give the GM other "above board" info about the target, hp\ac\etc., for expediency and secrecy 4. Allow the GM to narrate the outcome I understand that some people play with a great deal of openness in regards to player and npc\monster stats, like a chess match, and that any player that has been around the block will quickly recall this info from past encounters. Heck, even within a given encounter players should begin to pick up on what they need to-hit and how much punishment they need to deal out, That's fine. I still like to keep them guessing as long as possible without handing it over and turning my game into just numbers on the table. More like a chess match with most of the pieces hidden. I can't wait to dig deeper into utilizing your PowerCard script. Thanks for sharing all that work. I know many of the roll20 community are very appreciative.
There is something to be said for open stats. If the player knows the outcome of their attack right away, they can describe the attack more accurately instead of couching it in if's and maybe's language. Here's the macro output I'll be using for my D&D 5e hexcrawl campaign. The player making this attack would hit the macro and then narrate the effects of their attack more accurately since they can see they crit and it definitely hit. Or if they had disadvantage, they could narrate the miss.
1413046314
Gen Kitty
Forum Champion
For the sake of speeding up combat (which drags on and on and ON in my 4e game sometimes), I've decided to be open about AC/Fort/Reflex/Will defenses in everyone's macros. This just causes me to want to be even stricter about hiding stealth/perception/bluff/intimidate/whatever rolls. x.x
Sorta off topic... but to speed up 4e combat... cut all monster HP in half and add a little extra damage to their attacks. It really works and doesn't affect the game much, other than making combat faster.
1413053819
Gen Kitty
Forum Champion
If I cut monster HP in half, the majority of my monsters will die without ever taking an action :&gt; Your powercards script should see combats shortening timewise. Combats aren't long because they go on for many rounds, they're usually over in 3-5 rounds. Combats are long because my players dawdle, or were needing to look up rules (again) before using a power, or aren't good about giving me everything I need to resolve one of their attacks. The hours I spent/spend making powercards should payback with much shorter player turns in the end, once everyone is used to the roll20 system (tomorrow is our second game on roll20). Getting back to the topic, I'll update this thread shortly with some of my macros from my 4e game so people can see the possibilities with hidden roll cards.
1413060967
Gen Kitty
Forum Champion
So I promised some of my macros! Party Perception Macro, something I activate !power --name|**Party Perception** --bgcolor|#0184C4 --whisper| --1|[[10+@{Ekima|HalfLevel}+@{Ekima|DEX}]] P [[1d20+@{Ekima|HalfLevel}+@{Ekima|DEX}]] A Ekima --2|[[10+@{Kai|HalfLevel}+@{Kai|DEX}]] P [[1d20+@{Kai|HalfLevel}+@{Kai|DEX}]] A Kai --3|[[10+@{Legius|HalfLevel}+@{Legius|DEX}]] P [[1d20+@{Legius|HalfLevel}+@{Legius|DEX}]] A Legius --4|[[10+@{Rizzak|HalfLevel}+@{Rizzak|DEX}]] P [[1d20+@{Rizzak|HalfLevel}+@{Rizzak|DEX}]] A Rizzak --5|[[10+@{Sha-Korat|HalfLevel}+@{Sha-Korat|DEX}]] P [[1d20+@{Sha-Korat|HalfLevel}+@{Sha-Korat|DEX}]] A Sha-Korat Single Person Perception Check, activated by the player !power --name|**@{selected|token_name} | Perception** --bgcolor|#0184C4 --leftsub|Skill Check --rightsub|N/A --whisper| --Result|[[ 1d20+@{HalfLevel}+ @{Wis} +5+?{MiscMod?|0} ]] A | [[ 10+@{HalfLevel}+ @{Wis} +5+?{MiscMod?} ]] P I get the following output (I want both active and passive numbers because generally your passive is the worst you can do outside of combat) So far I'm only using hidden rolls, as a GM, for stealth and perception. I'll be adding other rolls as time goes by. I'd be interested in seeing your macro you mentioned earlier, Vince, the one with the two !powers.
1413063984

Edited 1413071090
vÍnce
Pro
Sheet Author
GenKitty said: I'd be interested in seeing your macro you mentioned earlier, Vince, the one with the two !powers. It's not pretty, well, pretty ugly. I am not familiar at all with the powercard script, so I'm sure there's some cool formating that could be done to make this look MUCH better. I'm sure this wasn't designed to work like this by using 2 !power's, but it seems to work and doesn't crash the script. Please run with this. I would like to see what someone who knows what they are doing can do with it. !power --name|Melee Attack --emote|@{selected|token_name} is attacking @{target|token_name} --attack|[[1d20+@{selected|attk-melee}]] D: [[1d6+@{selected|STR-mod}]] !power --name|AC: [[@{target|ac}]] HP: [[@{target|hp}]] --whisper|
1413077446
Gen Kitty
Forum Champion
That's actually very slick! It /never/ occurred to me to use the --name for something like that. I don't play 5e (This looks like 5e), so I can't comment on the macro beyond that. I am SO stealing using --name for one-line results. I wonder if --name supports the [HR] modifier....
1413082216

Edited 1413082454
vÍnce
Pro
Sheet Author
It might accept lots of things. I don't know enough of what's "allowed" so I usually just play around till either a break it or find something useful. We're actually playing PF, and I normally pull from Sam's sheet, but this was a quick proof of concept. Nothing seems to work after the header of the second card however. I imagine you can modify the powercard script to accommodate some more room if needed. It might expand to fit whatever you need however, :-) Update: The second cards header will expand to accept whatever you put in it. Nice.