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

Tim's Spellbook Mod (ScriptCards) D&D 5E 2014

1743359036

Edited 1754197606
******* New Version of Mod Available ******* Hi All, This is my mod displaying a characters known spells. I t's for the D&amp;D 5E (2014) by Roll20 character sheet. It requires the Scriptcards API mod. What Does This Mod Do? This Mod displays a character's known spells in chat as a Spellbook. It displays Spellcasting Ability, Spell Save DC, Spellcasting Bonus, and Max Amount of Prepared Spells. It then displays all known spells in a list under the spell level subheading, the subheading displays maximum spell slots and how many slots are left, and a plus and minus button to add or remove slots. It has buttons to run an attack roll(if the spell has an attack roll), it has a button that prepares/unprepares spells and a button that displays the spell's full description. Clicking the spell slots themselves will take you to a card that allows you to change the colour of the slots. Cleric and Druid spellbooks only display prepared spells, since they have access to all spells it would take up a great deal of chat space. All sections of the spellbook have tooltips, including spells, which will display descriptions as a tooltip. Added a new feature, if you use your own spell macros just make sure they are named the same as the spell only with hyphens instead of spaces. ex. "Mind Sliver" macro would be called "Mind-Sliver". Both the attack roll button and spell detail button will be replaced by the macro instead. Installation Instructions This mod requires a custom template to be installed. To create a custom template, create a new character called "ScriptCards_TemplateMule" without the quotes, it is case sensitive. Then create two new abilities on the character. One called "Reset Templates" and put !sc-reloadtemplates as the macro(use this to reset templates any time you make a change to one.). For the second ability, name it "spellbook" without the quotes. This is the template/style for the Mod. Add the code below: boxcode::{div style='background-image: url(&amp;quot;<a href="https://files.d20.io/images/105716505/oymO0pnVyLCv-tQDw2vddA/med.png&amp;quot" rel="nofollow">https://files.d20.io/images/105716505/oymO0pnVyLCv-tQDw2vddA/med.png&amp;quot</a>;) ; background-size: 100% 100% ; display: block ; text-align: left ; font-size: 14px ; padding-top: 1em ; font-family: serif ; font-style: normal ; line-height: .5em ;'}|| titlecode::{div style='background-image: url(&amp;quot;<a href="https://files.d20.io/images/105716694/59KW_4mBR3y_Iz45sQw2-g/med.png&amp;quot" rel="nofollow">https://files.d20.io/images/105716694/59KW_4mBR3y_Iz45sQw2-g/med.png&amp;quot</a>;) !important ; background-size: 101% 4px ; width: 101% ; height:4px; display: block ; border: 1px solid #2f2112; border-radius: 2px ; vertical-align: top ; position: relative ; top: -15px ; left: -3px'}{/div}{div style='margin: 0em .25em 0em .25em ; font-size: 18px ; font-variant: small-caps ; font-family: serif ; color: #6e2425 ; display: block ; font-weight: bold ; font-style: normal ; vertical-align: top ; position: relative ; top: -8px; text-align: center ; line-height: .75em ; '}|| textcode::{/div}{div}{div style='color: #611b1c ; font-weight: normal; display: block; margin: 0 1em 0 1em; vertical-align: top ; position: relative ; top: -10px ; '}|| buttonwrapper::{div style='display: block ;'}{div style='background-image: url(&amp;quot;<a href="https://files.d20.io/images/105716694/59KW_4mBR3y_Iz45sQw2-g/med.png&amp;quot" rel="nofollow">https://files.d20.io/images/105716694/59KW_4mBR3y_Iz45sQw2-g/med.png&amp;quot</a>;) !important ; background-size: 113% 4px ; width: 113% ; height:4px; display: block ; border: 1px solid #2f2112; border-radius: 2px ; vertical-align: bottom ; position: relative ; bottom: -10px ; left: -16px ;'}{/div}|| buttonstyle::style='color: #611b1c ; background-color: transparent ; padding: 2px ; border: none'|| footer:: Run you Reset Templates macro now to initialize this theme. Now create your new macro and add the code below: !Script{{ --/|Script Name : Tim's SpellBook Mod (Scriptcards) for D&amp;D 5E 2014 --/|Version : 2.3.0 --/|Author : Timothy Beasley --/|Description : This script displays the PC's Spellbook in chat that has buttons for all spells available to selected character. --/| If the character has an attack roll a d20 button will appear beside the spell name which will roll the attack from the character sheet. --/| There is a round button which indicates if the spell is prepared, clicking the button will prepare or unprepare the spell(class dependant). --/| There is a button shaped like an open book, which when clicked will display the full description of the spell. --/| Clicking on the spell slots will take you to a card that will allow you to choose the slot colour. --/| Use the plus or minus buttons to add or remove spell slots. --/| If there is any confusion about what something does, all buttons and items on the spellbook have tooltips, just mouseover them. --/| If the character is a cleric or druid, only prepared spells will display, otherwise the list can get very long. --/| If you want to use your own spell macros, this script will detect if they exist and run them instead. Just make sure they are --/| named exactly as the spell only instead of spaces, use a hyphen - --/| --/|Installation: This script is for the 2014 edition of the official D&amp;D 5E Character Sheet by Roll20 and requires the --/| installation of the ScriptCards MOD using a pro account with API access. --/| This script also requires the installation of a custom ScriptCards template. Instructions for installing --/| a custom style template can be found on the Roll20 wiki page for ScriptCards. The code for the scriptcard --/| template can be found in the post associated with this Script on the Roll20 forums below; --/| <a href="https://app.roll20.net/forum/post/12285368/tims-spellbook-mod-scriptcards-d-and-d-5e-2014" rel="nofollow">https://app.roll20.net/forum/post/12285368/tims-spellbook-mod-scriptcards-d-and-d-5e-2014</a> --/| or on my GitHub below as spellbook.css; --/| <a href="https://github.com/VirulentArc/ScriptCards" rel="nofollow">https://github.com/VirulentArc/ScriptCards</a> --/| Make sure the template "macro" name is spellbook or change #overridetemplate to whatever name you'd prefer --/| it to have. --#Debug|0 --#overridetemplate|spellbook --#Whisper|self --#diceFontColor|#611b1c --#sourceToken|@{selected|token_id} --#emoteState|0 --:RestartBook| --?"[*S:SlotStyle]" -eq "undefined"|[ --!a:[*S:character_id]|!SlotStyle:default --]| --/|Styling --&amp;HeaderImage|style="background-image: url(<a href="https://raw.githubusercontent.com/VirulentArc/Resources/refs/heads/main/d20/Supernotes_Themes/spellbook/template/header.webp#.png" rel="nofollow">https://raw.githubusercontent.com/VirulentArc/Resources/refs/heads/main/d20/Supernotes_Themes/spellbook/template/header.webp#.png</a>) ; background-repeat: no-repeat ; background-size: 240px 30px ; background-position: center ; display: block ; width: 240px ; height: 100% ; line-height: 40px ; text-align: center ;" --&amp;HeaderBonus|style="display: inline-block ; position: relative ; top: 2px ;" --&amp;LevelBackground|style="background-image: url(<a href="https://raw.githubusercontent.com/VirulentArc/Resources/refs/heads/main/d20/Supernotes_Themes/spellbook/template/spell_level.webp#.png" rel="nofollow">https://raw.githubusercontent.com/VirulentArc/Resources/refs/heads/main/d20/Supernotes_Themes/spellbook/template/spell_level.webp#.png</a>) ; background-repeat: no-repeat ; background-size: 240px 40px ; background-position: left ; display: block ; width: 240px ; height: 100% ; text-align: center ; vertical-align: middle ;" --?";wizard;cleric;druid;" -inc ";[*S:class];"|=PrepTotal;[*S:caster_level] + @{selected|spellcasting_ability} {FLOOR} --?";paladin;artificer;" -inc ";[*S:class];"|=PrepTotal;([*S:caster_level]/2) + @{selected|spellcasting_ability} {FLOOR} --&amp;RollImage|[d20]1[/d20] --#parameterDelimiter|$$$ --?"[*S:class]" -inc "fighter"|&amp;ClassImage$$$&amp;#x132C1; --?";wizard;rogue;" -inc ";[*S:class];"|&amp;ClassImage$$$&amp;#x269a; --?"[*S:class]" -inc "warlock"|&amp;ClassImage$$$&amp;#x26D3; --?"[*S:class]" -inc "Sorcerer"|&amp;ClassImage$$$&amp;#x2726; --?";cleric;paladin;" -inc ";[*S:class];"|&amp;ClassImage$$$&amp;#x273A; --?";druid;ranger;" -inc ";[*S:class];"|&amp;ClassImage$$$&amp;#x130E0; --?"[*S:class]" -inc "artificer"|&amp;ClassImage$$$&amp;#x2699; --&amp;Infinity|&amp;#x221E; --&amp;BookImage|&amp;#x1F56E; --&amp;BlueDot|&amp;#x1F535; --&amp;BlankDot|&amp;#x1F518; --?";warlock;sorcerer;bard;rogue;fighter;ranger;" -inc ";[*S:class];"|&amp;PrepTotal$$$[&amp;Infinity]|&amp;PrepTotal$$$[$PrepTotal.Raw] --?"[&amp;PrepTotal]" -eq "[&amp;Infinity]"|&amp;FontSize$$$30|&amp;FontSize$$$20 --#parameterDelimiter|; --&amp;EmptySlot|[img width=30]<a href="https://raw.githubusercontent.com/VirulentArc/Resources/refs/heads/main/d20/Supernotes_Themes/spellbook/template/spellslot_spent.webp#.png[/img]" rel="nofollow">https://raw.githubusercontent.com/VirulentArc/Resources/refs/heads/main/d20/Supernotes_Themes/spellbook/template/spellslot_spent.webp#.png[/img]</a> --&amp;FullSlot|[img width=30]<a href="https://raw.githubusercontent.com/VirulentArc/Resources/refs/heads/main/d20/Supernotes_Themes/spellbook/template/spellslot_[*S:SlotStyle].webp#.png[/img]" rel="nofollow">https://raw.githubusercontent.com/VirulentArc/Resources/refs/heads/main/d20/Supernotes_Themes/spellbook/template/spellslot_[*S:SlotStyle].webp#.png[/img]</a> --&amp;MissingSlot|[img width=30]<a href="https://raw.githubusercontent.com/VirulentArc/Resources/refs/heads/main/d20/Supernotes_Themes/spellbook/template/spellslot_missing.webp#.png[/img]" rel="nofollow">https://raw.githubusercontent.com/VirulentArc/Resources/refs/heads/main/d20/Supernotes_Themes/spellbook/template/spellslot_missing.webp#.png[/img]</a> --&amp;SCA|[*S:spellcasting_ability] --~SCA|string;substring;3;3;[&amp;SCA] --&amp;ButtonStyle|style="align-self: center; background-color: transparent ; background-image: none; background-position: 0 90%; background-repeat: repeat no-repeat; background-size: 4px 3px; border-radius: 15px 225px 255px 15px 15px 255px 225px 15px; border-style: solid; border-width: 2px; box-shadow: rgba(0, 0, 0, .2) 15px 28px 25px -18px; box-sizing: border-box; color: #6e2425; display: inline-block; font-size: .95em; line-height: 23px; outline: none; padding: .2rem; text-decoration: none; border-bottom-left-radius: 15px 255px; border-bottom-right-radius: 225px 15px; border-top-left-radius: 255px 15px; border-top-right-radius: 15px 225px;text-transform: uppercase; font-weight: bold ; margin: 2px ;" --&amp;Darkbg|style="background-image: url(<a href="https://github.com/VirulentArc/Resources/blob/main/d20/Supernotes_Themes/spellbook/template/darkbg.png?raw=true" rel="nofollow">https://github.com/VirulentArc/Resources/blob/main/d20/Supernotes_Themes/spellbook/template/darkbg.png?raw=true</a>) ; width: 30px ; padding: .5em ; " --&gt;Header| --Rfirst|[*S:character_id];repeating_spell-cantrip;spellname --?"[*R:spellname]" -ne "NoRepeatingAttributeLoaded"|&gt;BookOutput;cantrip --Rfirst|[*S:character_id];repeating_spell-1;spellname --?"[*R:spellname]" -ne "NoRepeatingAttributeLoaded"|&gt;BookOutput;1 --Rfirst|[*S:character_id];repeating_spell-2;spellname --?"[*R:spellname]" -ne "NoRepeatingAttributeLoaded"|&gt;BookOutput;2 --Rfirst|[*S:character_id];repeating_spell-3;spellname --?"[*R:spellname]" -ne "NoRepeatingAttributeLoaded"|&gt;BookOutput;3 --Rfirst|[*S:character_id];repeating_spell-4;spellname --?"[*R:spellname]" -ne "NoRepeatingAttributeLoaded"|&gt;BookOutput;4 --Rfirst|[*S:character_id];repeating_spell-5;spellname --?"[*R:spellname]" -ne "NoRepeatingAttributeLoaded"|&gt;BookOutput;5 --Rfirst|[*S:character_id];repeating_spell-6;spellname --?"[*R:spellname]" -ne "NoRepeatingAttributeLoaded"|&gt;BookOutput;6 --Rfirst|[*S:character_id];repeating_spell-7;spellname --?"[*R:spellname]" -ne "NoRepeatingAttributeLoaded"|&gt;BookOutput;7 --Rfirst|[*S:character_id];repeating_spell-8;spellname --?"[*R:spellname]" -ne "NoRepeatingAttributeLoaded"|&gt;BookOutput;8 --Rfirst|[*S:character_id];repeating_spell-9;spellname --?"[*R:spellname]" -ne "NoRepeatingAttributeLoaded"|&gt;BookOutput;9 --X| --:Header| --&amp;Header|[t width=100% [&amp;HeaderImage]][tr][td title="Spellcasting Ability" width=60px][b]&amp;#x272F;[F::16][&amp;SCA(touppercase)][/F][/b][/td][td title="Spell Save DC" width=60px][F::16]&amp;#x1F6E1;[/F][b][F::20][*S:spell_save_dc][/F][/b][/td][td title="Spellcasting Bonus" width=60px [&amp;HeaderBonus]][b][F::5][&amp;RollImage]&amp;nbsp;[/F][F::20][*S:spell_attack_bonus][/F][/b][/td][td title="Max Prepared Spells" width=60px][F::18][&amp;ClassImage][/F][F::[&amp;FontSize]][b][&amp;PrepTotal][/b][/F][/td][/tr][/t] --+|[&amp;Header] --&lt;| --:BookOutput| --#title|@{selected|character_name}'s Spell Book --&amp;SpellLevel|[%1%] --?"[&amp;SpellLevel]" -ninc "cantrip"|[ --#parameterDelimiter|$$$ --?"[*S:lvl[&amp;SpellLevel]_slots_expended]" -eq 0 -and "[*S:lvl[&amp;SpellLevel]_slots_total]" -eq 0|&amp;Slots$$$[&amp;MissingSlot][&amp;MissingSlot][&amp;MissingSlot][&amp;MissingSlot] --?"[*S:lvl[&amp;SpellLevel]_slots_expended]" -eq 0 -and "[*S:lvl[&amp;SpellLevel]_slots_total]" -eq 1|&amp;Slots$$$[&amp;EmptySlot][&amp;MissingSlot][&amp;MissingSlot][&amp;MissingSlot] --?"[*S:lvl[&amp;SpellLevel]_slots_expended]" -eq 1 -and "[*S:lvl[&amp;SpellLevel]_slots_total]" -eq 1|&amp;Slots$$$[&amp;FullSlot][&amp;MissingSlot][&amp;MissingSlot][&amp;MissingSlot] --?"[*S:lvl[&amp;SpellLevel]_slots_expended]" -eq 0 -and "[*S:lvl[&amp;SpellLevel]_slots_total]" -eq 2|&amp;Slots$$$[&amp;EmptySlot][&amp;EmptySlot][&amp;MissingSlot][&amp;MissingSlot] --?"[*S:lvl[&amp;SpellLevel]_slots_expended]" -eq 1 -and "[*S:lvl[&amp;SpellLevel]_slots_total]" -eq 2|&amp;Slots$$$[&amp;FullSlot][&amp;EmptySlot][&amp;MissingSlot][&amp;MissingSlot] --?"[*S:lvl[&amp;SpellLevel]_slots_expended]" -eq 2 -and "[*S:lvl[&amp;SpellLevel]_slots_total]" -eq 2|&amp;Slots$$$[&amp;FullSlot][&amp;FullSlot][&amp;MissingSlot][&amp;MissingSlot] --?"[*S:lvl[&amp;SpellLevel]_slots_expended]" -eq 0 -and "[*S:lvl[&amp;SpellLevel]_slots_total]" -eq 3|&amp;Slots$$$[&amp;EmptySlot][&amp;EmptySlot][&amp;EmptySlot][&amp;MissingSlot] --?"[*S:lvl[&amp;SpellLevel]_slots_expended]" -eq 1 -and "[*S:lvl[&amp;SpellLevel]_slots_total]" -eq 3|&amp;Slots$$$[&amp;FullSlot][&amp;EmptySlot][&amp;EmptySlot][&amp;MissingSlot] --?"[*S:lvl[&amp;SpellLevel]_slots_expended]" -eq 2 -and "[*S:lvl[&amp;SpellLevel]_slots_total]" -eq 3|&amp;Slots$$$[&amp;FullSlot][&amp;FullSlot][&amp;EmptySlot][&amp;MissingSlot] --?"[*S:lvl[&amp;SpellLevel]_slots_expended]" -eq 3 -and "[*S:lvl[&amp;SpellLevel]_slots_total]" -eq 3|&amp;Slots$$$[&amp;FullSlot][&amp;FullSlot][&amp;FullSlot][&amp;MissingSlot] --?"[*S:lvl[&amp;SpellLevel]_slots_expended]" -eq 0 -and "[*S:lvl[&amp;SpellLevel]_slots_total]" -eq 4|&amp;Slots$$$[&amp;EmptySlot][&amp;EmptySlot][&amp;EmptySlot][&amp;EmptySlot] --?"[*S:lvl[&amp;SpellLevel]_slots_expended]" -eq 1 -and "[*S:lvl[&amp;SpellLevel]_slots_total]" -eq 4|&amp;Slots$$$[&amp;FullSlot][&amp;EmptySlot][&amp;EmptySlot][&amp;EmptySlot] --?"[*S:lvl[&amp;SpellLevel]_slots_expended]" -eq 2 -and "[*S:lvl[&amp;SpellLevel]_slots_total]" -eq 4|&amp;Slots$$$[&amp;FullSlot][&amp;FullSlot][&amp;EmptySlot][&amp;EmptySlot] --?"[*S:lvl[&amp;SpellLevel]_slots_expended]" -eq 3 -and "[*S:lvl[&amp;SpellLevel]_slots_total]" -eq 4|&amp;Slots$$$[&amp;FullSlot][&amp;FullSlot][&amp;FullSlot][&amp;EmptySlot] --?"[*S:lvl[&amp;SpellLevel]_slots_expended]" -eq 4 -and "[*S:lvl[&amp;SpellLevel]_slots_total]" -eq 4|&amp;Slots$$$[&amp;FullSlot][&amp;FullSlot][&amp;FullSlot][&amp;FullSlot] --?"[*S:lvl[&amp;SpellLevel]_slots_total]" -eq "[*S:lvl[&amp;SpellLevel]_slots_expended]"|&amp;PlusSlot$$$|&amp;PlusSlot$$$[rbutton]+::AddSlot;[&amp;SpellLevel][/rbutton] --?"[*S:lvl[&amp;SpellLevel]_slots_expended]" -eq 0|&amp;MinusSlot$$$|&amp;MinusSlot$$$[rbutton]-::SubtractSlot;[&amp;SpellLevel][/rbutton] --#parameterDelimiter|; --]| --#parameterDelimiter|$$$ --?"[&amp;SpellLevel]" -inc "cantrip"|&amp;Slots$$$[&amp;Infinity]|&amp;Slots$$$[&amp;Slots] --?"[&amp;Slots]" -eq "[&amp;Infinity]"|&amp;InfStyle$$$style="position: relative; top: 1px ; "|&amp;InfStyle$$$ --?"[&amp;SpellLevel]" -inc "cantrip"|&amp;SpellLevelOutput$$$C|&amp;SpellLevelOutput$$$[&amp;SpellLevel] --#parameterDelimiter|; --&amp;LevelStyle|style="position: relative; top: -2px ; " --&amp;MinusStyle|style="position: relative; top: -4px ; " --?"[&amp;SpellLevel]" -inc "cantrip"|&amp;PlusSlot; --?"[&amp;SpellLevel]" -inc "cantrip"|&amp;MinusSlot; --&amp;SpellOutput|[t width=100% [&amp;LevelBackground]][tr][td width=25 height=40 [&amp;LevelStyle]][br][F::20][b][&amp;SpellLevelOutput][/b][/F][/td][td width=40px [&amp;MinusStyle]][b][F::30][r][&amp;MinusSlot][/r][/F][/b][/td][td width=135px [&amp;InfStyle]][F::46][rbutton][&amp;Slots]::SlotChoice[/rbutton][/F][/td][td width=40px][b][F::22][l][&amp;PlusSlot][/l][/F][/b][/td][/tr][/t] --&amp;SpellOutput|+[t width=240px] --~|array;fromrepeatingsection;lvlSpells;[*S:character_id];repeating_spell-[&amp;SpellLevel];spellname --%SpellLoop|foreach;lvlSpells --Rfind|[*S:character_id];[&amp;SpellLoop];repeating_spell-[&amp;SpellLevel];spellname --&amp;SpellData|[*R:spellname][&amp;SpellLevel] --?"[*R:spellconcentration]" -inc 1|&amp;Concentration;(c)|&amp;Concentration; --?"[*R:spellritual]" -inc "Yes"|&amp;Ritual;(r)|&amp;Ritual; --~MacroName|string;replaceall; ;-;[&amp;SpellLoop] --~MacroButton|system;findability;[*S:character_name];[&amp;MacroName] --?"[&amp;MacroButton]" -ne "AbilityNotFound"|[ --&amp;SpellRoll|[F::6][button][&amp;RollImage]::~[*S:character_name]|[&amp;MacroButton][/button][/F] --]|[ --?"[*R:spelloutput]" -inc "ATTACK"|[ --&amp;SpellRoll|[F::6][sheetbutton][&amp;RollImage]::@{selected|character_name}::[*R&gt;spell][/sheetbutton][/F] --]| --?"[*R:spelloutput]" -inc "SPELLCARD"|[ --&amp;SpellRoll|[F::6][rbutton]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;::SpellInfo;[&amp;SpellData][/rbutton][/F] --]| --]| --#parameterDelimiter|$$$ --?"[&amp;MacroButton]" -ne "AbilityNotFound"|[ --&amp;SpellDetail|[button][&amp;BookImage]::~[*S:character_name]|[&amp;MacroButton][/button] --]|[ --&amp;SpellDetail|[sheetbutton][&amp;BookImage]::@{selected|character_name}::[*R&gt;output][/sheetbutton] --]| --?";warlock;sorcerer;bard;rogue;fighter;ranger;" -inc ";[*S:class];" -or "[*R:spellprepared]" -eq 1 -or "[&amp;SpellLevel]" -inc "cantrip"|&amp;Prepared$$$[rbutton][&amp;BlueDot]::PrepareOff;[&amp;SpellData][/rbutton]|&amp;Prepared$$$[rbutton][&amp;BlankDot]::PrepareOn;[&amp;SpellData][/rbutton] --?"[*R:spellcomp_v]" -inc "v=1"|&amp;ToolVerb$$$V|&amp;ToolVerb$$$ --?"[*R:spellcomp_s]" -inc "s=1"|&amp;ToolSomatic$$$,S|&amp;ToolSomatic$$$ --?"[*R:spellcomp_m]" -inc "m=1"|&amp;ToolMat$$$,M([*R:spellcomp_materials])|&amp;ToolMat$$$ --&amp;ToolComp|[&amp;ToolVerb][&amp;ToolSomatic][&amp;ToolMat]&amp;nbsp;&amp;#124;&amp;nbsp; --&amp;ToolRange|R:&amp;nbsp;[*R:spellrange]&amp;nbsp;&amp;#124;&amp;nbsp; --?"[*R:spelltarget]" -eq ""|&amp;ToolTarget$$$|&amp;ToolTarget$$$T:&amp;nbsp;[*R:spelltarget]&amp;nbsp;&amp;#124;&amp;nbsp; --&amp;ToolDuration|[*R:spellduration]&amp;nbsp;&amp;#124;&amp;nbsp; --?"[*R:spellcastingtime]" -eq ""|&amp;ToolCT$$$|&amp;ToolCT$$$[*R:spellcastingtime]&amp;nbsp;&amp;#124;&amp;nbsp; --?"[*R:spellritual]" -inc "Yes"|&amp;ToolRit$$$[&amp;Ritual]&amp;nbsp;&amp;#124;&amp;nbsp;|&amp;ToolRit$$$ --?"[*R:spellconcentration]" -eq ""|&amp;ToolCon$$$|&amp;ToolCon$$$(c)&amp;nbsp;&amp;#124;&amp;nbsp; --?"[*R:innate]" -eq ""|&amp;ToolInnate$$$|&amp;ToolInnate$$$[*R:innate]&amp;nbsp;&amp;#124;&amp;nbsp; --?"[*R:spellathigherlevels]" -eq ""|&amp;ToolHigher$$$|&amp;ToolHigher$$$&amp;nbsp;&amp;#124;&amp;nbsp;[*R:spellathigherlevels] --#parameterDelimiter|; --&amp;ToolTip|title="[&amp;ToolCT][&amp;ToolRange][&amp;ToolTarget][&amp;ToolComp][&amp;ToolRit][&amp;ToolCon][&amp;ToolDuration][&amp;ToolInnate][*R:spelldescription][&amp;ToolHigher]" --?"[*S:class]" -inc "cleric" -or "[*S:class]" -inc "druid" -and "[*R:spellprepared]" -eq 1 -or "[&amp;SpellLevel]" -inc "cantrip"|[ --&amp;SpellOutput|+[tr][td width=165px height=17px style="display: inline-block ; white-space: nowrap ; overflow: hidden; text-overflow: ellipsis ; line-height: 17px; vertical-align: bottom ; " [&amp;ToolTip]][b][#000][&amp;SpellLoop][/#][/b][i]&amp;nbsp;[&amp;Concentration]&amp;nbsp;[&amp;Ritual]&amp;nbsp;[*R:innate][/i][/td][td width=20 title="Cast Spell" style="position: relative ; top: 4px ; "][&amp;SpellRoll][/td][td width=40 title="Prepared"]|[F::15][&amp;Prepared][/F]|[/td][td width=20 title="Spell Details"][F::16][&amp;SpellDetail][/F][/td][/tr] --]| --?"[*S:class]" -ninc "cleric" -and "[*S:class]" -ninc "druid" -and "[&amp;SpellLevel]" -ninc "cantrip"|[ --&amp;SpellOutput|+[tr][td width=165px height=17px style="display: inline-block ; white-space: nowrap ; overflow: hidden; text-overflow: ellipsis ; line-height: 17px; vertical-align: bottom ; " [&amp;ToolTip]][b][#000][&amp;SpellLoop][/#][/b][i]&amp;nbsp;[&amp;Concentration]&amp;nbsp;[&amp;Ritual]&amp;nbsp;[*R:innate][/i][/td][td width=20 title="Cast Spell" style="position: relative ; top: 4px ; "][&amp;SpellRoll][/td][td width=40 title="Prepared"]|[F::15][&amp;Prepared][/F]|[/td][td width=20 title="Spell Details"][F::16][&amp;SpellDetail][/F][/td][/tr] --]| --%| --&amp;SpellOutput|+[/t] --+|[&amp;SpellOutput] --&lt;| --:SlotChoice| --#title|Choose a Slot Style --#whisper|self --~|array;define;SlotChoice;default;red;orange;yellow;green;blue;purple;pink --&amp;SlotsPerRow|4 --&amp;SlotsCounter|1 --&amp;SlotOutput|[br][br][t width=100% style="text-align: center ;" border=1][tr] --%loop|foreach;SlotChoice --&amp;SlotOutput|+[td width=30 [&amp;Darkbg]][rbutton][img width=30]<a href="https://raw.githubusercontent.com/VirulentArc/Resources/refs/heads/main/d20/Supernotes_Themes/spellbook/template/spellslot_[&amp;loop].webp#.png[/img]::WriteSlot;[&amp;loop][/rbutton][br][b][&amp;loop][/b][/td]" rel="nofollow">https://raw.githubusercontent.com/VirulentArc/Resources/refs/heads/main/d20/Supernotes_Themes/spellbook/template/spellslot_[&amp;loop].webp#.png[/img]::WriteSlot;[&amp;loop][/rbutton][br][b][&amp;loop][/b][/td]</a> --?[= [&amp;SlotsCounter] % [&amp;SlotsPerRow] ] -eq 0|&amp;SlotOutput;+[/tr][tr] --&gt;IncrementCounter|SlotsCounter --%| --&amp;SlotOutput|+[/tr][/t] --+|[&amp;SlotOutput] --+|[br][br][t width=100% border=1 style="text-align: center ;"][tr][td width=60%][b]Current Slot Style[/b][/td][td [&amp;Darkbg]][img width=30]<a href="https://raw.githubusercontent.com/VirulentArc/Resources/refs/heads/main/d20/Supernotes_Themes/spellbook/template/spellslot_[*S:SlotStyle].webp#.png[/img][/td][/tr][/t][t" rel="nofollow">https://raw.githubusercontent.com/VirulentArc/Resources/refs/heads/main/d20/Supernotes_Themes/spellbook/template/spellslot_[*S:SlotStyle].webp#.png[/img][/td][/tr][/t][t</a> width=100% style="text-align: center ; "][tr][td [&amp;ButtonStyle]][rbutton]SpellBook::RestartBook[/rbutton][/td][/t] --X| --:IncrementCounter| --&amp;[%1%]|[= [&amp;[%1%]] + 1] --&lt;| --:WriteSlot| --!a:[*S:character_id]|!SlotStyle:[&amp;reentryval] --&gt;SlotChoice| --X| --:AddSlot| --=SlotLevel|[&amp;reentryval] --=SlotsExpended|[*S:lvl[$SlotLevel]_slots_expended] --=SlotsLeft|[$SlotsExpended] + 1 --!a:[*S:character_id]|lvl[$SlotLevel]_slots_expended:[$SlotsLeft] --&gt;RestartBook| --X| --:SubtractSlot| --=SlotLevel|[&amp;reentryval] --=SlotsExpended|[*S:lvl[$SlotLevel]_slots_expended] --=SlotsLeft|[$SlotsExpended] - 1 --!a:[*S:character_id]|lvl[$SlotLevel]_slots_expended:[$SlotsLeft] --&gt;RestartBook| --X| --:PrepareOff| --?";sorcerer;warlock;fighter;rogue;artificer;bard;cleric;druid;" -ninc ";[*S:class];"|[ --&amp;SpellEntry|[&amp;reentryval] --~SpellLetters|string;nonumbers;[&amp;SpellEntry] --~SpellNumbers|string;onlynumbers;[&amp;SpellEntry] --Rfind|[*S:character_id];[&amp;SpellLetters];repeating_spell-[&amp;SpellNumbers];spellname --!a:[*S:character_id]|[*R&gt;spellprepared]:0 --&gt;RestartBook| --]|[ --&gt;RestartBook| --]| --X| --:PrepareOn| --&amp;SpellEntry|[&amp;reentryval] --~SpellLetters|string;nonumbers;[&amp;SpellEntry] --~SpellLevel|string;onlynumbers;[&amp;SpellEntry] --Rfind|[*S:character_id];[&amp;SpellLetters];repeating_spell-[&amp;SpellLevel];spellname --!a:[*S:character_id]|[*R&gt;spellprepared]:1 --&gt;RestartBook| --X| }} EDIT: 2025-03-31 - I've updated the Mod to include Artificers. EDIT: 2025-03-31 - Added Ranger Class - Fixed Max Prepared Spells for Clerics - Fixed title wrapping for characters with long names. EDIT: 2025-03-31 - Complete overhaul of the Mod, onto version 2.0.0 EDIT: 2025-03-31 - Tightened up the code and got rid of some redundancies. Clerics and Druids spellbooks now only display prepared spells. All spell description buttons now work. Version 2.0.1 EDIT: 2025-04-01 - Added the ability to add or remove spell slots so it's not necessary to open the character sheet to do so. Cleaned up the formatting so it'a a bit cleaner, also tooltips "hotspots" are more accurate. Be sure to update both the script and the template script. And don't forget to reset the template. EDIT: 2025-04-07 - Expanded the tooltips on spells to include more information, so at a glance there is more information without having to click any buttons. EDIT: 2025-04-12 - My use of [button] was throwing JS errors to the console, changed to [sheetbutton] to prevent it. These errors were throwing me off, so I didn't notice other errors relating to cantrips not having spell slots, also fixed. EDIT: 2025-05-11 - Changed source of images to direct raw images as they were inconsistently loading otherwise EDIT: 2025-05-27 - Added colour selection for spell slots, click the spell slots to access.
1743359248

Edited 1744497683
I'm aware this is not the most sophisticated or efficient way getting the information from the repeating sections, but anything more complicated is beyond me at this point. I'm also aware that this mod throws JS errors to the Output Console, which is a chat based error. It has to do with the Attack Roll buttons, the character_id&nbsp;spell id isn't being passed to the chat, but the buttons still work, so it's a mystery to me. "Error at /home/node/d20-api-server/textchat.js:534:17 at String.replace (&lt;anonymous&gt;) at TextChatFactory.d20.textchat.doChatInput (/home/node/d20-api-server/textchat.js:384:33) at sendChat (/home/node/d20-api-server/api.js:2251:16) at apiscript.js:1330:10 at /home/node/d20-api-server/pubsub.js:63:16 at Object.publish (/home/node/d20-api-server/pubsub.js:68:8) at Timeout.processChatQueue [as _onTimeout] (/home/node/d20-api-server/api.js:1997:14) at listOnTimeout (node:internal/timers:569:17) at process.processTimers (node:internal/timers:512:7)"
Updated to 1.0.1, I forgot Artificers existed, updated the mod to include them.
1743408268

Edited 1743408396
Gauss
Forum Champion
Nice, and here I was silly and went and did that with a 27 page (in a word doc) macro :D Oh, that will get much bigger in my next iteration.&nbsp; MUAHAH! The main problem I forsee, Clerics, Druids, and the like with all spells on their spell list. I don't see you dropping them when they are not prepared. It will wind up being a very large list.&nbsp;
Yeah, I was thinking of that. I tested with a level 20 cleric and it is a problem. The larger the list of spells the more spells get duplicated in the list too, not sure why that happens. Dropping the nonprepared spells does reduce functionality, since you would have to choose your spells from your character sheet. I don't think there's any way around that, though. Thanks for the feedback.
1743434693

Edited 1743434831
Updated to 1.0.2, I forgot rangers existed so I added them. The title line-height wasn't high enough to allow proper wrapping of long character names, is now fixed. Cleric Max Prepared Spells were calculating using intelligence mod, now fixed to use wisdom mod. Duplicate spell listings seems to not be a problem anymore, through some rewrites earlier I must have fixed it.
1743443994

Edited 1743444092
Gauss
Forum Champion
Timothy B. said: Yeah, I was thinking of that. I tested with a level 20 cleric and it is a problem. The larger the list of spells the more spells get duplicated in the list too, not sure why that happens. Dropping the nonprepared spells does reduce functionality, since you would have to choose your spells from your character sheet. I don't think there's any way around that, though. Thanks for the feedback. In my experience the reason for having spells in the Chat Menu is to avoid having to access your sheet when casting.&nbsp; My players rarely need to look at their sheets, most everything is available via macro buttons, including spells via Chat Menu.&nbsp; The main time they need to look at the sheet is when they are preparing spells. And they should look at the sheet at that point. That way they can get the best data that just wouldn't work so well in a Chat Menu.&nbsp;
Updated Mod to version 2.0.0. I've reduced the size of the script by about 2/3's. I've also removed the Scriptcard that displays the detailed spell description and changed the button to use the built-in description. I'll be working on Gauss' suggestion to remove prepared spells for classes that have access to their entire spell list. Known Issues: I've had problems getting the Spell Details button to work for spells that are attacks. Looking at the D&amp;D 5E Roll20 it says to use&nbsp; %{selected|repeating_spell-3_$1_spelldesc_link} &nbsp;which doesn't seem to exist. Instead those details are from the repeating_attacks repeating section, but I can't call upon that without restarting any --R lookups. If anyone has any idea how to fix this, please let me know.
1743455249

Edited 1743455402
Timothy B. said: Known Issues: I've had problems getting the Spell Details button to work for spells that are attacks. Looking at the D&amp;D 5E Roll20 it says to use&nbsp; %{selected|repeating_spell-3_$1_spelldesc_link} &nbsp;which doesn't seem to exist. Instead those details are from the repeating_attacks repeating section, but I can't call upon that without restarting any --R lookups. If anyone has any idea how to fix this, please let me know. I just updated the wiki .&nbsp;&nbsp; It looks like you want this instead: %{selected|repeating_spell-3_$1_output} If you just want the content of the spell description, it's this: @{selected|repeating_spell-3_$1_spelldescription}
Thanks Jarren, that's exactly what I was looking for. Updated to version 2.0.1. Cleric and Druid Spellbooks only show prepared spells now. All Spell Details buttons now work. Tightened up some code.
1743563767

Edited 1743565067
Updated to 2.1.0, new feature that allows players to add or remove spell slots by clicking the plus or minus buttons. Cleaned up the formatting, it's much cleaner than it was before and is more consistent overall. Make sure to update both the main script and the template script, and reset your templates. Unless there are any found bugs, I think this one is done.
1743728896

Edited 1743728992
Updated to 2.2.0 Thought of a new feature, use your own spell macros! Your spell macro will take over the attack roll button and spell detail button. Just name your spell the same as the spell name, only with hyphens instead of spaces. ex. "Mind Sliver" to "Mind-Sliver", without quotes of course. Now this Mod should be done.
Updated to 2.2.1 I actually got the chance to use my own Mod as a player. One of things lacking was the tooltip information for each spell. It now includes all aspects of the spell, in a quick to digest format.
Updated to 2.2.2. I changed the buttons to use [sheetbutton] instead of [button] to prevent the aforementioned JS chat based errors being thrown to the console. The JS errors, unfortunately, encouraged me to ignore the console errors and so I didn't notice attribute errors caused by trying to find cantrip slots, which they obviously don't have. This has also been fixed.
Updated to 2.2.4. I'm not sure what is going on with Github, but the conventional way of embedding images from that site is working inconsistently. Instead, I've had to use the raw image URL. I'm not entirely sure how Github image storing works, or why they instruct people to use the method they do and not just use the raw URL? Hopefully, it's not a problem for them.
Updated to 2.3.0. Added a feature that lets you select the colour of the glowing spell slots. Just click the slots themselves and a card will appear with the selection.