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

[Shaped] Spellbook Manager Macro

1518984949

Edited 1518989692
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
As you add more and more spells to a character, the performance can go down. When you add a lot of spells, the performance can drop dramatically.  Yet some characters can accumulate a lot of spell choices. For casters like clerics or druids, their choices are as broad as the entirety of their class list. For them, the Shaped Script spell import command is a godsend. For casters like wizards however, there is no convenient solution. Wizards can accumulate a huge number of spells as they find spellbooks and scrolls. Even though they can prepare only a limited number at any given time, they don't have a manageable list of choices to make their prepared list for the day. Also, they could have a backlog of spells that they have found, but have not yet had time or gold enough to copy into their own spellbooks. This macro is an attempt to fix that. I wrote it for a wizard player in my campaign when I realized he had over fifty spells imported to his sheet, even though he did not yet have access to all of them. He certainly could use all of them in the course of an adventuring day. This is a complex macro, so it is parsed by a  spreadsheet . The macro outputs a chat menu that allows you to quickly swap out prepared spells from a list of known spells. It also allows you to clear the decks of your list, and to load in specific spells or lists of spells. For instance, your wizard may have a set they commonly use in a dungeon, or one they use in town. This should greatly reduce the spell load on any given character. The macro requires you to be using the  Shaped Sheet for D&D 5e , and to have installed the  Shaped Script API script . The spreadsheet may be found  here , and requires nothing more than a basic understanding of how spreadsheets work so that you can add or delete rows as needed, copying the formula down if necessary. You will need to save a personal copy of the sheet and keep one sheet per character (or copy the sheet onto a new tab, to keep all spellbook managers together). Instructions for entering spells into the spreadsheet Known? (Column A) Enter a "Y" in column A if this is a spell you have available to prepare. Leave blank if it is unavailable. Note or Separator (Column B) In Column B, Enter a note about the spell if necessary, for instance, if it comes from a particular spellbook, a scroll, from the Magical Initiate Feat or some other source. Alternatively, you can enter a note here to indicate a separator, perhaps for level or to separate sets from individual spells. In this case, enter nothing else on that row. Spell or Spell List (Column C) In Column C, enter a spell or list of spells. If you enter a single spell, it will create a button to import or delete that spell from the selected token's character sheet. If it is a list, it will create a button to import all of the spells in that list. For instance you might have a common set of spell you use "in town", or "underground". In that case, the button will be labeled according to the note in Column B. If the Column A for that spell indicates a spell you have procured through adventuring but is not yet in your spellbook, it will only display the name in italics, with no way to import. The first line of the macro will contain a button to erase all spells on the character's sheet, so that you can start with a blank slate if desired. Macro Code to Copy (Column D) To copy the macro, select the gray cells from the top to the first instance of "}}" and paste that into a token macro for the character whose spellbook this is. Chat Menu This is a token macro, so it will add or subtract spells from the character sheet whatever token is selected, not whatever sheet happens to be open. Be careful. In the resulting chat menu, you will first be presented with the option to remove all prepared spells from the selected character.  For each spell, you will be shown the spells name, along with whatever note might be associated with it. In the case of the sample character Shmerlin, he has found a spellbook called the Book of Shadows, but has only managed to copy over a few spells from it. He also has some Warlock Spells from the feat "Magic Initiate". If the spell is available to be prepared, there will be buttons to add or subtract the spell from the character's list of known spells. If it is unavailable, it appears in italics and has no actionable button. At the very end are the lists of frequently prepared spell sets. Click on on one of these buttons will add all the spells in the list. This may take a minute or two to appear on the sheet, depending on the speed of your computer.
1518985850
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
This spreadsheet can be used for other purposes as well. Perhaps you have a large number of NPC spellcasters. Even though they are not on the board and may not come up for several sessions, they take up campaign memory during play. You can store them with unfilled spell lists, regardless of class, and only load up their lists at need, keeping your campaign lean. Simply store the list as a token macro on the sheet. You might want to add "/w gm " to the front of it if you want to keep the list secret from the players.
1518988943
Kryx
Pro
Sheet Author
API Scripter
FYI the script is no longer called the companion, but simply the Shaped Script.
1518989710
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Kryx said: FYI the script is no longer called the companion, but simply the Shaped Script. Thanks! Fixed.
1519325579

Edited 1519326685
EDIT: Never mind, I figured the issue out. I had forgotten to include the second bracket at the bottom of the macro for it to enclose the whole thing.  Keith, I am running into a bit of a snag on this and I don't know if you would know the answer necessarily but I figured I would try and ask. When using this as a token action for some reason the shaped template is only applying to the first portion of the macro and all the other portions are without the template. Any advice would be greatly appreciated. Thanks in advance!
1519338492

Edited 1519338529
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Ziaphas. Glad you worked it out.