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

Trying to create a Spellbook marco/API help please

So im trying to create a spellbook for my PC's that shows what spells there have prepared however I dont know enough to write my own code and all the other codes I cant seem to follow. At the moment this is as far as i have gotton with the spellbook code: /w "@{selected|character_name}" &{template:atk} [[ {{desc=***@{selected|character_name} Spells*** ___________________________ **Cantrips** [@{Selected|repeating_spell-cantrip_$0_spellname}](~Selected|repeating_spell-cantrip_$0_spell) | [@{Selected|repeating_spell-cantrip_$1_spellname}](~Selected|repeating_spell-cantrip_$1_spell) | [@{Selected|repeating_spell-cantrip_$2_spellname}](~Selected|repeating_spell-cantrip_$2_spell) | [@{Selected|repeating_spell-cantrip_$3_spellname}](~Selected|repeating_spell-cantrip_$3_spell) | [@{Selected|repeating_spell-cantrip_$4_spellname}](~Selected|repeating_spell-cantrip_$4_spell) | [@{Selected|repeating_spell-cantrip_$5_spellname}](~Selected|repeating_spell-cantrip_$5_spell)  ** 1st Level ([[@{selected|lvl1_slots_total}-@{selected|lvl1_slots_expended}]]/@{selected|lvl1_slots_total}) spell slots** [@{Selected|repeating_spell-1_$0_spellname}](~Selected|repeating_spell-1_$0_spell) | [@{Selected|repeating_spell-1_$1_spellname}](~Selected|repeating_spell-1_$1_spell) | [@{Selected|repeating_spell-1_$2_spellname}](~Selected|repeating_spell-1_$2_spell) | [@{Selected|repeating_spell-1_$3_spellname}](~Selected|repeating_spell-1_$3_spell) | [@{Selected|repeating_spell-1_$4_spellname}](~Selected|repeating_spell-1_$4_spell) | [@{Selected|repeating_spell-1_$5_spellname}](~Selected|repeating_spell-1_$5_spell) **2nd Level ([[@{selected|lvl2_slots_total}-@{selected|lvl2_slots_expended}]]/@{selected|lvl2_slots_total}) spell slots** [@{Selected|repeating_spell-2_$0_spellname}](~Selected|repeating_spell-2_$0_spell) | [@{Selected|repeating_spell-2_$1_spellname}](~Selected|repeating_spell-2_$1_spell) | [@{Selected|repeating_spell-2_$2_spellname}](~Selected|repeating_spell-2_$2_spell) | [@{Selected|repeating_spell-2_$3_spellname}](~Selected|repeating_spell-2_$3_spell) | [@{Selected|repeating_spell-2_$4_spellname}](~Selected|repeating_spell-2_$4_spell) **3rd Level ([[@{selected|lvl3_slots_total}-@{selected|lvl3_slots_expended}]]/@{selected|lvl3_slots_total}) spell slots** [@{Selected|repeating_spell-3_$0_spellname}](~Selected|repeating_spell-3_$0_spell) | [@{Selected|repeating_spell-3_$1_spellname}](~Selected|repeating_spell-3_$1_spell) | [@{Selected|repeating_spell-3_$2_spellname}](~Selected|repeating_spell-3_$2_spell) **4th Level ([[@{selected|lvl4_slots_total}-@{selected|lvl4_slots_expended}]]/@{selected|lvl4_slots_total}) spell slots** [@{Selected|repeating_spell-4_$0_spellname}](~Selected|repeating_spell-4_$0_spell)  | [@{Selected|repeating_spell-4_$1_spellname}](~Selected|repeating_spell-4_$1_spell) | [@{Selected|repeating_spell-4_$2_spellname}](~Selected|repeating_spell-4_$2_spell)  **5th Level ([[@{selected|lvl5_slots_total}-@{selected|lvl5_slots_expended}]]/@{selected|lvl5_slots_total}) spell slots** [@{Selected|repeating_spell-5_$0_spellname}](~Selected|repeating_spell-5_$0_spell) | [@{Selected|repeating_spell-5_$1_spellname}](~Selected|repeating_spell-5_$1_spell) | [@{Selected|repeating_spell-5_$2_spellname}](~Selected|repeating_spell-5_$2_spell) | [@{Selected|repeating_spell-5_$3_spellname}](~Selected|repeating_spell-5_$3_spell)  **6th Level ([[@{selected|lvl6_slots_total}-@{selected|lvl6_slots_expended}]]/@{selected|lvl6_slots_total}) spell slots** [@{Selected|repeating_spell-6_$0_spellname}](~Selected|repeating_spell-6_$0_spell) | [@{Selected|repeating_spell-6_$1_spellname}](~Selected|repeating_spell-6_$1_spell) }} So if anyone can help me so that it shows prepered spells only or just mark prepered spells that would be great thank you.
// Spell-Book -- requires PowerCards script !power {{ --format|bigbad --orowbg|#CEC7B6 --erowbg|#CEC7B6 --name|Spell Book --tokenid|@{selected|token_id} --emote|@{selected|character_name} --leftsub|Atk Bonus: @{selected|spell_attack_bonus} --rightsub|Save DC: @{selected|spell_save_dc} --spell_slots|@{selected|character_id} --spell_list|@{selected|character_id} }}
is there anything else i need to add to that? cos its not rolling and i have the latest powercard script
I believe that it is all there. The spells won't show up unless they are selected as prepared on the character's spell sheet. (Red dot next to the spell). The core of this script is: !power {{ --spell_slots|@{selected|character_id} --spell_list|@{selected|character_id} }} See it that gives you any results. The prepared spells should show up in chat and you should only need to click them to cast them.
I assume that you are using the 5e by Roll20 character sheet. Select a character token with prepared spells on it's character sheet. paste the following into the chat window: !power --spell_list|@{selected|character_id}
Still getting nothing. I have this code that kinda works: !power {{ --emote|** @{selected|token_name} Uses a Holy Symbol ** --tokenid|@{selected|token_id} --titlebackground|none --titlefontshadow|none --whisper|@{selected|character_name},GM --corners|10 --format|atwill --name|^^Spell Book --leftsub|@{selected|character_name} --rightsub|Level @{selected|level} @{selected|class}^^ ^^ --**Spell Save DC**| [[ 8 + [[@{selected|pb}]]+ @{selected|wisdom_mod}]] ^^**Spell Attack Bonus** [[ [[@{selected|pb}]] + @{selected|wisdom_mod} ]] --Amount of Prepared Spells:| [[@{selected|wisdom_mod} + @{Selected|Level} ]] ^^^^ ~C ** Available Spells ** ~C **Level 1 :** [[@{selected|lvl1_slots_total}]] **Remaining** [[@{selected|lvl1_slots_expended}]]^^ **Level 2 :** [[@{selected|lvl2_slots_total}]] **Remaining** [[@{selected|lvl2_slots_expended}]] --spell_list|@{selected|character_id} **Level 3 :** [[@{selected|lvl3_slots_total}]] **Remaining** [[@{selected|lvl3_slots_expended}]] --spell_list|@{selected|character_id} **Level 4 :** [[@{selected|lvl4_slots_total}]] **Remaining** [[@{selected|lvl4_slots_expended}]] --spell_list|@{selected|character_id} **Level 5 :** [[@{selected|lvl5_slots_total}]] **Remaining** [[@{selected|lvl5_slots_expended}]] --spell_list|@{selected|character_id} **Level 6 :** [[@{selected|lvl6_slots_total}]] **Remaining** [[@{selected|lvl6_slots_expended}]] --spell_list|@{selected|character_id} }} --Cantrips:| [@{selected|repeating_spell-cantrip_$0_spellname}](~selected|repeating_spell-cantrip_$0_spell) [@{selected|repeating_spell-cantrip_$1_spellname}](~selected|repeating_spell-cantrip_$1_spell) [@{selected|repeating_spell-cantrip_$2_spellname}](~selected|repeating_spell-cantrip_$2_spell) [@{selected|repeating_spell-cantrip_$3_spellname}](~selected|repeating_spell-cantrip_$3_spell) [@{selected|repeating_spell-cantrip_$4_spellname}](~selected|repeating_spell-cantrip_$4_spell) [@{selected|repeating_spell-cantrip_$5_spellname}](~selected|repeating_spell-cantrip_$5_spell) --Level 1:| @{selected|repeating_spell-1_$0_spellprepared}| [@{selected|repeating_spell-1_$0_spellname}](~selected|repeating_spell-1_$0_spell) @{selected|repeating_spell-1_$1_spellprepared}| [@{selected|repeating_spell-1_$1_spellname}](! #CounterBless) @{selected|repeating_spell-1_$2_spellprepared}| [@{selected|repeating_spell-1_$2_spellname}](~selected|repeating_spell-1_$2_spell) @{selected|repeating_spell-1_$3_spellprepared}| [@{selected|repeating_spell-1_$3_spellname}](~selected|repeating_spell-1_$3_spell) @{selected|repeating_spell-1_$4_spellprepared} [@{selected|repeating_spell-1_$4_spellname}](~selected|repeating_spell-1_$4_spell) @{selected|repeating_spell-1_$5_spellprepared}| [@{selected|repeating_spell-1_$5_spellname}](~selected|repeating_spell-1_$5_spell) @{selected|repeating_spell-1_$6_spellprepared}| [@{selected|repeating_spell-1_$6_spellname}](~selected|repeating_spell-1_$6_spell) @{selected|repeating_spell-1_$7_spellprepared}| [@{selected|repeating_spell-1_$7_spellname}](~selected|repeating_spell-1_$7_spell) @{selected|repeating_spell-1_$8_spellprepared}| [@{selected|repeating_spell-1_$8_spellname}](~selected|repeating_spell-1_$8_spell) @{selected|repeating_spell-1_$9_spellprepared}| [@{selected|repeating_spell-1_$9_spellname}](~selected|repeating_spell-1_$9_spell) @{selected|repeating_spell-1_$10_spellprepared}| [@{selected|repeating_spell-1_$10_spellname}](~selected|repeating_spell-1_$10_spell) @{selected|repeating_spell-1_$11_spellprepared}| [@{selected|repeating_spell-1_$11_spellname}](~selected|repeating_spell-1_$11_spell) -@{selected|repeating_spell-1_$12_spellprepared}| [@{selected|repeating_spell-1_$12_spellname}](~selected|repeating_spell-1_$12_spell) @{selected|repeating_spell-1_$13_spellprepared}| [@{selected|repeating_spell-1_$13_spellname}](~selected|repeating_spell-1_$13_spell) @{selected|repeating_spell-1_$14_spellprepared} | [@{selected|repeating_spell-1_$14_spellname}](~selected|repeating_spell-1_$14_spell) @{selected|repeating_spell-1_$15_spellprepared}| [@{selected|repeating_spell-1_$15_spellname}](~selected|repeating_spell-1_$15_spell) @{selected|repeating_spell-1_$16_spellprepared}[@{selected|repeating_spell-1_$16_spellname}](~selected|repeating_spell-1_$16_spell) but this is what i get:
1605888028
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
You can use or steal from these solutions: Non-API NPC Statblock Chat Menu for D&D 5e sheet — No API required! API (Universal Chat Menus) Universal Chat Menus 5e Menu Macros   Spell Filter
Im still not getting anything... and i cant seem to understand any of it, im now looking on youtube to try and understand API's 
1605895935
David M.
Pro
API Scripter
Hm, have you installed the powercards api? In case you haven't, go to your game page and click Settings->API script. In the Roll20 API script library dropdown, start typing the name of the script to install, then select it and "Add Script"
I got it working thank you
David M. said: Hm, have you installed the powercards api? In case you haven't, go to your game page and click Settings->API script. In the Roll20 API script library dropdown, start typing the name of the script to install, then select it and "Add Script" I did, i installed some other APIs and it then seemed to work. I have no clue when it comes to all this, ive just learned to do macros so this is the next step up. I do better at looking at what works and why, then i can go back and try and change it to what I need it for. So far so good lol, just this got me there.