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

Pulling a random token from a table with a Macro

Howdy! I've got a table here that I'd like to drop a token on the tabletop, and randomise it according to the weight it's given. As it is now, I can hit the token button, and then right click and randomise it.  Is there a way to add this to a macro? I looked over the wiki, but haven't had any luck. Thanks for the help.
1474514897

Edited 1474515038
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Having this be macro triggered would require the API. I have seen a few scripts that do something similar.&nbsp; This post actually shows exactly what you want, but I don't know what script the poster is using; it's not standard TokenMod commands. EDIT: here's the script:&nbsp;<a href="https://app.roll20.net/forum/post/2576603/script-change-token-image-from-rolltable/?pagenum=1" rel="nofollow">https://app.roll20.net/forum/post/2576603/script-change-token-image-from-rolltable/?pagenum=1</a>
1474516412
The Aaron
Pro
API Scripter
Note that the weights are not respected for Rollable Table Tokens. Their weight becomes effectively 1 each.&nbsp;
1474516606
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
ah, did not know that
1474517011
The Aaron
Pro
API Scripter
Yup. Reference:&nbsp; <a href="https://wiki.roll20.net/Card_Decks_and_Rollable_Ta" rel="nofollow">https://wiki.roll20.net/Card_Decks_and_Rollable_Ta</a>...
Scott C. said: Having this be macro triggered would require the API. I have seen a few scripts that do something similar.&nbsp; This post actually shows exactly what you want, but I don't know what script the poster is using; it's not standard TokenMod commands. EDIT: here's the script:&nbsp; <a href="https://app.roll20.net/forum/post/2576603/script-change-token-image-from-rolltable/?pagenum=1" rel="nofollow">https://app.roll20.net/forum/post/2576603/script-change-token-image-from-rolltable/?pagenum=1</a> Thanks, eh. &nbsp;I knew I had seen something similar recently. The Aaron said: Yup. Reference:&nbsp; <a href="https://wiki.roll20.net/Card_Decks_and_Rollable_Ta" rel="nofollow">https://wiki.roll20.net/Card_Decks_and_Rollable_Ta</a>... I guess I'll have to go another route, I need them weights. Thanks to you both for the help.
1474550815
The Aaron
Pro
API Scripter
You could probably modify that script to random roll the token based on the weights in a specified table.
The Aaron said: You could probably modify that script to random roll the token based on the weights in a specified table. I couldn't myself as I've no experience with scripts and their fiddley Jazz magic, and it's just a small project for myself. I can do the extra clicks. Thanks again, the help is always appreciated.&nbsp;
It would be possible to make a table with multiples of certain images to achieve the weighted results. That's the way the table weights work anyway, this would just be done manually. So if you have want a weight of 2 you would add the entry twice. That should work.