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

[Script] CashMaster 5e - a simple script to manage a party's money.

1515581139

Edited 1536508843
Arthur B
API Scripter
Update: The command syntax has slightly changed with the latest version. Please see instructions below. I'm a GM for a small group, and one of my players always struggles when it comes to handling the money. Whenever the party got some coins as reward or they were buying supplies, this player was always over-challenged with adding and subtracting the amounts - especially if it involved converting from one coin type to another (and electrum coins always made her rage-quit ^^). So I tried to assemble a small script that helps me as a GM to take care for it directly. It currently works with the 5th OGL character sheet only - never tested it on anything else. That being said - I'm not a programmer, so the code probably is quite messy. But it does what it is supposed to do, so I'm fine with that. Latest version of Cashmaster (v0.9.1) --- CashMaster A currency management script for the D&D 5e OGL sheets on Roll20.net. Please use  !cm  for inline help and examples. Setup Player Setup Create a macro bar button for the command  !cm -menu Press the CashMaster button you just created. It will display a menu in the chat log. Click on your character token Press the chat UI button titled Set Default Character. GM Setup Create a macro bar button for the command  !cm -menu Press the CashMaster button you just created. It will display a menu in the chat log. Select the character tokens of ALL party members and companion NPCs. Do not select pets or mounts unless the party considers them an equal member of the party (and thus should be a valid recipient for  -loot  and similar commands). Such creatures must have full character sheets with currency fields. Press the chat UI button titled Set Party to Selected. For each shopkeeper, press the [Show Shop on Selected] button in the menu. The shopkeeper must have a character sheet and the token must point to it. Player Commands Help Commands !cm  or  !cm -help  or  !cm -h  will show this help overview !cm -menu  or  !cm -tool  to bring up the user menu !cm -status  or  !cm -ss  to display your current coin purse contents Accounting commands A character has a tracked account if it has discrete values for its saved coins. PCs necessarily have tracked accounts while NPCs usually do not, instead having as much gold as the DM feels is necessary at that moment. -  !cm -transfer "[recipient character name]" [amount][currency]  or  !cm -t "[recipient character name]" [amount][currency]  to transfer coins to the recipient's tracked account. -  !cm -invoice "[recipient character name]" [amount][currency]  or  !cm -i "[recipient character name]" [amount][currency]  to request coins to the recipient's tracked account. -  !cm -giveNPC "[NPC Name, service rendered]" [amount][currency]  or  !cm -dropWithReason "[reason for dropping coins]" [amount][currency]  to move coins from the player's tracked account to an untracked account. Shop Commands !cm -viewShop  or  !cm -vs  will display the shop data of the selected token to all players. The GM is presented with both the player view and the edit view. !cm -viewItem "[item name]^[shopkeeper name]"  will display the details of a particular item from the specified shopkeeper. This is used when the GM sets verbosity to low. !cm -buy "[item name]^[shopkeeper name]"  will attempt to purchase the named item from the named shopkeeper. If you have sufficient funds, the funds will be removed and you will be presented with a purchase message. If you are using the OGL character sheet, you will also find it transferred into your inventory. GM Commands In addition to the above commands, the GM has access to the following commands. Help commands !cm  or  !cm -help  or  !cm -h  will show this help overview !cm -overview  or  !cm -o  to get an  overview  over the party's cash !cm -overview --usd  will also give you an overview and a rough conversion to USD (default value: 1 gp equals roughly 110 USD). Accounting Commands These operations directly add and remove gold from party inventories. -  !cm -add [amount][currency]  or  !cm -a [amount][currency]  to  add  an equal amount of money to each selected party member, -  !cm -loot [amount][currency]  or  !cm -l [amount][currency]  to  split up  a certain amount of coins between the party members, like a found treasure. Note that in this case, no conversion between the different coin types is made - if a party of 5 shares 4 pp, then 4 party members receive one pp each, and the last member won't get anything. -  !cm -sub [amount][currency]  or  !cm -pay [amount][currency]  or  !cm -p [amount][currency]  to let each selected party member  pay  a certain amount. The script will even try to take higher and lower coin types to get the full amount. E.g. to pay 1gp when the character has no gold, the script will use 1pp (and return 9gp), or it will take 2ep, 10sp or 100cp - or any other valid combination of coins - to pay the desired amount. Admin Commands Use caution when using the below commands. -  !cm -merge  or  !cm -m  to  merge  coins to the densest denomination possible. -  !cm -share  or  !cm -s  to  reallocate and share  the money equally between selected party members, converting the amount into the best combination of gold, silver and copper (this should be used in smaller stores), -  !cm -best-share  or  !cm -bs  to  reallocate and share  the money equally between selected party members, converting the amount into the best combination of platinum, gold, electrum, silver and copper (this should only be used in larger stores that have a fair amount of cash), -  !cm -setParty  or  !cm -sp  to set the default party list. These will be the default targets for party actions if you have nothing selected. -  !cm -revert  or  !cm -r  reverts a given transaction id. This is an internal command used to revert transactions. Shop Commands These commands set up and manipulate shops. -  !cm -makeShop "[shop name]^[shop location]^[shop appearance]^[shopkeeper appearance]  creates a shop for the selected character token with the assigned attributes. The token must point to a character sheet. If you wish to have a single shop with multiple shopkeepers, use rollable tables and have them feed to the same character sheet for the shop. -  !cm -setShopVerbosity [high|low]  sets the amount of information that is printed out when displaying a shop. -  !cm -updateShop "[parameter name]^[parameter value]"  will update the named parameter to the new value. -  !cm -addItem "[item name]^[price]^[description]^[quantity]^[weight]^[properties]^[modifiers]"  creates a new item in the selected token's shop. -  !cm -updateItem "[item name]^[parameter name]^[parameter value]"  will look up the specified item name in the selected token's shop and update the named parameter to be the specified value. -  !cm -updateItem "[item name]^DELETE^YES"  will delete the specified item from the selected token's shop. -  !cm -updateItem "[item name]^DUPLICATE^YES"  will duplicate the specified item, adding a new item to the end of the shop's list of items named  "Copy of [item name]" . Tips -noToken  and  -nt  will cause CashMaster to disregard what character is selected. You can use several coin values at once, e.g.  !cm -loot 50gp 150sp 2000cp  or  !cm -pay 2sp 5cp . You can combine multiple subcommands into a single chat command with a double-semicolon  ;;  between them. For example,  !cm -add 5gp; -merge You can select multiple subjects and targets using  Advanced Mode . For example,  !cm -transfer -S "Billy Bob^Joe Bob" -T "Sarah Bob^Sonya Bob" -C "10gp" . When using multiple subjects and targets, it will perform an operation for each subject-target pair. In that case, it will perform four transactions of 10gp each. In  Advanced Mode , you don't need to specify  -C "[amoung][currency]"  and can instead just use the standard  [amount][currency] . The  -C currency tag allows you to specify the gp value at a particular point in the command in case you have strangley-named or inconveniently ID'd characters. CashMaster will parse  both character IDs and character names . You can even mix and match! If Billy Bob's ID was  -L4ncF3ych3ZLtWaY3uY , Instead of the example in  Tip 4 , you could use  !cm -transfer -S "-L4ncF3ych3ZLtWaY3uY^Joe Bob" -T "Sarah Bob^Sonya Bob" -C "10gp" . CashMaster is compatible with  @{selected|character_id}  and  @{target|character_id}  as they will simply be parsed down to IDs. As an example, your players could use  !cm -t -T "@{target|character_id}" 1gp  to transfer a gold amongst themselves. Examples !cm -overview  will show a cash overview. !cm -add 50gp  will add 50 gp to every selected character. !cm -loot 50gp  will (more or less evenly) distribute 50 gp among the party members. !cm -pay 10gp  will subtract 10gp from each selected character. It will try to exchange the other coin types (e.g. it will use 1pp if the player doesn't have 10gp). !cm -share  will collect all the money and share it evenly on the members, using gp, sp and cp only (pp and ep will be converted). Can also be used for one character to 'exchange' money. !cm -transfer "Tazeka Liranov" 40gp  will transfer 40 gp from the selected token to the character sheet named Tazeka Liranov. !cm -convert  - same as  !cm -share , but will also use platinum and electrum. Credits With thanks to  Kryx / mlenser  and  Michael G. / VoltCruelerz  for their contributions.
Sounds really great Arthur! I will give it a try tonight. Thanks for sharing.
1515591556
The Aaron
Pro
API Scripter
Nice work!  I like the USD conversion, that's a clever idea.
Thanks! As said, some of my players have a hard time wrapping their heads around the currencies. And thanks for the code snippets for writing the attributes - much simpler than the routine I had before.
1515592841
The Aaron
Pro
API Scripter
No problem!  I'll happily talk about coding till everyone is blue in the face!  Just ask!  =D
Pretty cool script!  I might have to borrow this one. Some suggestions if you ever decide to make it more robust: Have an option to store the party characters in State. That way you can use party commands and it automatically selects the the whole party rather than needing to select their tokens. Have it distribute a 'hoard' among the party. For example: !cmhoard 1000cp 200sp 50gp 4pp would divide those coins equally between the party or selected tokens.
It works like a charm Arthur, thanks! Would it be possible to add a target function instead of having the affected token selected?
Three of Swords : Like the idea of the hoard function. This will surely come in one of the next releases! I don't know about the state option. I always switch between single tokens (e.g. to add money for one character) and several tokens (to share the money). Guessed that just selecting might be the fastest way to do it, but I'll give it another thought. Ravenknight: Glad that it's working for you! Not sure right now how I can access the target function from within the script (The Aaron probably has a working snippet for that already), but I most likely have to add an option to hand over token ids to the script and then wrap everything in a macro.
Not a big problem Arthur. That's just how we set up our shop-macros. And I do like the hoard function-idea.
1515604029

