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 it possible to make an API script macro that creates spell slots?

1578311681

Edited 1578371747
For the OGL sheet by roll20, is there a way to make a macro that will create a spell slot whilst updating class resources on the sheet? Specifically I want to use spell points from the variant rule in the DMG, in my current campaign and have those show in the resource section to be consumed like ammunition does for ammo tracking. I wondered if there was a way to connect a macro through an api script that when used, would update the sheet's to consume the resources referenced AND then create a spell slot on the player's sheet?
1578312886
GiGs
Pro
Sheet Author
API Scripter
I think you should be able to do this with the chatSetAttr script.
1578324484
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
I'll note that the chatSetAttr script will make the spell slot, but getting it to delete the slot (such as on a long rest I'm assuming) would be difficult. I'd probably leave the spell section alone and use it for players to record the spells they know/have prepared, and then just add something to the description field like "Spell points available: 5 | Required: 4" and then a button to deduct the spell point or not via chatSetAttr.
1578362875

Edited 1578362963
GM Michael
API Scripter
SpellMaster handles sorcery point translation for OGL character sheets, though it does it through its own spell sheet, rather than using the stock spell sheet.
1578436322

Edited 1578436359
Update: So using the advice given I've made a macro query that asks for spell slot level and then runs the appropriate level macro through chatSetAttr script to add spell slots and minus resources! I've even made it message the GM for whenever someone does a conversion, so the DM will be able to track the character's current spell point pool! Thanks for the help guys!