
******* New Version of Mod Available ******* Hi All, This is my mod displaying a characters known spells. I t's for the D&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(&quot;<a href="https://files.d20.io/images/105716505/oymO0pnVyLCv-tQDw2vddA/med.png&quot" rel="nofollow">https://files.d20.io/images/105716505/oymO0pnVyLCv-tQDw2vddA/med.png&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(&quot;<a href="https://files.d20.io/images/105716694/59KW_4mBR3y_Iz45sQw2-g/med.png&quot" rel="nofollow">https://files.d20.io/images/105716694/59KW_4mBR3y_Iz45sQw2-g/med.png&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(&quot;<a href="https://files.d20.io/images/105716694/59KW_4mBR3y_Iz45sQw2-g/med.png&quot" rel="nofollow">https://files.d20.io/images/105716694/59KW_4mBR3y_Iz45sQw2-g/med.png&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&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&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
--&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 ;"
--&HeaderBonus|style="display: inline-block ; position: relative ; top: 2px ;"
--&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}
--&RollImage|[d20]1[/d20]
--#parameterDelimiter|$$$
--?"[*S:class]" -inc "fighter"|&ClassImage$$$&#x132C1;
--?";wizard;rogue;" -inc ";[*S:class];"|&ClassImage$$$&#x269a;
--?"[*S:class]" -inc "warlock"|&ClassImage$$$&#x26D3;
--?"[*S:class]" -inc "Sorcerer"|&ClassImage$$$&#x2726;
--?";cleric;paladin;" -inc ";[*S:class];"|&ClassImage$$$&#x273A;
--?";druid;ranger;" -inc ";[*S:class];"|&ClassImage$$$&#x130E0;
--?"[*S:class]" -inc "artificer"|&ClassImage$$$&#x2699;
--&Infinity|&#x221E;
--&BookImage|&#x1F56E;
--&BlueDot|&#x1F535;
--&BlankDot|&#x1F518;
--?";warlock;sorcerer;bard;rogue;fighter;ranger;" -inc ";[*S:class];"|&PrepTotal$$$[&Infinity]|&PrepTotal$$$[$PrepTotal.Raw]
--?"[&PrepTotal]" -eq "[&Infinity]"|&FontSize$$$30|&FontSize$$$20
--#parameterDelimiter|;
--&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>
--&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>
--&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>
--&SCA|[*S:spellcasting_ability]
--~SCA|string;substring;3;3;[&SCA]
--&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 ;"
--&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 ; "
-->Header|
--Rfirst|[*S:character_id];repeating_spell-cantrip;spellname
--?"[*R:spellname]" -ne "NoRepeatingAttributeLoaded"|>BookOutput;cantrip
--Rfirst|[*S:character_id];repeating_spell-1;spellname
--?"[*R:spellname]" -ne "NoRepeatingAttributeLoaded"|>BookOutput;1
--Rfirst|[*S:character_id];repeating_spell-2;spellname
--?"[*R:spellname]" -ne "NoRepeatingAttributeLoaded"|>BookOutput;2
--Rfirst|[*S:character_id];repeating_spell-3;spellname
--?"[*R:spellname]" -ne "NoRepeatingAttributeLoaded"|>BookOutput;3
--Rfirst|[*S:character_id];repeating_spell-4;spellname
--?"[*R:spellname]" -ne "NoRepeatingAttributeLoaded"|>BookOutput;4
--Rfirst|[*S:character_id];repeating_spell-5;spellname
--?"[*R:spellname]" -ne "NoRepeatingAttributeLoaded"|>BookOutput;5
--Rfirst|[*S:character_id];repeating_spell-6;spellname
--?"[*R:spellname]" -ne "NoRepeatingAttributeLoaded"|>BookOutput;6
--Rfirst|[*S:character_id];repeating_spell-7;spellname
--?"[*R:spellname]" -ne "NoRepeatingAttributeLoaded"|>BookOutput;7
--Rfirst|[*S:character_id];repeating_spell-8;spellname
--?"[*R:spellname]" -ne "NoRepeatingAttributeLoaded"|>BookOutput;8
--Rfirst|[*S:character_id];repeating_spell-9;spellname
--?"[*R:spellname]" -ne "NoRepeatingAttributeLoaded"|>BookOutput;9
--X|
--:Header|
--&Header|[t width=100% [&HeaderImage]][tr][td title="Spellcasting Ability" width=60px][b]&#x272F;[F::16][&SCA(touppercase)][/F][/b][/td][td title="Spell Save DC" width=60px][F::16]&#x1F6E1;[/F][b][F::20][*S:spell_save_dc][/F][/b][/td][td title="Spellcasting Bonus" width=60px [&HeaderBonus]][b][F::5][&RollImage]&nbsp;[/F][F::20][*S:spell_attack_bonus][/F][/b][/td][td title="Max Prepared Spells" width=60px][F::18][&ClassImage][/F][F::[&FontSize]][b][&PrepTotal][/b][/F][/td][/tr][/t]
--+|[&Header]
--<|
--:BookOutput|
--#title|@{selected|character_name}'s Spell Book
--&SpellLevel|[%1%]
--?"[&SpellLevel]" -ninc "cantrip"|[
--#parameterDelimiter|$$$
--?"[*S:lvl[&SpellLevel]_slots_expended]" -eq 0 -and "[*S:lvl[&SpellLevel]_slots_total]" -eq 0|&Slots$$$[&MissingSlot][&MissingSlot][&MissingSlot][&MissingSlot]
--?"[*S:lvl[&SpellLevel]_slots_expended]" -eq 0 -and "[*S:lvl[&SpellLevel]_slots_total]" -eq 1|&Slots$$$[&EmptySlot][&MissingSlot][&MissingSlot][&MissingSlot]
--?"[*S:lvl[&SpellLevel]_slots_expended]" -eq 1 -and "[*S:lvl[&SpellLevel]_slots_total]" -eq 1|&Slots$$$[&FullSlot][&MissingSlot][&MissingSlot][&MissingSlot]
--?"[*S:lvl[&SpellLevel]_slots_expended]" -eq 0 -and "[*S:lvl[&SpellLevel]_slots_total]" -eq 2|&Slots$$$[&EmptySlot][&EmptySlot][&MissingSlot][&MissingSlot]
--?"[*S:lvl[&SpellLevel]_slots_expended]" -eq 1 -and "[*S:lvl[&SpellLevel]_slots_total]" -eq 2|&Slots$$$[&FullSlot][&EmptySlot][&MissingSlot][&MissingSlot]
--?"[*S:lvl[&SpellLevel]_slots_expended]" -eq 2 -and "[*S:lvl[&SpellLevel]_slots_total]" -eq 2|&Slots$$$[&FullSlot][&FullSlot][&MissingSlot][&MissingSlot]
--?"[*S:lvl[&SpellLevel]_slots_expended]" -eq 0 -and "[*S:lvl[&SpellLevel]_slots_total]" -eq 3|&Slots$$$[&EmptySlot][&EmptySlot][&EmptySlot][&MissingSlot]
--?"[*S:lvl[&SpellLevel]_slots_expended]" -eq 1 -and "[*S:lvl[&SpellLevel]_slots_total]" -eq 3|&Slots$$$[&FullSlot][&EmptySlot][&EmptySlot][&MissingSlot]
--?"[*S:lvl[&SpellLevel]_slots_expended]" -eq 2 -and "[*S:lvl[&SpellLevel]_slots_total]" -eq 3|&Slots$$$[&FullSlot][&FullSlot][&EmptySlot][&MissingSlot]
--?"[*S:lvl[&SpellLevel]_slots_expended]" -eq 3 -and "[*S:lvl[&SpellLevel]_slots_total]" -eq 3|&Slots$$$[&FullSlot][&FullSlot][&FullSlot][&MissingSlot]
--?"[*S:lvl[&SpellLevel]_slots_expended]" -eq 0 -and "[*S:lvl[&SpellLevel]_slots_total]" -eq 4|&Slots$$$[&EmptySlot][&EmptySlot][&EmptySlot][&EmptySlot]
--?"[*S:lvl[&SpellLevel]_slots_expended]" -eq 1 -and "[*S:lvl[&SpellLevel]_slots_total]" -eq 4|&Slots$$$[&FullSlot][&EmptySlot][&EmptySlot][&EmptySlot]
--?"[*S:lvl[&SpellLevel]_slots_expended]" -eq 2 -and "[*S:lvl[&SpellLevel]_slots_total]" -eq 4|&Slots$$$[&FullSlot][&FullSlot][&EmptySlot][&EmptySlot]
--?"[*S:lvl[&SpellLevel]_slots_expended]" -eq 3 -and "[*S:lvl[&SpellLevel]_slots_total]" -eq 4|&Slots$$$[&FullSlot][&FullSlot][&FullSlot][&EmptySlot]
--?"[*S:lvl[&SpellLevel]_slots_expended]" -eq 4 -and "[*S:lvl[&SpellLevel]_slots_total]" -eq 4|&Slots$$$[&FullSlot][&FullSlot][&FullSlot][&FullSlot]
--?"[*S:lvl[&SpellLevel]_slots_total]" -eq "[*S:lvl[&SpellLevel]_slots_expended]"|&PlusSlot$$$|&PlusSlot$$$[rbutton]+::AddSlot;[&SpellLevel][/rbutton]
--?"[*S:lvl[&SpellLevel]_slots_expended]" -eq 0|&MinusSlot$$$|&MinusSlot$$$[rbutton]-::SubtractSlot;[&SpellLevel][/rbutton]
--#parameterDelimiter|;
--]|
--#parameterDelimiter|$$$
--?"[&SpellLevel]" -inc "cantrip"|&Slots$$$[&Infinity]|&Slots$$$[&Slots]
--?"[&Slots]" -eq "[&Infinity]"|&InfStyle$$$style="position: relative; top: 1px ; "|&InfStyle$$$
--?"[&SpellLevel]" -inc "cantrip"|&SpellLevelOutput$$$C|&SpellLevelOutput$$$[&SpellLevel]
--#parameterDelimiter|;
--&LevelStyle|style="position: relative; top: -2px ; "
--&MinusStyle|style="position: relative; top: -4px ; "
--?"[&SpellLevel]" -inc "cantrip"|&PlusSlot;
--?"[&SpellLevel]" -inc "cantrip"|&MinusSlot;
--&SpellOutput|[t width=100% [&LevelBackground]][tr][td width=25 height=40 [&LevelStyle]][br][F::20][b][&SpellLevelOutput][/b][/F][/td][td width=40px [&MinusStyle]][b][F::30][r][&MinusSlot][/r][/F][/b][/td][td width=135px [&InfStyle]][F::46][rbutton][&Slots]::SlotChoice[/rbutton][/F][/td][td width=40px][b][F::22][l][&PlusSlot][/l][/F][/b][/td][/tr][/t]
--&SpellOutput|+[t width=240px]
--~|array;fromrepeatingsection;lvlSpells;[*S:character_id];repeating_spell-[&SpellLevel];spellname
--%SpellLoop|foreach;lvlSpells
--Rfind|[*S:character_id];[&SpellLoop];repeating_spell-[&SpellLevel];spellname
--&SpellData|[*R:spellname][&SpellLevel]
--?"[*R:spellconcentration]" -inc 1|&Concentration;(c)|&Concentration;
--?"[*R:spellritual]" -inc "Yes"|&Ritual;(r)|&Ritual;
--~MacroName|string;replaceall; ;-;[&SpellLoop]
--~MacroButton|system;findability;[*S:character_name];[&MacroName]
--?"[&MacroButton]" -ne "AbilityNotFound"|[
--&SpellRoll|[F::6][button][&RollImage]::~[*S:character_name]|[&MacroButton][/button][/F]
--]|[
--?"[*R:spelloutput]" -inc "ATTACK"|[
--&SpellRoll|[F::6][sheetbutton][&RollImage]::@{selected|character_name}::[*R>spell][/sheetbutton][/F]
--]|
--?"[*R:spelloutput]" -inc "SPELLCARD"|[
--&SpellRoll|[F::6][rbutton]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;::SpellInfo;[&SpellData][/rbutton][/F]
--]|
--]|
--#parameterDelimiter|$$$
--?"[&MacroButton]" -ne "AbilityNotFound"|[
--&SpellDetail|[button][&BookImage]::~[*S:character_name]|[&MacroButton][/button]
--]|[
--&SpellDetail|[sheetbutton][&BookImage]::@{selected|character_name}::[*R>output][/sheetbutton]
--]|
--?";warlock;sorcerer;bard;rogue;fighter;ranger;" -inc ";[*S:class];" -or "[*R:spellprepared]" -eq 1 -or "[&SpellLevel]" -inc "cantrip"|&Prepared$$$[rbutton][&BlueDot]::PrepareOff;[&SpellData][/rbutton]|&Prepared$$$[rbutton][&BlankDot]::PrepareOn;[&SpellData][/rbutton]
--?"[*R:spellcomp_v]" -inc "v=1"|&ToolVerb$$$V|&ToolVerb$$$
--?"[*R:spellcomp_s]" -inc "s=1"|&ToolSomatic$$$,S|&ToolSomatic$$$
--?"[*R:spellcomp_m]" -inc "m=1"|&ToolMat$$$,M([*R:spellcomp_materials])|&ToolMat$$$
--&ToolComp|[&ToolVerb][&ToolSomatic][&ToolMat]&nbsp;&#124;&nbsp;
--&ToolRange|R:&nbsp;[*R:spellrange]&nbsp;&#124;&nbsp;
--?"[*R:spelltarget]" -eq ""|&ToolTarget$$$|&ToolTarget$$$T:&nbsp;[*R:spelltarget]&nbsp;&#124;&nbsp;
--&ToolDuration|[*R:spellduration]&nbsp;&#124;&nbsp;
--?"[*R:spellcastingtime]" -eq ""|&ToolCT$$$|&ToolCT$$$[*R:spellcastingtime]&nbsp;&#124;&nbsp;
--?"[*R:spellritual]" -inc "Yes"|&ToolRit$$$[&Ritual]&nbsp;&#124;&nbsp;|&ToolRit$$$
--?"[*R:spellconcentration]" -eq ""|&ToolCon$$$|&ToolCon$$$(c)&nbsp;&#124;&nbsp;
--?"[*R:innate]" -eq ""|&ToolInnate$$$|&ToolInnate$$$[*R:innate]&nbsp;&#124;&nbsp;
--?"[*R:spellathigherlevels]" -eq ""|&ToolHigher$$$|&ToolHigher$$$&nbsp;&#124;&nbsp;[*R:spellathigherlevels]
--#parameterDelimiter|;
--&ToolTip|title="[&ToolCT][&ToolRange][&ToolTarget][&ToolComp][&ToolRit][&ToolCon][&ToolDuration][&ToolInnate][*R:spelldescription][&ToolHigher]"
--?"[*S:class]" -inc "cleric" -or "[*S:class]" -inc "druid" -and "[*R:spellprepared]" -eq 1 -or "[&SpellLevel]" -inc "cantrip"|[
--&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 ; " [&ToolTip]][b][#000][&SpellLoop][/#][/b][i]&nbsp;[&Concentration]&nbsp;[&Ritual]&nbsp;[*R:innate][/i][/td][td width=20 title="Cast Spell" style="position: relative ; top: 4px ; "][&SpellRoll][/td][td width=40 title="Prepared"]|[F::15][&Prepared][/F]|[/td][td width=20 title="Spell Details"][F::16][&SpellDetail][/F][/td][/tr]
--]|
--?"[*S:class]" -ninc "cleric" -and "[*S:class]" -ninc "druid" -and "[&SpellLevel]" -ninc "cantrip"|[
--&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 ; " [&ToolTip]][b][#000][&SpellLoop][/#][/b][i]&nbsp;[&Concentration]&nbsp;[&Ritual]&nbsp;[*R:innate][/i][/td][td width=20 title="Cast Spell" style="position: relative ; top: 4px ; "][&SpellRoll][/td][td width=40 title="Prepared"]|[F::15][&Prepared][/F]|[/td][td width=20 title="Spell Details"][F::16][&SpellDetail][/F][/td][/tr]
--]|
--%|
--&SpellOutput|+[/t]
--+|[&SpellOutput]
--<|
--:SlotChoice|
--#title|Choose a Slot Style
--#whisper|self
--~|array;define;SlotChoice;default;red;orange;yellow;green;blue;purple;pink
--&SlotsPerRow|4
--&SlotsCounter|1
--&SlotOutput|[br][br][t width=100% style="text-align: center ;" border=1][tr]
--%loop|foreach;SlotChoice
--&SlotOutput|+[td width=30 [&Darkbg]][rbutton][img width=30]<a href="https://raw.githubusercontent.com/VirulentArc/Resources/refs/heads/main/d20/Supernotes_Themes/spellbook/template/spellslot_[&loop].webp#.png[/img]::WriteSlot;[&loop][/rbutton][br][b][&loop][/b][/td]" rel="nofollow">https://raw.githubusercontent.com/VirulentArc/Resources/refs/heads/main/d20/Supernotes_Themes/spellbook/template/spellslot_[&loop].webp#.png[/img]::WriteSlot;[&loop][/rbutton][br][b][&loop][/b][/td]</a>
--?[= [&SlotsCounter] % [&SlotsPerRow] ] -eq 0|&SlotOutput;+[/tr][tr]
-->IncrementCounter|SlotsCounter
--%|
--&SlotOutput|+[/tr][/t]
--+|[&SlotOutput]
--+|[br][br][t width=100% border=1 style="text-align: center ;"][tr][td width=60%][b]Current Slot Style[/b][/td][td [&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 [&ButtonStyle]][rbutton]SpellBook::RestartBook[/rbutton][/td][/t]
--X|
--:IncrementCounter|
--&[%1%]|[= [&[%1%]] + 1]
--<|
--:WriteSlot|
--!a:[*S:character_id]|!SlotStyle:[&reentryval]
-->SlotChoice|
--X|
--:AddSlot|
--=SlotLevel|[&reentryval]
--=SlotsExpended|[*S:lvl[$SlotLevel]_slots_expended]
--=SlotsLeft|[$SlotsExpended] + 1
--!a:[*S:character_id]|lvl[$SlotLevel]_slots_expended:[$SlotsLeft]
-->RestartBook|
--X|
--:SubtractSlot|
--=SlotLevel|[&reentryval]
--=SlotsExpended|[*S:lvl[$SlotLevel]_slots_expended]
--=SlotsLeft|[$SlotsExpended] - 1
--!a:[*S:character_id]|lvl[$SlotLevel]_slots_expended:[$SlotsLeft]
-->RestartBook|
--X|
--:PrepareOff|
--?";sorcerer;warlock;fighter;rogue;artificer;bard;cleric;druid;" -ninc ";[*S:class];"|[
--&SpellEntry|[&reentryval]
--~SpellLetters|string;nonumbers;[&SpellEntry]
--~SpellNumbers|string;onlynumbers;[&SpellEntry]
--Rfind|[*S:character_id];[&SpellLetters];repeating_spell-[&SpellNumbers];spellname
--!a:[*S:character_id]|[*R>spellprepared]:0
-->RestartBook|
--]|[
-->RestartBook|
--]|
--X|
--:PrepareOn|
--&SpellEntry|[&reentryval]
--~SpellLetters|string;nonumbers;[&SpellEntry]
--~SpellLevel|string;onlynumbers;[&SpellEntry]
--Rfind|[*S:character_id];[&SpellLetters];repeating_spell-[&SpellLevel];spellname
--!a:[*S:character_id]|[*R>spellprepared]:1
-->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.