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] Comparison rolls

Guys, I am newbie in roll20 and recently acquired the pro license, could they help me with the syntax of a script that does the following: 1 - roll 5d6 2 - compare the result with each other d6 3 - where the resultador equals macro should display an image on the screen with the special result My doubt is that in item 2 I do not know what command to use to compare the results and to make the item 3 I thought I'd create a scrollable table with just one image for each unique possible result. The possible results are: if 1 1 then shows 1 table image if 1 1 1 then shows image of Table 2 if 1 1 1 1 then shows image Table 3 if 2 2 Then shows image Table 4 if 2 2 2 Then table shows the image 5 if 2 2 2 2 Then show table image 6 if 3 3 Then shows Table 7 image if 3 3 3 Then show table image - 8 if 3 3 3 3 Then show table image 9 if 4 4 Then shows table image 10 if 4 4 4 Then shows table image 11 if 4 4 4 4 Then shows table image 12 if 5 5 Then show table image 13 if 5 5 5 Then show table image 14 if 5 5 5 5 Then shows image Table 15 if 6 6 Then show table image 16 if 6 6 6 Then show table image 17 if 6 6 6 6 Then shows image Table 18
1473624275

Edited 1473624331
The Aaron
Pro
API Scripter
A couple questions to start out: 1) do you want help writing a script for it, or do you just want a script that does it? 2) is it always 5d6 or could the number or type change? Could there be modifiers applied? 3) Should every matching rule be used, or is there a hierarchy?  Example: 1 1 1 1 -- shows 3 images (Table 1, 2, & 3) or just 1 (Table 3)
Hello Aaron answered: 1) I always prefer to learn, but if you already have a script that does it no problems 2) Only 5d6 without modifying or larger or smaller amount of data 3) In the example, only shown in table 3
1473644440
The Aaron
Pro
API Scripter
Ok. If I were going to write this, is probably start with my Cthulhutech dice script (or BashDice or ZombieDice). I'd then change it to suit your needs. BashDice is probably simpler, maybe start there.  How is the order determined, highest dice or longest match? Example: 1 1 1 6 6 -- Image 2 or Image 16?
Hello Aaron, in this case would be 2 image and image 16
1473691602
The Aaron
Pro
API Scripter
Ah, so highest match for each type of die.  Ok, if you want to do this yourself, there's a function in those scripts above that will reduce the result of dice rolls into a count of the number occurring for each face. I'd build an object similar to this: var imgs={ 1: { 2: '<image 1 URL>', 3: '<image 2 URL>', 4: '<image 3 URL>' }, 2: { 2: '<image 4 URL>', ... Then use the dice counts to reference into it for each of the images to display.  Does that make sense?
Aaron, excuse my naiveté, I read your bashdice and understand the logic but the syntax me is very strange, I thought I would be able to understand the operation of api scripts for having already used some of the LUA language to make chips and scripts in another tool online rpg but could not understand much of the API and study it will require me a while I would not want to wait to start playing, would you please help me doing this script? I ended up making a mistake in the description above, the amount of dice rolled is 4d6 and every combination of numbers repeated the scroll generate a different image. Another question, you can use an API script and the dice roll in 3D?
1474161206
The Aaron
Pro
API Scripter
Sure, I can help you. It may be a few weeks before I get the chance, but I'll try to slip it in sooner.&nbsp; You csn use the 3D Dice with the API. I'd likely just parse whatever inline roll is passed to the command, so whatever setting the player executing the command uses would determine the 3D dice display: !rollit [[4d6]] What's the name of the system this is for? As for understanding the API, I made some suggestions here:&nbsp; <a href="https://app.roll20.net/forum/post/2877778/update-1" rel="nofollow">https://app.roll20.net/forum/post/2877778/update-1</a>...
Hello Aaron, thanks for the availability is for a board game created by a friend called zombie attack. It is a simple game with only this scroll being made at the end of each round.
1474162305
The Aaron
Pro
API Scripter
Ok. For ease of use I'm thinking I'll setup a rollable table named ZombieAttack with rows named 1,11,111,1111,2,22,222,2222,etc. when the command: !zombie-attack [[4d6]] is executed, it will use the images in the table for the matching roll to show the results.&nbsp;
1474164592

Edited 1474164629
ThiagoR
Sheet Author
Ok! Thanks!