Edited 1515604154
The Aaron
Pro
API Scripter
The @{ } references get expanded to their contents before being sent to the API: !foo @{target|id} @{target|bar} might come to the api as: !foo -JK134adf1234 23 The key to using that data is organizing your command line parsing.  Right now, you look at the start of the msg.content to match your command and later you extract specific text using regular expressions.  My suggestion would be to take IDs as the last part of the command line, after a marker like --: !cmadd -1gp 10sp -- -JK134adf1234 -JR134ad143 -JL134235623 You can split on /\s+--\s+/ and parse the 0 index the same way you are now, then just split the 1 index on /\s+/ to get a list of ids, and _.map() over them to get objects similar to how you're doing now.  Something like: let msgParts = msg.content.split(/\s+--\s+/); let ids = (msgParts[1]||[]).split(/\s+/); You could event turn your msg.selected use into a list of ids with _.pluck: _.pluck(msg.selected,'_id'); and unify it with: let msgParts = msg.content.split(/\s+--\s+/); let ids = _.pluck(msg.selected,'_id').concat(msgParts[1]||'').split(/\s+/); (Note 1: Because of a long standing bug with Roll20, if you use @{target} when calling an API command, you won't get msg.selected) (Note 2: Technically, the above will end up with an entry for the id "", but that will fall out when you try to find objects corresponding to it) (Note 3: You could end up with duplicate IDs, if someone passed the same @{target|x|id} in multiple times, so doing a _.uniq() is a good idea, see below)  I like to use something like this: _.chain(ids) .uniq() .map((id) => getObj('graphic',id)) .reject(_.isUndefined) .map((o) => ({token: o, character: getObj('character',o.get('represents'))})) .reject((o) => _.isUndefined(o.character)) .each((o) => {     setattr(o.character.id,"pp",pps);     setattr(o.character.id,"gp",gps);     setattr(o.character.id,"ep",eps);     setattr(o.character.id,"sp",sps);     if (rest>0.999 && newcounter==partycounter) cps++;     if (rest<-0.999 && newcounter==partycounter) cps--;     setattr(o.character.id,"cp",cps); }); That way I preserve token and character both when I get in the .each().  Not really an issue for you in this script, but something for your toolbox. =D
Arthur B said: Three of Swords : Like the idea of the hoard function. This will surely come in one of the next releases! I don't know about the state option. I always switch between single tokens (e.g. to add money for one character) and several tokens (to share the money). Guessed that just selecting might be the fastest way to do it, but I'll give it another thought. I'm glad you like the hoard function.  Saves me from having to modify your code to do it.  ;) I'll prob still modify your code to store the characters in state.  My players' current PCs aren't communists.  They don't share money.  Ever.  (Usually they do, just not this party.)  So if I use your script I'll always have to select all of the party members, and it'd be a lot easier to do it automatically.
Thanks, Aaron. I think I need to chew on that a bit... ;) But maybe I'll just get the ids with regexp - that way the syntax could be more flexible. Wanted to clean up the regexp part anyway. Three of swords: Sure, feel free to change it as you see fit!
Ooh, I’ve been missing this.  I imagine you could also store treasure as a token (or would it have to be a character?) and give the token/character the appropriate macros/abilities to let you distribute treasure at the touch of a button. 
1515628533

