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

Is there a Get/Set API script floating around anywhere for manipulating character sheets?

I'm looking for a script that can get/set values of the Pathfinder Community Sheet. I want an easy way to write macros where I can run the API script to bulk award EXP and bulk hand out gold to all my players at once by opening a dialog box and inputing a number then running the API script awarding that number of Gold/EXP. Something that can use ids of character sheet would be ideal. Does anything like this already exist? On the same note, can token-mod modify the attributes of what the token "represents"?
1523210385

Edited 1523210570
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
There is an  Easy Experience script for awarding XP on the spot. There is a  Cashmaster script for divvying up and exchanging treasure. But the most powerful script along these lines is  ChatSetAttr , which lets you create, and write to fields on the character sheet.
ChatSetAttr is EXACTLY what I was looking for. I just tested it for XP and was able to award 6 characters 100 EXP in one statement: !setattr --charid -L9PSI5v14q-4Ckw85hv, -L8pfe4v2ziojYmq-nXK, -L9MY7e1NpY71mZwBdT8, -L9Oxseo4nN8Pupl2P-6, -L8lR02uXn4wBLB-5qrl, -L9Mu_S-WhANbE8f2E4z --mod --experience|100 Now I can just add this at the end instead of a value: --experience|?{Experience|0} And now I have a popup dialog where I can specify the amount of EXP to award. This is fantastic! Thanks for directing me to CharSetAttr keithcurtis!
This is my new macro for awarding experience to the whole party and it works swimmingly! !setattr --charid -L9PSI5v14q-4Ckw85hv, -L8pfe4v2ziojYmq-nXK, -L9MY7e1NpY71mZwBdT8, -L9Oxseo4nN8Pupl2P-6, -L8lR02uXn4wBLB-5qrl, -L9Mu_S-WhANbE8f2E4z --mod --mute --experience|?{Experience|0} /desc The party was awarded ?{Experience|0} experience.
This is what I'm using for awarding XP and Currency now: XP: !setattr --charid -L9PSI5v14q-4Ckw85hv, -L8pfe4v2ziojYmq-nXK, -L9MY7e1NpY71mZwBdT8, -L9Oxseo4nN8Pupl2P-6, -L8lR02uXn4wBLB-5qrl, -L9Mu_S-WhANbE8f2E4z, -L9MKKUnZTZX-SnEe7fj --mod --mute --experience|?{Experience|0} /desc Each member of the party was awarded ?{Experience|0} experience points for ?{Reason|0}. !sfx song:EXP action:play unique:true volume:100 You specify how much XP and give a reason the XP is being awarded and a nice fanfare sfx plays. An example of output from this that the players would see is "Each member of the party was awarded 100 experience points for a combat encounter." And this for awarding money: !setattr --charid -L9PSI5v14q-4Ckw85hv, -L8pfe4v2ziojYmq-nXK, -L9MY7e1NpY71mZwBdT8, -L9Oxseo4nN8Pupl2P-6, -L8lR02uXn4wBLB-5qrl, -L9Mu_S-WhANbE8f2E4z, -L9MKKUnZTZX-SnEe7fj --mod --mute --?{Currency|cp|sp|gp|pp}|?{Coins|0} /desc Each member of the party got ?{Coins|0} ?{Currency|cp|sp|gp|pp}. !sfx song:Coins action:play unique:true volume:100 You get a drop down box to specify the type of currency then specify how much and it will say for example "Each member of the party got 10 gp." CharSetAttr is a lifesaver. That combined with token-mod you can modify pretty much anything you want about a character!
1523368295
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Kastion said: CharSetAttr is a lifesaver. That combined with token-mod you can modify pretty much anything you want about a character! Those two scripts are like toolboxes. They allow you to build so many cool things. They really should be core functionality.
keithcurtis said: Kastion said: CharSetAttr is a lifesaver. That combined with token-mod you can modify pretty much anything you want about a character! Those two scripts are like toolboxes. They allow you to build so many cool things. They really should be core functionality. Indeed they are and I agree they should come as core functionality. I'm having so much fun with these two scripts. I want to automate as much as possible to keep the pace of the game going steady and these two scripts are a boon.