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]Macro for Recalling/Shuffeling cards

1457180522

Edited 1457184682
Is there a macro around that will allow you to recall and shuffle a deck without having to click on recall, click shuffle, and then press recall all? I'd write one but I don't know how or even if its possible.
1457188417
The Aaron
Pro
API Scripter
I'm sorry to say it is not currently possible. There is a suggestion for better API access to cards that I'd love to see get some attention. 
Thanks. Sadly though I didn't realize API was a Pro only function until I posted here. Macro access to cards really should be a fundamental feature, especially as some systems might use cards in place of dice.
1457191798
The Aaron
Pro
API Scripter
If you don't mind using a bookmarklet, you can do what you want in the browser.  You'd just need to put this as a bookmark (in Chrome, I'm not sure on firefox).  You'll need to replace the bold/underline part with the deck id of the deck you want to affect.  You can right click the deck and inspect it, then look for the data-deckid property and copy the contents. javascript:$('.adeck .deckstack[data-deckid=" A778E120-672D-49D0-BAF8-8646DA3D3FAC "] .control .recall').click();setTimeout(function(){$('.ui-dialog input.shuffle').click();$('.ui-dialog button.ui-button')[0].click();},100);
The Aaron said: If you don't mind using a bookmarklet, you can do what you want in the browser.  You'd just need to put this as a bookmark (in Chrome, I'm not sure on firefox).  You'll need to replace the bold/underline part with the deck id of the deck you want to affect.  You can right click the deck and inspect it, then look for the data-deckid property and copy the contents. javascript:$('.adeck .deckstack[data-deckid=" A778E120-672D-49D0-BAF8-8646DA3D3FAC "] .control .recall').click();setTimeout(function(){$('.ui-dialog input.shuffle').click();$('.ui-dialog button.ui-button')[0].click();},100); Do you have to be Pro to inspect the deck? Because all I get when I right click the deck is the option to save the image.
1457200065
The Aaron
Pro
API Scripter
No, but you'd need to be in chrome probably. If you want to pm me an invite, I can jump in and find the ID for you. 
1457200944

Edited 1457202496
I think I found it. Would the following be the right element? <div data-deckid="-KC62YPNTb2PGSDh4MvJ"> *edit* I got it working on chrome. Though for some reason Firefox is choking on it. But I have no problem with running my games in another browser if I have to. Thank you very much, Aaron. you're a great guy.
1457207836
The Aaron
Pro
API Scripter
No problem!  Happy to help!
I'm really thankful for this. I'm working on a system that uses card draws to determine probability so I draw from the deck instead of rolling. You've just sped up my game-play significantly . Thank you again.
1457230694
The Aaron
Pro
API Scripter
No worries!  If you've got other pain points with the decks I might be able to help with those too. :)
The Aaron said: No worries!  If you've got other pain points with the decks I might be able to help with those too. :) That's the main one for now. Only thing more I wish we had was the ability to click to draw multiple times without it covering itself over rather than dragging it off. But that's probably beyond macros and Bookmarklets And thank you again.
1457248384
The Aaron
Pro
API Scripter
Yeah, that's probably not something I could help with.  If you needed to deal a known number of cards to a known individual, I could craft you a bookmarklet that would do that, but that's as close as I can likely come there. 
Actually that Bookmarklet might actually be really useful. I'd have to have people's hand windows open but I could quickly see what they get. Thank you, Aaron.
1457282395

Edited 1457282435
The Aaron
Pro
API Scripter
Hmmm..  I did some initial digging and that probably won't be possible, at least not easily.  Finding a way to get the player specified is problematic.   The best I can come up with is a bookmarklet that pops open the dialog for dealing the deck, prefills the number of cards to deal and focuses the player selection input: javascript:$('.adeck .deckstack[data-deckid=" A778E120-672D-49D0-BAF8-8646DA3D3FAC "] .control .deal').click();;setTimeout(function(){$('.ui-dialog input.numcards').val( 3 ); $('.ui-dialog li.search-field input').focus()   }, 100); The bold/underline 3 is the number of cards, the bold/underlined ID is the deck ID as before.
Thank you.
I'm with you, Aaron. I think the Card Decks could become very powerful, if their program design could just be worked on a little. I'm going to go take a look at the Card Deck suggestion list to see what's there. Decks would become very cool if we could tie them into the Character Sheets and to the Chat journal. I want to use player-specific card decks to manage certain kinds of player resources (like limited use spells and abilities) in place of the bottom-bar macros, but deck interactions are not logged or represented anywhere. As it stands, my biggest complaint about them is that you must shuffle the deck in order to use it.
1458151101
The Aaron
Pro
API Scripter
Yeah.  I'd like to see Hands associated with more than just the player.  Character at least, but token could be nice, as could handout.  Rollable table that results in a hand would be interesting.  If the API could create decks and hands, and manipulate them, it would be extremely easy to make some very cool things.  Deck building games would certainly be possible.  Having a visual discard pile and some more options for card style alignments on table would be grand.