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

Deck and Card API

Continuation of&nbsp; <a href="https://app.roll20.net/forum/category/46806" rel="nofollow">https://app.roll20.net/forum/category/46806</a> So I'm live-streaming some roll20 scripting and am stuck... How do I manipulate a deck via scripting? The idea is that I have a page full of cards and desire to create a deck from the cards. Is this at all possible? /me *waves to&nbsp; <a href="https://www.twitch.tv/pintandpie" rel="nofollow">https://www.twitch.tv/pintandpie</a> &nbsp;*
1542779673

Edited 1542779726
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I do not think that decks are accessible to the API, at least not for what you are trying to do (create a deck), but I am asking around to see what I can find out. BTW, if this is a continuation of a previous conversation, be aware that your continuation link points toward the API forum as a whole, not a specific thread or post. If the context is important, see if you can flesh out that URL. Thanks.
I have a script working to populate an existing deck based on objects from the current page. I'll try to find the correct link and update. Thanks!
1542900385
GiGs
Pro
Sheet Author
API Scripter
Can you post the script?
Just created the repo on github so not cleaned up entirely. Pull-requests welcome! ;) <a href="https://github.com/thomasmckay/roll20-gloomhaven/blob/master/gloomhaven_deck_builder.js" rel="nofollow">https://github.com/thomasmckay/roll20-gloomhaven/blob/master/gloomhaven_deck_builder.js</a>
1542957282
GiGs
Pro
Sheet Author
API Scripter
Thanks! I'll check it out later.
The build-deck &nbsp;command is ready to be used, if anyone wants an easy way to build (and rebuild) card decks.&nbsp; <a href="https://github.com/thomasmckay/roll20-gloomhaven" rel="nofollow">https://github.com/thomasmckay/roll20-gloomhaven</a> &nbsp; If there are problems or ideas for improvements, please open a github issue. Alternatively, you can interact in my twitch chat (even if I'm not streaming live) and I'll respond there when I can. (I have chat open most of the day so be patient and I'll probably notice and respond.) <a href="https://www.twitch.tv/pintandpie" rel="nofollow">https://www.twitch.tv/pintandpie</a> &nbsp;(If you feel generous, click the follow button so I can up my twitch metrics ;) ) Happy new year! Game on!