Edited 1515628631
Is it possible to give the players the ability to use this API or at the very least - when purchasing stuff, it automatically gets removed. Also a notification when they add/subtract - I get a little whisper so noone is fudging an extra gold or plat. lastly - when you are saying convert.. let's say my party found 500 cp .. will this covert 500cp into 50sp or 5g? If so, can there be a function where it does not do that since I run a strict encumbrance game and even money will play a factor to that.
Nover, yes, cmconvert and cmshare convert 500cp to 5gp. But I'm currently adding a cmhoard function, where the coins will be distributed among the members, but without conversion. Of course that means that the money won't be shared evenly - if you split up 15 gp among four party members, then three will get 4 gp and the last one only 3 gp. I have no plans to make this script available for the players - the idea was to have a tool for the GM to quickly check and adjust the party's cash. The players can still change money in their character sheets. But it's rather easy to remove that limitation, if you really want. In line 29, change           if (msg.type !== "api" && !playerIsGM(msg.playerid)) return; to           if (msg.type !== "api") return; and the players can use it as well. Note that all output is still whispered to the GM.
Marius said: Ooh, I’ve been missing this.  I imagine you could also store treasure as a token (or would it have to be a character?) and give the token/character the appropriate macros/abilities to let you distribute treasure at the touch of a button.  Not sure what you mean by that... e.g. if a player reaches a chest, he automatically gets the treasure that is somewhere stored in the token info?
I added a cmhoard function, that works as described above. Haven't tested it throughoutly yet, though. Please let me know if you're running into any issues.
Regarding cmhoard:  It would require additional programming, so maybe not worth it.  But if you have odd numbers of platinum pieces, you could change the math so the short-handed players get more gold to compensate (if there is any gold). For the other denominations, not worth it, IMO.  Cuz really, who cares about ep, sp, and especially cp... Or as DM, I could always make platinum in any hoard divisible by the number of PCs in my party.
Three of Swords said: Regarding cmhoard:  It would require additional programming, so maybe not worth it.  But if you have odd numbers of platinum pieces, you could change the math so the short-handed players get more gold to compensate (if there is any gold). For the other denominations, not worth it, IMO.  Cuz really, who cares about ep, sp, and especially cp... Or as DM, I could always make platinum in any hoard divisible by the number of PCs in my party. Perhaps a minor solution - have a fake character sheet token that gets the left over and that will be done manually when there is sufficient funds.
Arthur B said: Nover, yes, cmconvert and cmshare convert 500cp to 5gp. But I'm currently adding a cmhoard function, where the coins will be distributed among the members, but without conversion. Of course that means that the money won't be shared evenly - if you split up 15 gp among four party members, then three will get 4 gp and the last one only 3 gp. I have no plans to make this script available for the players - the idea was to have a tool for the GM to quickly check and adjust the party's cash. The players can still change money in their character sheets. But it's rather easy to remove that limitation, if you really want. In line 29, change           if (msg.type !== "api" && !playerIsGM(msg.playerid)) return; to           if (msg.type !== "api") return; and the players can use it as well. Note that all output is still whispered to the GM. this may be out of your scoop - but is it possible to create a whisper when a player changes any money value inside the character as well?
notice an issue - so let's say my current weight capacity is at 20. I do !cmhoard 1000pp 1000gp 1000sp 1000cp. It now updates the character sheet, reflecting that number but I still weight 20
Nover C. said: notice an issue - so let's say my current weight capacity is at 20. I do !cmhoard 1000pp 1000gp 1000sp 1000cp. It now updates the character sheet, reflecting that number but I still weight 20 I did some tests and noticed the same. It seems that under some circumstances, the OGL sheet doesn't trigger the weight calculation. Not sure what exactly causes it, because it works sometimes. But it is rather an issue related to the OGL sheet than to the CM script.
1515677035

