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

Need help making a macro for Cashmaster API

Hi all, My players like to make bets between themselves and lend each other money during games, and was hoping to write a macro for the cashmaster API script to allow them to quickly and easily swap cash with one another. I just cant figure out how. Reading the notes there is a way to use @{target|character_id} and @{selected|character_id}, I am also trying to use a query so they can easily edit the amount they wish to transfer. I was thinking along the lines of !cm -t @{target|character_id} ?{how much?|0pp 0gp 0ep 0sp 0cp} or !cm -t @{target|character_id} ?{how much?|0} ?{what denomination?|pp|gp|ep|sp|cp} the query/ies work fine, but I get an error report in chat (From CashMaster): ERROR: Invalid Input. Validate that a subject is provided and input is not malformed. In response to Aaron M.'s command !cm -t -MK6EBGPMnBMkIvMgHdn0pp 5gp 0ep 0sp 0cp I know it is me making the mistake, but for the life of me I can't figure out how to get it to work. any help/advice would be greatly appreciated. Thanks, Aaron.
1628635376
timmaugh
Forum Champion
API Scripter
Not sure if this is the culprit, but when you use a targeting statement, you lose the array of selected tokens in the message object. Things like @{selected|token_id} Will still resolve, but if the script is planning on looking in the message object to find a selected token, it won't be there. Typically, if a script is set up this way, it will give you the opportunity to add another ID in the command line, so if you had a source and a target for the transaction, you could provide both IDs. If you don't see that option with Cash master, and if this is the problem you are running into, you can get around it by installing SelectManager, and then adding this to your line (somewhere): {&select @{selected|token_id}}
timmaugh said: Not sure if this is the culprit, but when you use a targeting statement, you lose the array of selected tokens in the message object. Things like @{selected|token_id} Will still resolve, but if the script is planning on looking in the message object to find a selected token, it won't be there. Typically, if a script is set up this way, it will give you the opportunity to add another ID in the command line, so if you had a source and a target for the transaction, you could provide both IDs. If you don't see that option with Cash master, and if this is the problem you are running into, you can get around it by installing SelectManager, and then adding this to your line (somewhere): {&select @{selected|token_id}} Thanks, I'll have a look at select manager and keep working through to see if I can figure something out.
1628687664
Kraynic
Pro
Sheet Author
Karen W. said: I'm still new to creating macros and am currently having a problem with my spellbook. I want a macro that will show my spellbook (with buttons for every spell level) and when I click on these buttons will show me all available spells for that level. Bot using text from a 2019 reddit post.  Sneaky...
I figured it out, it took a lot of finking, but i had to use multiple queries for the players to select one another and use double quotations to differentiate between payer/reciever of the money. plus I missed a few commands... this is what I came up with in the end: !cm -transfer -S "?{who is paying|Celano|Gideon Whistlewind|Leiro|Lady Seline|Rudy Craterhoof}" -T "?{who is the recipient|Celano|Gideon Whistlewind|Leiro|Lady Seline|Rudy Craterhoof}" -C " ?{how much?|0pp 0gp 0ep 0sp 0cp}"