Hey Oginme / Joshua I'm using the D&D 5E 2014 sheet by Roll20, which is the same sheet I use in all my other games. !script {{ }} does work. Some ScriptCard spells work, and others do not. When executing these ScriptCards, nothing happens; there is no message in chat and no errors. "ScriptCards: 34 Templates loaded" "-=> ScriptCards - 3.0.01 by Kurt Jaegers Ready <=- Meta Offset : 50193" All my other mods appear to be working Here are some examples: (They all work in my other games) Works: !script {{ --/|Script Name : 5E Fireball --/|Version : 1.1 --/|Requires SC : 1.3.1+ --/|Author : Kurt Jaegers --/|Description : Deals fireball damage to all tokens that represent creations in a 20' radius around target token --/|Set up the card appearance --#title|@{selected|character_name} casts Fireball! --#bodyFontSize|12px --#titlecardbackground|#800000 --#leftsub|Save DC @{selected|spell_save_dc} --/|Get a spell slot level from the caster. --=SpellLevel|?{Spell Slot Level?|3|4|5|6|7|8|9} --#rightsub|Slot Level: [$SpellLevel] --/|Calculate damage based on spell slot. Fireball is 8d6 for 3rd level, so 5+SpellLevel d6 total. --=DamageDice|[$SpellLevel.Total] + 5 --=Damage|[$DamageDice.Total]d6 --=HalfDamage|[$Damage.Total] \ 2 --/|Since we want to be able to hover over a roll and see the dice details, output the rolled damage at the --/|top of the card. If all critters make their save, the half damage roll won't contain the details. --+|[c][b]Damage Roll: [/b][$Damage][/c] --+|&nbsp; --/|Get all tokens on the page into the "alltokens" array --~|array;pagetokens;alltokens;@{target|token_id} --/|Create the "inRange" array. It will have a blank item in it to begin with, which we will remove later. --~|array;define;inRange; --/|Loop through all of the tokens in "alltokens" to check their distance --~tokenid|array;getfirst;alltokens --?[&tokenid] -eq ArrayError|endOutput --:loopCheck| --/|Skip targets that are not on the token layer or that don't represent creatures --?[*[&tokenid]:t-layer] -ne objects|continue --?"[*[&tokenid]:t-represents]" -ninc "-"|continue --/|Check the distance between the target token and the current array token. 20 feet is 4 units --~dist|distance;@{target|token_id};[&tokenid] --?[$dist] -gt 4|continue --/|If we didn't skip over this part, the token is within 20 feet, so add it to the inRange array --~|array;add;inRange;[&tokenid] --:continue| --~tokenid|array;getnext;alltokens --?[&tokenid] -ne ArrayError|loopCheck --/|Remove the dummy first item in the inRange array --~|array;removeat;inRange;0 --/|Loop through the inRange tokens and roll saves for each one and apply damage --~tokenid|array;getfirst;inRange --?[&tokenid] -eq ArrayError|endOutput --:loopDisplay| -->MakeSavingThrow|[&tokenid];dexterity;@{selected|spell_save_dc};[$Damage.Total];fire;thisTokenDamage;saveResult;dex --+[*[&tokenid]:character_name]:|Save [$savingThrow] [r][$thisTokenDamage] fire damage[/r] --/|Put a burn-fire visual effect on impacted tokens --vtoken|[&tokenid] burn-fire --/|Get the next token and continue the loop until we run out. --~tokenid|array;getnext;inRange --?[&tokenid] -ne ArrayError|loopDisplay --/|Add some extra visual effects - a nova-fire at the target, and a beam-fire from source to target --vtoken|@{target|token_id} nova-fire --vbetweentokens|@{selected|token_id} @{target|token_id} beam-fire --:endOutput| --X| --/|Subroutine to make saving throws and calculate damage amounts --:MakeSavingThrow|tokenid;savetype;dc;damage;damagetype;damagevariable;saveresultvariable;shortabilityname --?"X[*[%1%]:npc_[%8%]_save_base]" -eq "X"|>set_string;baseSaveBonus;|>set_string;baseSaveBonus; + + [*[%1%]:npc_[%8%]_save_base] --=savingThrow|1d20 + [*[%1%]:[%2%]_save_bonus] [&baseSaveBonus] --&dmgmult| --?[$savingThrow] -ge [%3%]|>set_string;dmgmult; \ 2 --?[$savingThrow] -lt [%3%]|>set_string;[%7%];fail --?[$savingThrow] -ge [%3%]|>set_string;[%7%];success --?"[*[%1%]:npc_resistances]" -inc "[%5%]" -and [$savingThrow] -lt [%3%]|>set_string;dmgmult; \ 2 --?"[*[%1%]:npc_resistances]" -inc "[%5%]" -and [$savingThrow] -ge [%3%]|>set_string;dmgmult; * 0 --?"[*[%1%]:npc_vulnerabilities]" -inc "[%5%]" -and [$savingThrow] -ge [%3%]|>set_string;dmgmult; --?"[*[%1%]:npc_vulnerabilities]" -inc "[%5%]" -and [$savingThrow] -lt [%3%]|>set_string;dmgmult; * 2 --?"[*[%1%]:npc_immunities]" -inc "[%5%]"|>set_string;dmgmult; * 0 --=[%6%]|[%4%] [&dmgmult] --<| --:set_string|mod_variable;value --&[%1%]|[%2%] --<| --/|Subroutine to apply damage with TokenMod. Could be replcaed with alterbars or chatsetattr --:ApplyDamageTokenmod|Parameters are tokenid;bar#;amount --@token-mod|_ignore-selected _ids [%1%] _set bar[%2%]_value|[%3%] --<| }} Doesn't Work: !script {{ --/|Script Name : 5E Magic Missile --/|Version : 2.2 --/|Requires SC : 1.5.2+ --/|Author : Kurt Jaegers --/|Description : Handles the D&D 5E spell Magic Missile, with the ability to select a dynamic --/| number of targets. --/| --/| You can optionally have damage applied to impacted tokens. The script defaults to using --/| TokenMod to update Bar 3. These can be changed by altering the settings below. --/| If you use one die roll for Magic Missile, update the damageMode variable below. --/|Set this to either "scriptcards" or anything else to not apply damage --&damageApplyScript|scriptcards --/|Set this to the bar number you use to track hit points --&hitPointsBar|3 --/|Set this variable to the (case sensitive) name of a Jukebox track to play when the spell is cast --&SoundEffectTrack|Magic_Missile --/|If damageMode is 1, a separate die will be rolled for each missile. Set this variable to 0 to, --/|only have a single damage die roll applied to each missile. --&damageMode|1 --/|Magic Missile by the book does Force damage. --&damageType|force --/|===================== There are no customization options below this line ===================== --=SlotLevel|?{Spell Slot Level?|1|2|3|4|5|6|7|8|9} --=MissileCount|[$SlotLevel] + 2 --=OneMissileDamage|1d4+1 -->BuildAndAskTargets|[$MissileCount.Total] --=DisplayCount|1 --=MissileDamage|0 --#leftsub|Slot level [$SlotLevel] --#rightsub|Ranged Attack --#emoteText|@{selected|character_name} uses a level [$SlotLevel.Total] spell slot to fire [$MissileCount.Total] missiles of magical force! --/|Determine damage subroutine. Start by assuming we aren't going to apply damage --&damageRoutine|DontApplyDamage --?[&damageApplyScript] -eq "scriptcards"|&damageRoutine;ApplyDamageScriptCards --a|[&SoundEffectTrack] --:MissileLoop| -->FireMissile|[$DisplayCount.Total] --=DisplayCount|[$DisplayCount] + 1 --?[$DisplayCount] -le [$MissileCount]|MissileLoop --+Total|Total damage is [$MissileDamage] -->DeductSpellSlot| --#rightsub|Level [$SlotLevel] Left: [$SlotsRemaining] --X| --:FireMissile| --&ThisTarget|[&target[%1%]] --?[&damageMode] -eq 1|=ThisMissile;1d4+1|=ThisMissile;[$OneMissileDamage] --=MissileDamage|[$MissileDamage] + [$ThisMissile] --+Missile|[$DisplayCount.Total] Hits [*[&ThisTarget]:character_name] for [$ThisMissile] [b]force[/b] damage -->PlayEffects|@{selected|token_id};[&ThisTarget];none;burst-smoke;beam-magic --=ResultantDamage|[$ThisMissile.Raw] --?"[*[&tokenid]:npc_immunities]" -inc "[&damageType]"|Immune --?"[*[&tokenid]:npc_resistances]" -inc "[&damageType]"|Resistant --?"[*[&tokenid]:npc_vulnerabilities]" -inc "[&damageType]"|Vulnerable --^DoneResist| --:Immune| --=ResultantDamage|0 --^DoneResist| --:Resistant| --=ResultantDamage|[$ThisMissile] \ 2 --^DoneResist| --:Vulnerable| --=ResultantDamage|[$ThisMissile] * 2 --^DoneResist| --:DoneResist| -->[&damageRoutine]|[&ThisTarget];[&hitPointsBar];-[$ResultantDamage.Raw] --<| --:BuildAndAskTargets| --&TargetString| --=targetCount|1 --:TargetLoop| --&TargetString|+t;target[$targetCount.Raw];Missile [$targetCount.Raw] Target --=targetCount|[$targetCount.Raw] + 1 --?[$targetCount] -le [%1%]|>AddSeparator --?[$targetCount] -le [%1%]|TargetLoop --iPlease click the button below to select magic missile targets. The same target can be selected multiple times;Select [%1%] Targets|[&TargetString] --/| --<| --:AddSeparator| --&TargetString|+|| --<| --/|===================== Subroutines ===================== --/|There are four "ApplyDamage" subroutines - one for scriptcards built-in functions, one for alterbars, one for token-mod, and one to not apply damage --/|Apply damage via ScriptCards' built-in object modification function (new in ScriptCards 1.5.0) --:ApplyDamageScriptCards|Parameters are tokenid;bar#;amount --=applyValue|[%3%] --=newValue|[*[%1%]:t-bar[%2%]_value] + [$applyValue] --?[$newValue] -lt 0|=newValue;0 --?[$newValue] -gt [*[%1%]:t-bar[%2%]_max]|=newValue;[*[%1%]:t-bar[%2%]_max] --!t:[%1%]|bar[%2%]_value:[$newValue.Raw] --<| --/|Just a dummy routine that doesn't do anything, but it is easier to do it this way than adding logic to see if we are --/|skipping applying damage in the main routine. --:DontApplyDamage| --<| --:PlayEffects|Parameters are : sourcetoken; targettoken; source effect; target effect; line effect; sound effect --vtoken|[%1%] [%3%] --vtoken|[%2%] [%4%] --vbetweentokens|[%1%] [%2%] [%5%] --<| }} Doesn't Work: !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|
}}