Edited 1515677237
The Aaron
Pro
API Scripter
Arthur B said: Nover C. said: notice an issue - so let's say my current weight capacity is at 20. I do !cmhoard 1000pp 1000gp 1000sp 1000cp. It now updates the character sheet, reflecting that number but I still weight 20 I did some tests and noticed the same. It seems that under some circumstances, the OGL sheet doesn't trigger the weight calculation. Not sure what exactly causes it, because it works sometimes. But it is rather an issue related to the OGL sheet than to the CM script. Try changing the attr.set() call in setattr() to attr.setWithWorker().&nbsp; .setWithWorker() triggers Character Sheet change events. .setWithWorker() is apparently only documented on the forum, here's the relevant post:&nbsp; <a href="https://app.roll20.net/forum/post/4507273/new-api-" rel="nofollow">https://app.roll20.net/forum/post/4507273/new-api-</a>... And a broader rollout to prod post: <a href="https://app.roll20.net/forum/post/4796497/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/4796497/slug%7D</a>
The Aaron said: Arthur B said: Nover C. said: notice an issue - so let's say my current weight capacity is at 20. I do !cmhoard 1000pp 1000gp 1000sp 1000cp. It now updates the character sheet, reflecting that number but I still weight 20 I did some tests and noticed the same. It seems that under some circumstances, the OGL sheet doesn't trigger the weight calculation. Not sure what exactly causes it, because it works sometimes. But it is rather an issue related to the OGL sheet than to the CM script. Try changing the attr.set() call in setattr() to attr.setWithWorker().&nbsp; .setWithWorker() triggers Character Sheet change events. .setWithWorker() is apparently only documented on the forum, here's the relevant post:&nbsp; <a href="https://app.roll20.net/forum/post/4507273/new-api-" rel="nofollow">https://app.roll20.net/forum/post/4507273/new-api-</a>... And a broader rollout to prod post: <a href="https://app.roll20.net/forum/post/4796497/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/4796497/slug%7D</a> Thanks, that did the trick! Just updated the gist to v0.4.1
1515680277
The Aaron
Pro
API Scripter
Hurray for undocumented features! =D
Rather hurray to having a human roll20-javascript-encylopedia-scriptomancer here ;)
1515680796
The Aaron
Pro
API Scripter
Well, that too, of course. =D
now we can add this to a pretty chat command interface :D&nbsp; Thanks for sharing and thanks for those who help to improve this...&nbsp;
1515692334

