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

I want to go Pro-membership - Dice macro

Hi all. I am totally prepared to go for Pro membership if there is a macro that could help me set my dices up for my campaign. The rules are as follows. You skills are based on an amount of D6. The better your skill, the more D6 you get to roll (If you have skill value of 2 you get to roll 2D6, if your skill is 5 you get to roll 5D6) ¤For every 6 rolled, you remove that 6 and roll two new dice. Example 1 I roll 3D6 and get 2 4 6 I remove the 6 and roll 2D6 and get 1 3 Since there are no more 6 on the board, i add up the total of 2+4+1+3=10 Example 2 I roll 3D6 and get 2 6 6 I remove the two 6 and roll 4D6 (2 for every 6), i get 1, 3, 5, 6 I remove the 6 and roll 2D6 and get 2, 4 Since there are no more 6 i add up the total -> 2+1+3+5+2+4=17 So basicly I would need a dice system that removed every 6 and add two new D6 untill there are no more sixes on the board. Could someone be kind enough to help me with this, or point me in a direction?  I have no issue with paying for membership if this was to work. Thanks in advance Regards Daniel
so you're running a variation on exploding dice? you could go with /r 2d6!6 that would make it reroll every six until there are no more sixes and add the total together.
not sure on making it roll 2 additional dice.
1519224048

Edited 1519224066
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
This is certainly doable with a custom API script. I'd ask the mods to shift this down to the API forum.
1519226330

Edited 1519226388
Ziechael
Forum Champion
Sheet Author
API Scripter
Use of the API would require a Pro subscription but since you are prepared to go there already this is just for reference :) Scott C. said: This is certainly doable with a custom API script. I'd ask the mods to shift this down to the API forum. Who says it hasn't been there this whole time... ;)
1519229335
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Ziechael said: Use of the API would require a Pro subscription but since you are prepared to go there already this is just for reference :) Scott C. said: This is certainly doable with a custom API script. I'd ask the mods to shift this down to the API forum. Who says it hasn't been there this whole time... ;) Oh, look at that. My eyes deceived me ;)
Scott C. said: Ziechael said: Use of the API would require a Pro subscription but since you are prepared to go there already this is just for reference :) Scott C. said: This is certainly doable with a custom API script. I'd ask the mods to shift this down to the API forum. Who says it hasn't been there this whole time... ;) Oh, look at that. My eyes deceived me ;) Oh look at that. I appear to have posted it in the API section all along ;) So, for someone who isnt an API scripter, is there a way to solve this? Or do I need to learn scripting?
1519246895

Edited 1519246952
I found this on an old forum, but when I tried it, it didnt work. Is that cause Im not a PRO user yet? Or is there a flaw which I cant see? OB dices: [CODE]on("chat:message", function(msg) { if (msg.type != "api") return; var message = msg.content; var command = message.split(" ")[0]; var numrolls = parseInt(message.split(" ")[1]); var outroll = "ob" + message.split(" ")[1] + ": "; if(message.search(/\+/g)!=-1){ var plus = parseInt(message.split("+")[1]); var times = 0 } else if(message.search(/\*/g)!=-1){ var times = parseInt(message.split("*")[1]); var plus = 0 } else{ var plus = 0 var times = 0 } if (command == "!ob") { var count = 0; var total = 0; var roll = 0; var first = true; var output = "<b>" + outroll + "<br>" ; while (count < numrolls) { roll = randomInteger(6); if (roll === 6) { if(first == true){ output = output + "<i>[6]</i>" first = false; numrolls = numrolls + 2; } else{ output = output + ",<i>[6]</i>" numrolls = numrolls + 2; } } else { total += roll; if(first == true){ output = output + roll; first = false; } else{ output = output + "," + roll; } } count++; } if(plus > 0 && times == 0){ sendChat(msg.who, output + " = " + total + "+" + plus + " <br><u>Total: " + (total+plus) + "</u></b>"); } else if(plus == 0 && times > 0){ sendChat(msg.who, output + " = " + total + "*" + times + " <br><u>Total: " + (total*times) + "</u></b>"); } else{ sendChat(msg.who, output + "<br><u>Total: " + (total) + "</u></b>"); } } }); [/CODE]
1519247091
The Aaron
Pro
API Scripter
The code must be placed on the API scripts page, which you don't have access to until you are a Pro subscriber.
Ah thanks Aaron, Ill go and subscribe right away. (Also, Ive just read a lot from you at this link&nbsp; <a href="https://app.roll20.net/forum/post/1408851/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/1408851/slug%7D</a> ) Its the same guy who I just stole this code from
There, I guess I am a Pro now ;) Ill go and test the macro and see what happens.
Ps, it works great
1519255626
The Aaron
Pro
API Scripter
Sweet! :)
1519266229
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Welcome to the fun part of the pool!
1519296134
Ziechael
Forum Champion
Sheet Author
API Scripter
It starts with a custom die roller... before long you'll be dabbling with conditional logic, automatic sound effects and patrolling tokens. Welcome to Pro!
Ziechael said: It starts with a custom die roller... before long you'll be dabbling with conditional logic, automatic sound effects and patrolling tokens. Welcome to Pro! to much code for me but i agree with the spirit of the comment i started with recursive tables , then token action, next is bump i think... i think this time next year mine will be full of the Aaron codes :D&nbsp;
1519322244
The Aaron
Pro
API Scripter
I know mine is full of The Aaron codes. =D
1519325969
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Aaron, every pro user's game is full of your code :)
1519326951
GiGs
Pro
Sheet Author
API Scripter
This has to be true!
1519327205
Ziechael
Forum Champion
Sheet Author
API Scripter
Scott C. said: Aaron, every pro user's game is full of your code :) With a fair smattering of yours too Scott!
Haha Yea. I can honestly say that Ive been hard at work since last post with the coding.&nbsp; I have set up the dices, macros and character sheet now (All with outside help and none with my own knowledge =/ ) This will be fun