Edited 1515692510
Kryx
Pro
Sheet Author
API Scripter
Hmm, this sounds really interesting. Any interest in making it work for the Shaped sheet as well? I can probably send a PR if so. EDIT: Based on the code it should already work for Shaped as the currency fields are named the same. I'll try it out soon.
Arthur B said: Marius said: Ooh, I’ve been missing this.&nbsp; I imagine you could also store treasure as a token (or would it have to be a character?) and give the token/character the appropriate macros/abilities to let you distribute treasure at the touch of a button.&nbsp; Not sure what you mean by that... e.g. if a player reaches a chest, he automatically gets the treasure that is somewhere stored in the token info? I was half-asleep when I wrote the above, and haven’t had the time to test, but what I imagine might work is: 1. create a character called “treasure” 2. Add an ability called let’s say “hoard” that goes someting like “!cmhoard 20 gp” and set it as a token action. 3. Give the character an apropriate token and put it on the vtt. When the treasure is discovered you could simply press the token action button and the money will be distributed. To make more piles of treasure you could duplicate the character and edit the !cmhoard to the correct amount.&nbsp;
Kryx said: Hmm, this sounds really interesting. Any interest in making it work for the Shaped sheet as well? I can probably send a PR if so. EDIT: Based on the code it should already work for Shaped as the currency fields are named the same. I'll try it out soon. Hi Kryx, just wondering if you run into any issues with the script when using the Shaped sheet?
Marius said: I was half-asleep when I wrote the above, and haven’t had the time to test, but what I imagine might work is: 1. create a character called “treasure” 2. Add an ability called let’s say “hoard” that goes someting like “!cmhoard 20 gp” and set it as a token action. 3. Give the character an apropriate token and put it on the vtt. When the treasure is discovered you could simply press the token action button and the money will be distributed. To make more piles of treasure you could duplicate the character and edit the !cmhoard to the correct amount.&nbsp; I guess you could do that, but wouldn't it be easier to just type it in the chat window? I mean, I'm all for automation, but in this case, it seems to be more work than doing it manually. I'd rather just create a macro button in the macro bar. Something like: !cmhoard ?{Amount|20gp}
1516037960
Kryx
Pro
Sheet Author
API Scripter
Shaped feedback: !cm without a selected character throws an error. Perhaps we can define our PCs so we don't have to select them all the time? !cm with selected characters returns a blank message from CashMaster (character_name is the correct field, all the currency fields are correct). General feedback: !cmhoard seems to work great, also works with negative numbers. Blank message from CashMaster Not sure what would cause these issues.
Kryx said: Shaped feedback: !cm without a selected character throws an error. Perhaps we can define our PCs so we don't have to select them all the time? !cm with selected characters returns a blank message from CashMaster (character_name is the correct field, all the currency fields are correct). General feedback: !cmhoard seems to work great, also works with negative numbers. Blank message from CashMaster Not sure what would cause these issues. Thanks. I'll have a look into that. I'm normally not using the shaped charsheet, but I'll set up a test game.
1516101834
Kryx
Pro
Sheet Author
API Scripter
Thanks for taking a look!
1516125854
Kryx
Pro
Sheet Author
API Scripter
The issue is the roll template used. Changing that should fix it. I'll report back.
Kryx, I added an option to support the 5E-Shaped sheet. Later, when the script is updated in the One-Click library, there will be an option to select the correct sheet (OGL or 5E-Shaped).&nbsp; For now, it needs to be changed in the code (line 27). I set it to 5E-Shaped in this temp gist:&nbsp; <a href="https://gist.github.com/arthur-bauer/5f7f124ea056b" rel="nofollow">https://gist.github.com/arthur-bauer/5f7f124ea056b</a>... Can you please give it a try and let me know if it works? It worked in the test game that I tried, but I didn't spend too much time with the shaped roll template to see if the freetext part would be the best option...
I just updated the script to v0.5 Apart from the basic support for the shaped sheet (and a trillion bug fixes), I also added a new function called "cmpay". This function can be used to pay a certain amount, e.g. in a tavern or a shop. The script subtracts the proper amount from the player(s), and does coin conversion when needed. &nbsp; Example: `!cmpay 5sp` -&nbsp;Each selected character needs to pay 5sp in a tavern. If a character doesn't have enough silver, the script will e.g. take 1gp and return 1ep.
1516487088

Edited 1516488714
Kryx
Pro
Sheet Author
API Scripter
I'll check it out soon. I converted a version to ES6, but I kept your old version to compare for when you made updates so I can update mine as well. Feedback: 1. There are too many commands. There is so much overlap: !cmshare sounds identical to !cmconvert besides an arbitrary limit on not using PP and EP on share. It honestly sounds like you should have 1 command that does all the common transactions: !cm Having settings for selecting which currencies to use (no ep for example). Use tags for splitting. For example !cm 50gp --split Use negatives for spending coin. For example !cm -5gp Use tags for converting to gold or not. For example !cm 100pp 34gp 25sp --noconvert (and/or make it a setting) Use !cm --overview to get an overview. Keep some variant of !cmshare and !cmconvert, though I don't see a purpose for it for most cases. How often does the party want equal gold on every character? The whole point of this script is that each player has their own gold and this makes it easy to add or subtract an amount equally from the party while maintaining individual golds. This would significantly simply the syntax of the script and make it far more easy to use. 2. Overview should come after the transaction, not before. I don't want to see the party's gold value before adding 500g, I want to see how much gold each of them has after. 3. Overview is difficult to understand at a glance. It is too detailed. &nbsp; Generally the overview should have 1 line for each party member selected with a prominence on the total gold equivalent amount with the details as secondary, less important, information if they are shown at all. I'd be happy to help out and contribute to the project as well.
Hi Kryx, thanks for the feedback! Helps me a lot to see what other people would like to have in the script. The reason for cmshare and cmconvert is that my party really wants to have equally shared money. I introduced the two versions cmshared and cmconvert &nbsp;because they should not be able to convert all the gp in easier-to-carry pp even in the smallest village (mainly for encumbrance). But I get that not everyone uses these commands. They can still be used to "clean up" a single character's cash, though, so I don't want to remove them. But yeah, maybe I can combine them and use some --share/--convert instead. Maybe something like this: !cm shows party overview (simplified in some way) !cm --help shows help text !cm --share and !cm --convert for the share/convert routines !cm --hoard for the treasure function !cm --pay for the payments&nbsp; You're absolutely right with the overview comments. I actually started with a function to display a clearer, more concise cash output. And it makes absolutely sense to move it after the transaction. So that should be on the agenda for v0.6...&nbsp; And sure, I'd love if you want to contribute. I have the whole package on github:&nbsp; <a href="https://github.com/arthur-bauer/roll20-cashmaster" rel="nofollow">https://github.com/arthur-bauer/roll20-cashmaster</a> Feel free to help out.
1516494076

Edited 1516494181
Kryx
Pro
Sheet Author
API Scripter
To create a good user experience you have to think from a user's perspective. I'd say that your current wording and setup isn't a generalized setup. I've read your descriptions 5 times now and I'm still not sure I fully understand the point of each command and how they work. I also had to look them up several times during the session to remember them as their purpose wasn't clear. Hoard for example is a very specific example of many ways that the party can gain money. Think of it in other contexts like quest rewards and the word hoard stops being an intuitive word. Equally weird is that a horde could technically use negative values, so a negative hoard? That'd be the same as a pay event. Pay is also too specific. If you're going to use words then even more general words like add or subtract that are more intuitive for users to remember and use would be better. Though I think using 1 command and providing positive or negative values handles it quite sufficiently and will be more intuitive for many users. Arithmetic should be more understandable to more users than those words. Maybe provide both, but without user testing my gut says the arithmetic option is more intuitive. Overview is something that users will less commonly use. They'll likely only use it when deciding if they should buy something or not. They'd likely only use such a command once a session as after they buy something the overview will remind them of their current holdings. That overview event once a session would be a less common event than the standard events like paying a small amount (for an inn stay, for a meal, for information) or receiving some gold via treasure/quest. Based on that reasoning the add/subtract functionality should be more prominent than the overview functionality, meaning less to type. !cm --overview for that, whereas !cm would be the add/subtract command I recommend. Perhaps the descriptions are bad, but seemingly the only difference between !cmshare and !cmconvert is the use of pp and electrum. Both seem to convert. !cmhoard not distributing equally is quite silly imo. At minimum it should redistribute the player's currency if possible before deciding to not split the value equally. So in the example you mention a party of 5 splitting 4pp should then distribute .25g from each person who receives 1pp to the last member who got no pp.
going along Kryx feedback&nbsp; i to like his suggestions maybe with some tweaks have: !cm shows party overview (simplified in some way) !cm --help shows help text or even a preconfigured API chat button menu where the user can toggle options ON|OFF : Setting a Default if you will !cm --share ON|OFF and !cm --convert &nbsp; ON|OFF for the share/convert routines !cm --hoard for the treasure function !cm --pay for the payments Where Share is to divide all between all players or to go to a Set Sheet :Party Loot Where Covert is the use of EP in the Game or not Hoard is as defined Pay is as defined This way after options are set up a user could !cm {pay|hoard|Share}-- can adjust the actual workings of Cashmanger to their liking but still operate using the Non Default options. In my case i would use it for per character tracking and a Party tracking. This way Things for the group can be Payed out of party Loot and things for the players are paid from them.&nbsp; then if the party decides to split the party funds i could simply then run a !cm -ConvertParty which would then divide the party cash out to the players then switch to Share ON i hope this made sense&nbsp;
Kryx said: To create a good user experience you have to think from a user's perspective. I'd say that your current wording and setup isn't a generalized setup. I've read your descriptions 5 times now and I'm still not sure I fully understand the point of each command and how they work. I also had to look them up several times during the session to remember them as their purpose wasn't clear. Hoard for example is a very specific example of many ways that the party can gain money. Think of it in other contexts like quest rewards and the word hoard stops being an intuitive word. Equally weird is that a horde could technically use negative values, so a negative hoard? That'd be the same as a pay event. Pay is also too specific. If you're going to use words then even more general words like add or subtract that are more intuitive for users to remember and use would be better. Though I think using 1 command and providing positive or negative values handles it quite sufficiently and will be more intuitive for many users. Arithmetic should be more understandable to more users than those words. Maybe provide both, but without user testing my gut says the arithmetic option is more intuitive. Overview is something that users will less commonly use. They'll likely only use it when deciding if they should buy something or not. They'd likely only use such a command once a session as after they buy something the overview will remind them of their current holdings. That overview event once a session would be a less common event than the standard events like paying a small amount (for an inn stay, for a meal, for information) or receiving some gold via treasure/quest. Based on that reasoning the add/subtract functionality should be more prominent than the overview functionality, meaning less to type. !cm --overview for that, whereas !cm would be the add/subtract command I recommend. Perhaps the descriptions are bad, but seemingly the only difference between !cmshare and !cmconvert is the use of pp and electrum. Both seem to convert. !cmhoard not distributing equally is quite silly imo. At minimum it should redistribute the player's currency if possible before deciding to not split the value equally. So in the example you mention a party of 5 splitting 4pp should then distribute .25g from each person who receives 1pp to the last member who got no pp. Kryx, sorry that my explanations are a bit difficult to understand. Trying my best, but I'll blame it on the fact that I'm not a native speaker. Again, feel free to help me with the code or the readme. The behaviour of !cmhoard is intentionally like that. The scenario would be something like: Party just killed a goblin. He carries 3sp. Party has 4 members. Next goblins are already on their way. So, party members grab the coins, share them quickly and move on.&nbsp; For !cmpay, the scenario includes another party that can exchange coins. The !cmadd or !cmhoard with negative values on the other hand do not exchange coins. This is why,&nbsp;after the introduction of the !cmpay function I removed the examples with negative sums completely. I didn't want to remove the functionality, but it's discouraged.
I'm using the Shaped sheet and I tried the hoard command in test characters. The money was not in the sheet and it gives the output: has NaN platinum, NaN gold, NaN electrum, NaN silver, NaN copper. Converted, this character has NaN gp in total.
bruno said: I'm using the Shaped sheet and I tried the hoard command in test characters. The money was not in the sheet and it gives the output: has NaN platinum, NaN gold, NaN electrum, NaN silver, NaN copper. Converted, this character has NaN gp in total. Hi Bruno, did you change line 27 from var selectedsheet="OGL"; // You can set this to "5E-Shaped" if you're using the Shaped sheet&nbsp; to&nbsp; var selectedsheet="5E-Shaped"; &nbsp;// You can set this to "5E-Shaped" if you're using the Shaped sheet&nbsp; ? And what values to your coin fields have?
Yes, I have changed. The sheets were created to do the tests, and started with 0 coins.
1516659064
Kryx
Pro
Sheet Author
API Scripter
I believe the PR that Arthur merged from me will fix the issue, but I'll need to test my refactoring which I can do on Wednesday.
thanks.
Loving everything about this but I'm running into an issue trying to charge my players for services cmpay is giving me the overview instead of a taking money from the selected player. cmadd with negative values works but isn't ideal.
1516852870

Edited 1516852921
Cm share convert seems pointless in terms. Perhaps rename it to cm PShare and EShare since both devide equally and converts. The only difference was if it used EP. where hoard does no conversion and shares equally as much as possible. Which I would rename to cm loot, tendies, shinies or whatever. Hoard makes no sense.
Jordan P. said: Loving everything about this but I'm running into an issue trying to charge my players for services cmpay is giving me the overview instead of a taking money from the selected player. cmadd with negative values works but isn't ideal. Hi Jordan, can you please post the exact command that you used? And the version number of the script you are using? Nover C. said: Cm share convert seems pointless in terms. Perhaps rename it to cm PShare and EShare since both devide equally and converts. The only difference was if it used EP. where hoard does no conversion and shares equally as much as possible. Which I would rename to cm loot, tendies, shinies or whatever. Hoard makes no sense. Yeah, I'm still thinking about the proper wording. The two convert/share functions are both from my personal game workflow (the party shares the cash equally, and I houseruled that they can't convert into pp in smaller shops/taverns outside of cities).