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

[Script] ScriptCards - My "Spiritual Successor" to PowerCards

1622230989
timmaugh
Pro
API Scripter
Brien V. said: So would I use the @(selected.@{selected|ActiveSkill}) in place of the @{selected|[&Skill]}?  Exactly.
@Kurt - thank you!  I looked back at the wiki and saw why I didn't understand - I didn't get the three parameter requirement. So, all --i commands need two parameters other than designating target or query type and they can be the same variable name.  Got it!  Oh...just curious - but why do you have an empty comment line in the subroutine? @tim - that is a very big help and I am grateful for the time and effort you put into the explanation!  I will read through it several more times but I think I get the gist now of the "whys" and "wherefores".  I see why the --i command is necessary (pretty sharp, Kurt!) and why it now needs both variablename and target identifier.   Suggestion:  I don't know if there is one and I just missed it but your explanation would be really useful in a "Beginners Guide to Macro Writing" wiki!  If there isn't such a thing, I would think it would be massive to have one.
I have more questions. I'm trying to set a variable based on how well something succeeds over the DC of a roll.  I'm trying to avoid a long list of conditionals, thought I don't know if that is possible.  Basically there's an additional success for every 5 points above the DC, which I want to be able to display in one of the subtitles. Thoughts?
1622242052

Edited 1622242861
Is it possible to create a 2D Array in scriptcards? Something to the equivalent of... array = [ [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0]             ]; I tried some experiments using stingify and array;define;arrayname;[&arrayname0];[&arrayname1];[&arrayname2];[&arrayname3];[&arrayname4];[&arrayname5];[&arrayname6];[&arrayname7];[&arrayname8];[&arrayname9] or creating a for loop to add the arrays into another array, but I was unable to crack it. Is it possible to nest arrays at all or am I just missing something that's in front of my face? As always, thank you Kurt for creating this. It has changed my attitude toward playing games on roll20 in a very positive way.
1622242404

Edited 1622243039
Are there any hooks into pushing data like images or just text into the 5e by roll20 BIO page? I have access to everything but that. lol. Some of you might find this interesting. This code is for the 5E by Roll20 NPC sheet that has all the hooks for the sheet. Select a token and find out its data, the names of the fields, etc. Below, is also the version for the PCs. It's raw data and not pretty, but it's all there. :) Do what you will with it. FYI- One thing. The PC's don't have a vulnerabilities, resistances, or immunities field for some reason. I don't understand. So I added them to the sheet using chatsetattr. If you get an error for the vulnerabilities, resistances, and immunities section inside the field on the sheet it's because there isn't a field set for them yet. !script {{ --#sourceToken|@{selected|token_id} --#title|@{selected|token_name} --#rightsub|Challenge: [*S:npc_challenge] XP: [*S:npc_xp] --#leftsub|@{selected|npc_type} --+[c]NON-REPEATING INFO|[/c] --+Armor Class:|[*S:npc_ac] [*S:npc_actype] --+HP:|[*S:hp] [*S:npc_hpformula] --+Speed:|[*S:npc_speed] --+Attributes:|STR: [*S:strength] DEX: [*S:dexterity] CON: [*S:constitution] INT: [*S:intelligence] WIS: [*S:wisdom] CHA: [*S:charisma] --+Saves:|STR: [*S:npc_str_save] DEX: [*S:npc_dex_save] CON: [*S:npc_con_save] INT: [*S:npc_int_save] WIS: [*S:npc_wis_save] CHA: [*S:npc_cha_save] --+Skills|Acrobatics: [*S:npc_acrobatics] Animal Handling: [*S:npc_animal_handling] Arcana: [*S:npc_athletics] Athletics: [*S:npc_athletics] Deception: [*S:npc_deception] History: [*S:npc_history] Insight: [*S:npc_insight] Intimidation: [*S:npc_intimidation] Investigation: [*S:npc_investigation] Medicine: [*S:npc_medicine] Nature: [*S:npc_nature] Perception: [*S:npc_perception] Performance: [*S:npc_performance] Persuasion: [*S:npc_persuasion] Religion: [*S:npc_religion] Sleight Of Hand: [*S:npc_sleight_of_hand] Stealth: [*S:npc_stealth] Survival: [*S:npc_survival]  --+VRI| Vulnerabilities: [*S:npc_vulnerabilities] Resistances: [*S:npc_resistances] Immunities: [*S:npc_immunities] Condition Immunities: [*S:npc_condition_immunities] --+Senses:|[*S:npc_senses] --+Languages:|[*S:npc_languages] --+Spellcasting:| Flag: [*S:npcspellcastingflag] Spellcasting Ability: [*S:spellcasting_ability] Spell DC: [*S:spell_dc_mod] Spell Attack Mod: [*S:globalmagicmod] --+Reactions:| Flag: [*S:npcreactionsflag] --+Bonus Actions:| Flag: [*S:npcbonusactionsflag] -->npctraitSection| -->npcactionSection| -->npcaction-lSection| -->npcreactionsSection| -->npcbonusactionSection| -->npcSpellCantripsSection| -->npcSpell1Section| -->npcSpell2Section| -->npcSpell3Section| -->npcSpell4Section| -->npcSpell5Section| -->npcSpell6Section| -->npcSpell7Section| -->npcSpell8Section| -->npcSpell9Section| --X| --:npctraitSection| --+[c]NPC TRAITS[/c]|  --Rfirst|@{selected|character_id};repeating_npctrait  --:npctraitLoop|  --?"[*R:name]" -eq NoRepeatingAttributeLoaded|endTraits  --+[*R:name]:|[*R:description]  --Rnext|  -->npctraitLoop|    --:endTraits| --<| --:npcactionSection| --+[c]NPC ACTIONS[/c]|  --Rfirst|@{selected|character_id};repeating_npcaction  --:npcactionLoop|  --?"[*R:name]" -eq NoRepeatingAttributeLoaded|endAction  --+[*R:name]:|Attack Flag: [*R:attack_flag] Attack Type: [*R:attack_type] Attack Range: [*R:attack_range] To Hit: [*R:attack_tohit] Target: [*R:attack_target] Damage: [*R:attack_damage] Damage Type: [*R:attack_damagetype] Damage2: [*R:attack_damage2] Damage2 Type: [*R:attack_damagetype2] Description: [*R:description]  --Rnext|  -->npcactionLoop|    --:endAction| --<| --:npcaction-lSection| --+[c]NPC LENGENDARY ACTIONS[/c]|  --Rfirst|@{selected|character_id};repeating_npcaction-l  --:npcaction-lLoop|  --?"[*R:name]" -eq NoRepeatingAttributeLoaded|endAction-l  --+[*R:name]:|Attack Flag: [*R:attack_flag] Attack Type: [*R:attack_type] Attack Range: [*R:attack_range] To Hit: [*R:attack_tohit] Target: [*R:attack_target] Damage: [*R:attack_damage] Damage Type: [*R:attack_damagetype] Damage2: [*R:attack_damage2] Damage2 Type: [*R:attack_damagetype2] Description: [*R:description]  --Rnext|  -->npcaction-lLoop|    --:endAction-l| --<| --:npcreactionsSection| --+[c]NPC REACTIONS[/c]|  --Rfirst|@{selected|character_id};repeating_npcreaction  --:npcreactionsLoop|  --?"[*R:name]" -eq NoRepeatingAttributeLoaded|endReactions  --+[*R:name]:|Attack Flag: [*R:attack_flag] Attack Type: [*R:attack_type] Attack Range: [*R:attack_range] To Hit: [*R:attack_tohit] Target: [*R:attack_target] Damage: [*R:attack_damage] Damage Type: [*R:attack_damagetype] Damage2: [*R:attack_damage2] Damage2 Type: [*R:attack_damagetype2] Description: [*R:description]  --Rnext|  -->npcreactionsLoop|    --:endReactions| --<| --:npcbonusactionSection| --+[c]NPC BONUS ACTIONS[/c]|  --Rfirst|@{selected|character_id};repeating_npcbonusaction  --:npcbonusactionLoop|  --?"[*R:name]" -eq NoRepeatingAttributeLoaded|endBonusactions  --+[*R:name]:|Attack Flag: [*R:attack_flag] Attack Type: [*R:attack_type] Attack Range: [*R:attack_range] To Hit: [*R:attack_tohit] Target: [*R:attack_target] Damage: [*R:attack_damage] Damage Type: [*R:attack_damagetype] Damage2: [*R:attack_damage2] Damage2 Type: [*R:attack_damagetype2] Description: [*R:description]  --Rnext|  -->npcbonusactionLoop|    --:endBonusactions| --<| --:npcSpellCantripsSection| --+[c]NPC CANTRIPS[/c]|  --Rfirst|@{selected|character_id};repeating_spell-cantrip  --:npcspellCantripLoop|  --?"[*R:spellname]" -eq NoRepeatingAttributeLoaded|endNpcSpellCantrip  --+[*R:spellname]:|Spell Prepared: [*R:spellprepared] Spell School: [*R:spellschool] Spell Ritual Flag: [*R:spellritualflag] Spell Casting Time: [*R:spellcastingtime] Spell Range: [*R:spellrange] Spell Target: [*R:spelltarget] Spell Comp V: [*R:spellcomp_v] Spell Comp S: [*R:spellcomp_v] Spell Comp M: [*R:spellcomp_m] Spell Comp Materials: [*R:spellcomp_materials] Concentration Flag: [*R:spellconcentrationflag] Spell Duration: [*R:spellduration] Spell Output: [*R:spelloutput] Spell Attack: [*R:spellattack] Spell Damage: [*R:spelldamage] Spell Damage Type: [*R:spelldamagetype] Spell Damage2[*R:spelldamage2] Spell Damage2 Type: [*R:spelldamagetype2] Spell Healing: [*R:spellhealing] Spell Damage Mod: [*R:spelldmgmod] Spell Save: [*R:spellsave] Spell Save Success: [*R:spellsavesuccess] Spell Higher Level Die: [*R:spellhldie] Spell Higher Level Die Type: [*R:spellhldietype] Spell Higher Level Bonus: [*R:spellhlbonus] Description: [*R:spelldescription] Spell at the Highe Levels: [*R:spellathigherlevels] Prep Toggle: [*R:prep] Spell Name [*R:spellname] --Rdump|  --Rnext|  -->npcspellCantripLoop|    --:endNpcSpellCantrip| --<| --:npcSpell1Section| --+[c]NPC 1st LEVEL SPELLS[/c]|  --Rfirst|@{selected|character_id};repeating_spell-1  --:npcspell1Loop|  --?"[*R:spellname]" -eq NoRepeatingAttributeLoaded|endNpcSpell1  --+[*R:spellname]:|Spell Prepared: [*R:spellprepared] Spell School: [*R:spellschool] Spell Ritual Flag: [*R:spellritualflag] Spell Casting Time: [*R:spellcastingtime] Spell Range: [*R:spellrange] Spell Target: [*R:spelltarget] Spell Comp V: [*R:spellcomp_v] Spell Comp S: [*R:spellcomp_v] Spell Comp M: [*R:spellcomp_m] Spell Comp Materials: [*R:spellcomp_materials] Concentration Flag: [*R:spellconcentrationflag] Spell Duration: [*R:spellduration] Spell Output: [*R:spelloutput] Spell Attack: [*R:spellattack] Spell Damage: [*R:spelldamage] Spell Damage Type: [*R:spelldamagetype] Spell Damage2[*R:spelldamage2] Spell Damage2 Type: [*R:spelldamagetype2] Spell Healing: [*R:spellhealing] Spell Damage Mod: [*R:spelldmgmod] Spell Save: [*R:spellsave] Spell Save Success: [*R:spellsavesuccess] Spell Higher Level Die: [*R:spellhldie] Spell Higher Level Die Type: [*R:spellhldietype] Spell Higher Level Bonus: [*R:spellhlbonus] Description: [*R:spelldescription] Spell at the Highe Levels: [*R:spellathigherlevels] Prep Toggle: [*R:prep] Spell Name [*R:spellname] --Rdump|  --Rnext|  -->npcspell1Loop|    --:endNpcSpell1| --<| --:npcSpell2Section| --+[c]NPC 2nd LEVEL SPELLS[/c]|  --Rfirst|@{selected|character_id};repeating_spell-2  --:npcspell2Loop|  --?"[*R:spellname]" -eq NoRepeatingAttributeLoaded|endNpcSpell2  --+[*R:spellname]:|Spell Prepared: [*R:spellprepared] Spell School: [*R:spellschool] Spell Ritual Flag: [*R:spellritualflag] Spell Casting Time: [*R:spellcastingtime] Spell Range: [*R:spellrange] Spell Target: [*R:spelltarget] Spell Comp V: [*R:spellcomp_v] Spell Comp S: [*R:spellcomp_v] Spell Comp M: [*R:spellcomp_m] Spell Comp Materials: [*R:spellcomp_materials] Concentration Flag: [*R:spellconcentrationflag] Spell Duration: [*R:spellduration] Spell Output: [*R:spelloutput] Spell Attack: [*R:spellattack] Spell Damage: [*R:spelldamage] Spell Damage Type: [*R:spelldamagetype] Spell Damage2[*R:spelldamage2] Spell Damage2 Type: [*R:spelldamagetype2] Spell Healing: [*R:spellhealing] Spell Damage Mod: [*R:spelldmgmod] Spell Save: [*R:spellsave] Spell Save Success: [*R:spellsavesuccess] Spell Higher Level Die: [*R:spellhldie] Spell Higher Level Die Type: [*R:spellhldietype] Spell Higher Level Bonus: [*R:spellhlbonus] Description: [*R:spelldescription] Spell at the Highe Levels: [*R:spellathigherlevels] Prep Toggle: [*R:prep] Spell Name [*R:spellname] --Rdump|  --Rnext|  -->npcspell2Loop|    --:endNpcSpell2| --<| --:npcSpell3Section| --+[c]NPC 3rd LEVEL SPELLS[/c]|  --Rfirst|@{selected|character_id};repeating_spell-3  --:npcspell3Loop|  --?"[*R:spellname]" -eq NoRepeatingAttributeLoaded|endNpcSpell3  --+[*R:spellname]:|Spell Prepared: [*R:spellprepared] Spell School: [*R:spellschool] Spell Ritual Flag: [*R:spellritualflag] Spell Casting Time: [*R:spellcastingtime] Spell Range: [*R:spellrange] Spell Target: [*R:spelltarget] Spell Comp V: [*R:spellcomp_v] Spell Comp S: [*R:spellcomp_v] Spell Comp M: [*R:spellcomp_m] Spell Comp Materials: [*R:spellcomp_materials] Concentration Flag: [*R:spellconcentrationflag] Spell Duration: [*R:spellduration] Spell Output: [*R:spelloutput] Spell Attack: [*R:spellattack] Spell Damage: [*R:spelldamage] Spell Damage Type: [*R:spelldamagetype] Spell Damage2[*R:spelldamage2] Spell Damage2 Type: [*R:spelldamagetype2] Spell Healing: [*R:spellhealing] Spell Damage Mod: [*R:spelldmgmod] Spell Save: [*R:spellsave] Spell Save Success: [*R:spellsavesuccess] Spell Higher Level Die: [*R:spellhldie] Spell Higher Level Die Type: [*R:spellhldietype] Spell Higher Level Bonus: [*R:spellhlbonus] Description: [*R:spelldescription] Spell at the Highe Levels: [*R:spellathigherlevels] Prep Toggle: [*R:prep] Spell Name [*R:spellname] --Rdump|  --Rnext|  -->npcspell3Loop|    --:endNpcSpell3| --<| --:npcSpell4Section| --+[c]NPC 4th LEVEL SPELLS[/c]|  --Rfirst|@{selected|character_id};repeating_spell-4  --:npcspell4Loop|  --?"[*R:spellname]" -eq NoRepeatingAttributeLoaded|endNpcSpell4  --+[*R:spellname]:|Spell Prepared: [*R:spellprepared] Spell School: [*R:spellschool] Spell Ritual Flag: [*R:spellritualflag] Spell Casting Time: [*R:spellcastingtime] Spell Range: [*R:spellrange] Spell Target: [*R:spelltarget] Spell Comp V: [*R:spellcomp_v] Spell Comp S: [*R:spellcomp_v] Spell Comp M: [*R:spellcomp_m] Spell Comp Materials: [*R:spellcomp_materials] Concentration Flag: [*R:spellconcentrationflag] Spell Duration: [*R:spellduration] Spell Output: [*R:spelloutput] Spell Attack: [*R:spellattack] Spell Damage: [*R:spelldamage] Spell Damage Type: [*R:spelldamagetype] Spell Damage2[*R:spelldamage2] Spell Damage2 Type: [*R:spelldamagetype2] Spell Healing: [*R:spellhealing] Spell Damage Mod: [*R:spelldmgmod] Spell Save: [*R:spellsave] Spell Save Success: [*R:spellsavesuccess] Spell Higher Level Die: [*R:spellhldie] Spell Higher Level Die Type: [*R:spellhldietype] Spell Higher Level Bonus: [*R:spellhlbonus] Description: [*R:spelldescription] Spell at the Highe Levels: [*R:spellathigherlevels] Prep Toggle: [*R:prep] Spell Name [*R:spellname] --Rdump|  --Rnext|  -->npcspell4Loop|    --:endNpcSpell4| --<| --:npcSpell5Section| --+[c]NPC 5th LEVEL SPELLS[/c]|  --Rfirst|@{selected|character_id};repeating_spell-5  --:npcspell5Loop|  --?"[*R:spellname]" -eq NoRepeatingAttributeLoaded|endNpcSpell5  --+[*R:spellname]:|Spell Prepared: [*R:spellprepared] Spell School: [*R:spellschool] Spell Ritual Flag: [*R:spellritualflag] Spell Casting Time: [*R:spellcastingtime] Spell Range: [*R:spellrange] Spell Target: [*R:spelltarget] Spell Comp V: [*R:spellcomp_v] Spell Comp S: [*R:spellcomp_v] Spell Comp M: [*R:spellcomp_m] Spell Comp Materials: [*R:spellcomp_materials] Concentration Flag: [*R:spellconcentrationflag] Spell Duration: [*R:spellduration] Spell Output: [*R:spelloutput] Spell Attack: [*R:spellattack] Spell Damage: [*R:spelldamage] Spell Damage Type: [*R:spelldamagetype] Spell Damage2[*R:spelldamage2] Spell Damage2 Type: [*R:spelldamagetype2] Spell Healing: [*R:spellhealing] Spell Damage Mod: [*R:spelldmgmod] Spell Save: [*R:spellsave] Spell Save Success: [*R:spellsavesuccess] Spell Higher Level Die: [*R:spellhldie] Spell Higher Level Die Type: [*R:spellhldietype] Spell Higher Level Bonus: [*R:spellhlbonus] Description: [*R:spelldescription] Spell at the Highe Levels: [*R:spellathigherlevels] Prep Toggle: [*R:prep] Spell Name [*R:spellname] --Rdump|  --Rnext|  -->npcspell5Loop|    --:endNpcSpell5| --<| --:npcSpell6Section| --+[c]NPC 6th LEVEL SPELLS[/c]|  --Rfirst|@{selected|character_id};repeating_spell-6  --:npcspell6Loop|  --?"[*R:spellname]" -eq NoRepeatingAttributeLoaded|endNpcSpell6  --+[*R:spellname]:|Spell Prepared: [*R:spellprepared] Spell School: [*R:spellschool] Spell Ritual Flag: [*R:spellritualflag] Spell Casting Time: [*R:spellcastingtime] Spell Range: [*R:spellrange] Spell Target: [*R:spelltarget] Spell Comp V: [*R:spellcomp_v] Spell Comp S: [*R:spellcomp_v] Spell Comp M: [*R:spellcomp_m] Spell Comp Materials: [*R:spellcomp_materials] Concentration Flag: [*R:spellconcentrationflag] Spell Duration: [*R:spellduration] Spell Output: [*R:spelloutput] Spell Attack: [*R:spellattack] Spell Damage: [*R:spelldamage] Spell Damage Type: [*R:spelldamagetype] Spell Damage2[*R:spelldamage2] Spell Damage2 Type: [*R:spelldamagetype2] Spell Healing: [*R:spellhealing] Spell Damage Mod: [*R:spelldmgmod] Spell Save: [*R:spellsave] Spell Save Success: [*R:spellsavesuccess] Spell Higher Level Die: [*R:spellhldie] Spell Higher Level Die Type: [*R:spellhldietype] Spell Higher Level Bonus: [*R:spellhlbonus] Description: [*R:spelldescription] Spell at the Highe Levels: [*R:spellathigherlevels] Prep Toggle: [*R:prep] Spell Name [*R:spellname] --Rdump|  --Rnext|  -->npcspell6Loop|    --:endNpcSpell6| --<| --:npcSpell7Section| --+[c]NPC 7th LEVEL SPELLS[/c]|  --Rfirst|@{selected|character_id};repeating_spell-7  --:npcspell7Loop|  --?"[*R:spellname]" -eq NoRepeatingAttributeLoaded|endNpcSpell7  --+[*R:spellname]:|Spell Prepared: [*R:spellprepared] Spell School: [*R:spellschool] Spell Ritual Flag: [*R:spellritualflag] Spell Casting Time: [*R:spellcastingtime] Spell Range: [*R:spellrange] Spell Target: [*R:spelltarget] Spell Comp V: [*R:spellcomp_v] Spell Comp S: [*R:spellcomp_v] Spell Comp M: [*R:spellcomp_m] Spell Comp Materials: [*R:spellcomp_materials] Concentration Flag: [*R:spellconcentrationflag] Spell Duration: [*R:spellduration] Spell Output: [*R:spelloutput] Spell Attack: [*R:spellattack] Spell Damage: [*R:spelldamage] Spell Damage Type: [*R:spelldamagetype] Spell Damage2[*R:spelldamage2] Spell Damage2 Type: [*R:spelldamagetype2] Spell Healing: [*R:spellhealing] Spell Damage Mod: [*R:spelldmgmod] Spell Save: [*R:spellsave] Spell Save Success: [*R:spellsavesuccess] Spell Higher Level Die: [*R:spellhldie] Spell Higher Level Die Type: [*R:spellhldietype] Spell Higher Level Bonus: [*R:spellhlbonus] Description: [*R:spelldescription] Spell at the Highe Levels: [*R:spellathigherlevels] Prep Toggle: [*R:prep] Spell Name [*R:spellname] --Rdump|  --Rnext|  -->npcspell7Loop|    --:endNpcSpell7| --<| --:npcSpell8Section| --+[c]NPC 8th LEVEL SPELLS[/c]|  --Rfirst|@{selected|character_id};repeating_spell-8  --:npcspell8Loop|  --?"[*R:spellname]" -eq NoRepeatingAttributeLoaded|endNpcSpell8  --+[*R:spellname]:|Spell Prepared: [*R:spellprepared] Spell School: [*R:spellschool] Spell Ritual Flag: [*R:spellritualflag] Spell Casting Time: [*R:spellcastingtime] Spell Range: [*R:spellrange] Spell Target: [*R:spelltarget] Spell Comp V: [*R:spellcomp_v] Spell Comp S: [*R:spellcomp_v] Spell Comp M: [*R:spellcomp_m] Spell Comp Materials: [*R:spellcomp_materials] Concentration Flag: [*R:spellconcentrationflag] Spell Duration: [*R:spellduration] Spell Output: [*R:spelloutput] Spell Attack: [*R:spellattack] Spell Damage: [*R:spelldamage] Spell Damage Type: [*R:spelldamagetype] Spell Damage2[*R:spelldamage2] Spell Damage2 Type: [*R:spelldamagetype2] Spell Healing: [*R:spellhealing] Spell Damage Mod: [*R:spelldmgmod] Spell Save: [*R:spellsave] Spell Save Success: [*R:spellsavesuccess] Spell Higher Level Die: [*R:spellhldie] Spell Higher Level Die Type: [*R:spellhldietype] Spell Higher Level Bonus: [*R:spellhlbonus] Description: [*R:spelldescription] Spell at the Highe Levels: [*R:spellathigherlevels] Prep Toggle: [*R:prep] Spell Name [*R:spellname] --Rdump|  --Rnext|  -->npcspell8Loop|    --:endNpcSpell8| --<| --:npcSpell9Section| --+[c]NPC 9th LEVEL SPELLS[/c]|  --Rfirst|@{selected|character_id};repeating_spell-9  --:npcspell9Loop|  --?"[*R:spellname]" -eq NoRepeatingAttributeLoaded|endNpcSpell9  --+[*R:spellname]:|Spell Prepared: [*R:spellprepared] Spell School: [*R:spellschool] Spell Ritual Flag: [*R:spellritualflag] Spell Casting Time: [*R:spellcastingtime] Spell Range: [*R:spellrange] Spell Target: [*R:spelltarget] Spell Comp V: [*R:spellcomp_v] Spell Comp S: [*R:spellcomp_v] Spell Comp M: [*R:spellcomp_m] Spell Comp Materials: [*R:spellcomp_materials] Concentration Flag: [*R:spellconcentrationflag] Spell Duration: [*R:spellduration] Spell Output: [*R:spelloutput] Spell Attack: [*R:spellattack] Spell Damage: [*R:spelldamage] Spell Damage Type: [*R:spelldamagetype] Spell Damage2[*R:spelldamage2] Spell Damage2 Type: [*R:spelldamagetype2] Spell Healing: [*R:spellhealing] Spell Damage Mod: [*R:spelldmgmod] Spell Save: [*R:spellsave] Spell Save Success: [*R:spellsavesuccess] Spell Higher Level Die: [*R:spellhldie] Spell Higher Level Die Type: [*R:spellhldietype] Spell Higher Level Bonus: [*R:spellhlbonus] Description: [*R:spelldescription] Spell at the Highe Levels: [*R:spellathigherlevels] Prep Toggle: [*R:prep] Spell Name [*R:spellname] --Rdump|  --Rnext|  -->npcspell9Loop|    --:endNpcSpell9| --<| --X| }} this is the PC info sheet with all the hooks. Hope you find this useful. !script {{ --#sourceToken|@{selected|token_id} --#title|@{selected|token_name} --#rightsub|Challenge:  --#leftsub| --+[c]NON-REPEATING INFO|[/c] --+Armor Class:|[*S:ac] --+HP:|[*S:hp] --+Speed:|[*S:speed] --+Attributes:|STR: [*S:strength] DEX: [*S:dexterity] CON: [*S:constitution] INT: [*S:intelligence] WIS: [*S:wisdom] CHA: [*S:charisma] --+Saves:|STR: [*S:strength_save_bonus] DEX: [*S:dexterity_save_bonus] CON: [*S:constitution_save_bonus] INT: [*S:intelligence_save_bonus] WIS: [*S:wisdom_save_bonus] CHA: [*S:charisma_save_bonus] --+Skills|Acrobatics: [*S:acrobatics_bonus] Animal Handling: [*S:animal_handling_bonus] Arcana: [*S:arcana_bonus] Athletics: [*S:athletics_bonus] Deception: [*S:deception_bonus] History: [*S:history_bonus] Insight: [*S:insight_bonus] Intimidation: [*S:intimidation_bonus] Investigation: [*S:investigation_bonus] Medicine: [*S:medicine_bonus] Nature: [*S:nature_bonus] Perception: [*S:perception_bonus] Performance: [*S:performance_bonus] Persuasion: [*S:persuasion_bonus] Religion: [*S:religion_bonus] Sleight Of Hand: [*S:sleight_of_hand_bonus] Stealth: [*S:stealth_bonus] Survival: [*S:survival_bonus]  --+VRI| Vulnerabilities: [*S:vulnerabilities] Resistances: [*S:resistances] Immunities: [*S:immunities] Condition Immunities: [*S:condition_immunities] -->attackSection| -->traitsSection| -->proficienciesSection| -->globaldmgmodSection| -->globalsavemodSection| -->globaltohitmodSection| -->globalskillmodSection| -->globalacmodSection| -->SpellCantripsSection| -->Spell1Section| -->Spell2Section| -->Spell3Section| -->Spell4Section| -->Spell5Section| -->Spell6Section| -->Spell7Section| -->Spell8Section| -->Spell9Section| -->toolsSection| -->inventorySection| --X| --:attackSection| --+[c]ATTACKS[/c]|  --Rfirst|@{selected|character_id};repeating_attack  --:attackLoop|  --?"[*R:atkname]" -eq NoRepeatingAttributeLoaded|endAttack  --+[*R:atkname]:|Attack Base: [*R:atkattr_base] Options Flag: [*R:options-flag] Spell ID: [*R:spellid] Spell Level: [*R:spelllevel] Save DC: [*R:savedc] Attack Flag: [*R:atkflag] Damage Base: [*R:dmgbase] Damage Flag: [*R:dmgflag] Damage Attribute: [*R:dmgattr] Damage Type: [*R:dmgtype] Damage2 Base: [*R:dmg2base] Damage2 Type: [*R:dmg2type] Damage2 Attribute: [*R:dmg2attr] Atack Range: [*R:atkrange] Save Flag: [*R:saveflag] Save Effect: [*R:saveeffect] Higher Level Damage: [*R:hldmg] Innate Spellcasting: [*R:spell_innate] Attack Description: [*R:atk_desc] Attack Damage Type: [*R:atkdmgtype] Attack Bonus: [*R:atkbonus]  --Rnext|  -->attackLoop|    --:endAttack| --<| --:traitsSection| --+[c]TRAITS[/c]|  --Rfirst|@{selected|character_id};repeating_traits  --:traitsLoop|  --?"[*R:name]" -eq NoRepeatingAttributeLoaded|endtraits  --+[*R:name]:| Description: [*R:description] Source Type: [*R:source_type] Source: [*R:source] Options Flag: [*R:options-flag] Display Flag: [*R:display_flag]  --Rnext|  -->traitsLoop|    --:endtraits| --<| --:globaldmgmodSection| --+[c]GLOBAL DAMAGE MODIFIERS[/c]|  --Rfirst|@{selected|character_id};repeating_damagemod  --:damgemodLoop|  --?"[*R:global_damage_name]" -eq NoRepeatingAttributeLoaded|enddamagemod  --+[*R:global_damage_name]:| Global Damage Damage: [*R:global_damage_damage] Global Damage Type: [*R:global_damage_type] Global Damage Active Flag: [*R:global_damage_active_flag]  --Rnext|  -->damgemodLoop|    --:enddamagemod| --<| --:globalsavemodSection| --+[c]GLOBAL SAVE MODIFIERS[/c]|  --Rfirst|@{selected|character_id};repeating_savemod  --:savemodLoop|  --?"[*R:global_save_name]" -eq NoRepeatingAttributeLoaded|endsavemod  --+[*R:global_save_name]:| Global Save Roll: [*R:global_save_roll] Global Save Active Flag: [*R:global_save_active_flag] Options Flag:[*R:options-flag]  --Rnext|  -->savemodLoop|    --:endsavemod| --<| --:globaltohitmodSection| --+[c]GLOBAL TO HIT MODIFIERS[/c]|  --Rfirst|@{selected|character_id};repeating_tohitmod  --:attackmodLoop|  --?"[*R:global_attack_name]" -eq NoRepeatingAttributeLoaded|endattackmod  --+[*R:global_attack_name]:| Global Attack Roll: [*R:global_attack_roll] Global Attack Active Flag: [*R:global_attack_active_flag] Options Flag:[*R:options-flag]  --Rnext|  -->attackmodLoop|    --:endattackmod| --<| --:globalskillmodSection| --+[c]GLOBAL SKILL MODIFIERS[/c]|  --Rfirst|@{selected|character_id};repeating_skillmod  --:skillmodLoop|  --?"[*R:global_skill_name]" -eq NoRepeatingAttributeLoaded|endskillmod  --+[*R:global_skill_name]:| Global Skill Roll: [*R:global_skill_roll] Global Skill Active Flag: [*R:global_skill_active_flag] Options Flag:[*R:options-flag]  --Rnext|  -->skillmodLoop|    --:endskillmod| --<| --:globalacmodSection| --+[c]GLOBAL AC MODIFIERS[/c]|  --Rfirst|@{selected|character_id};repeating_acmod  --:acmodLoop|  --?"[*R:global_ac_name]" -eq NoRepeatingAttributeLoaded|endacmod  --+[*R:global_ac_name]:| Global AC Value: [*R:global_ac_val] Global AC Active Flag: [*R:global_ac_active_flag]  --Rnext|  -->acmodLoop|    --:endacmod| --<| --:SpellCantripsSection| --+[c]CANTRIPS[/c]|  --Rfirst|@{selected|character_id};repeating_spell-cantrip  --:spellCantripLoop|  --?"[*R:spellname]" -eq NoRepeatingAttributeLoaded|endSpellCantrip  --+[*R:spellname]:|Spell Prepared: [*R:spellprepared] Spell School: [*R:spellschool] Spell Ritual Flag: [*R:spellritualflag] Spell Casting Time: [*R:spellcastingtime] Spell Range: [*R:spellrange] Spell Target: [*R:spelltarget] Spell Comp V: [*R:spellcomp_v] Spell Comp S: [*R:spellcomp_v] Spell Comp M: [*R:spellcomp_m] Spell Comp Materials: [*R:spellcomp_materials] Concentration Flag: [*R:spellconcentrationflag] Spell Duration: [*R:spellduration] Spell Output: [*R:spelloutput] Spell Attack: [*R:spellattack] Spell Damage: [*R:spelldamage] Spell Damage Type: [*R:spelldamagetype] Spell Damage2[*R:spelldamage2] Spell Damage2 Type: [*R:spelldamagetype2] Spell Healing: [*R:spellhealing] Spell Damage Mod: [*R:spelldmgmod] Spell Save: [*R:spellsave] Spell Save Success: [*R:spellsavesuccess] Spell Higher Level Die: [*R:spellhldie] Spell Higher Level Die Type: [*R:spellhldietype] Spell Higher Level Bonus: [*R:spellhlbonus] Description: [*R:spelldescription] Spell at the Highe Levels: [*R:spellathigherlevels] Prep Toggle: [*R:prep] Spell Name [*R:spellname] --Rnext|  -->spellCantripLoop|    --:endSpellCantrip| --<| --:Spell1Section| --+[c]1st LEVEL SPELLS[/c]|  --Rfirst|@{selected|character_id};repeating_spell-1  --:spell1Loop|  --?"[*R:spellname]" -eq NoRepeatingAttributeLoaded|endSpell1  --+[*R:spellname]:|Spell Prepared: [*R:spellprepared] Spell School: [*R:spellschool] Spell Ritual Flag: [*R:spellritualflag] Spell Casting Time: [*R:spellcastingtime] Spell Range: [*R:spellrange] Spell Target: [*R:spelltarget] Spell Comp V: [*R:spellcomp_v] Spell Comp S: [*R:spellcomp_v] Spell Comp M: [*R:spellcomp_m] Spell Comp Materials: [*R:spellcomp_materials] Concentration Flag: [*R:spellconcentrationflag] Spell Duration: [*R:spellduration] Spell Output: [*R:spelloutput] Spell Attack: [*R:spellattack] Spell Damage: [*R:spelldamage] Spell Damage Type: [*R:spelldamagetype] Spell Damage2[*R:spelldamage2] Spell Damage2 Type: [*R:spelldamagetype2] Spell Healing: [*R:spellhealing] Spell Damage Mod: [*R:spelldmgmod] Spell Save: [*R:spellsave] Spell Save Success: [*R:spellsavesuccess] Spell Higher Level Die: [*R:spellhldie] Spell Higher Level Die Type: [*R:spellhldietype] Spell Higher Level Bonus: [*R:spellhlbonus] Description: [*R:spelldescription] Spell at the Highe Levels: [*R:spellathigherlevels] Prep Toggle: [*R:prep] Spell Name [*R:spellname] --Rnext|  -->spell1Loop|    --:endSpell1| --<| --:Spell2Section| --+[c]2nd LEVEL SPELLS[/c]|  --Rfirst|@{selected|character_id};repeating_spell-2  --:spell2Loop|  --?"[*R:spellname]" -eq NoRepeatingAttributeLoaded|endSpell2  --+[*R:spellname]:|Spell Prepared: [*R:spellprepared] Spell School: [*R:spellschool] Spell Ritual Flag: [*R:spellritualflag] Spell Casting Time: [*R:spellcastingtime] Spell Range: [*R:spellrange] Spell Target: [*R:spelltarget] Spell Comp V: [*R:spellcomp_v] Spell Comp S: [*R:spellcomp_v] Spell Comp M: [*R:spellcomp_m] Spell Comp Materials: [*R:spellcomp_materials] Concentration Flag: [*R:spellconcentrationflag] Spell Duration: [*R:spellduration] Spell Output: [*R:spelloutput] Spell Attack: [*R:spellattack] Spell Damage: [*R:spelldamage] Spell Damage Type: [*R:spelldamagetype] Spell Damage2[*R:spelldamage2] Spell Damage2 Type: [*R:spelldamagetype2] Spell Healing: [*R:spellhealing] Spell Damage Mod: [*R:spelldmgmod] Spell Save: [*R:spellsave] Spell Save Success: [*R:spellsavesuccess] Spell Higher Level Die: [*R:spellhldie] Spell Higher Level Die Type: [*R:spellhldietype] Spell Higher Level Bonus: [*R:spellhlbonus] Description: [*R:spelldescription] Spell at the Highe Levels: [*R:spellathigherlevels] Prep Toggle: [*R:prep] Spell Name [*R:spellname] --Rnext|  -->spell2Loop|    --:endSpell2| --<| --:Spell3Section| --+[c] 3rd LEVEL SPELLS[/c]|  --Rfirst|@{selected|character_id};repeating_spell-3  --:spell3Loop|  --?"[*R:spellname]" -eq NoRepeatingAttributeLoaded|endSpell3  --+[*R:spellname]:|Spell Prepared: [*R:spellprepared] Spell School: [*R:spellschool] Spell Ritual Flag: [*R:spellritualflag] Spell Casting Time: [*R:spellcastingtime] Spell Range: [*R:spellrange] Spell Target: [*R:spelltarget] Spell Comp V: [*R:spellcomp_v] Spell Comp S: [*R:spellcomp_v] Spell Comp M: [*R:spellcomp_m] Spell Comp Materials: [*R:spellcomp_materials] Concentration Flag: [*R:spellconcentrationflag] Spell Duration: [*R:spellduration] Spell Output: [*R:spelloutput] Spell Attack: [*R:spellattack] Spell Damage: [*R:spelldamage] Spell Damage Type: [*R:spelldamagetype] Spell Damage2[*R:spelldamage2] Spell Damage2 Type: [*R:spelldamagetype2] Spell Healing: [*R:spellhealing] Spell Damage Mod: [*R:spelldmgmod] Spell Save: [*R:spellsave] Spell Save Success: [*R:spellsavesuccess] Spell Higher Level Die: [*R:spellhldie] Spell Higher Level Die Type: [*R:spellhldietype] Spell Higher Level Bonus: [*R:spellhlbonus] Description: [*R:spelldescription] Spell at the Highe Levels: [*R:spellathigherlevels] Prep Toggle: [*R:prep] Spell Name [*R:spellname] --Rnext|  -->spell3Loop|    --:endSpell3| --<| --:Spell4Section| --+[c]4th LEVEL SPELLS[/c]|  --Rfirst|@{selected|character_id};repeating_spell-4  --:spell4Loop|  --?"[*R:spellname]" -eq NoRepeatingAttributeLoaded|endSpell4  --+[*R:spellname]:|Spell Prepared: [*R:spellprepared] Spell School: [*R:spellschool] Spell Ritual Flag: [*R:spellritualflag] Spell Casting Time: [*R:spellcastingtime] Spell Range: [*R:spellrange] Spell Target: [*R:spelltarget] Spell Comp V: [*R:spellcomp_v] Spell Comp S: [*R:spellcomp_v] Spell Comp M: [*R:spellcomp_m] Spell Comp Materials: [*R:spellcomp_materials] Concentration Flag: [*R:spellconcentrationflag] Spell Duration: [*R:spellduration] Spell Output: [*R:spelloutput] Spell Attack: [*R:spellattack] Spell Damage: [*R:spelldamage] Spell Damage Type: [*R:spelldamagetype] Spell Damage2[*R:spelldamage2] Spell Damage2 Type: [*R:spelldamagetype2] Spell Healing: [*R:spellhealing] Spell Damage Mod: [*R:spelldmgmod] Spell Save: [*R:spellsave] Spell Save Success: [*R:spellsavesuccess] Spell Higher Level Die: [*R:spellhldie] Spell Higher Level Die Type: [*R:spellhldietype] Spell Higher Level Bonus: [*R:spellhlbonus] Description: [*R:spelldescription] Spell at the Highe Levels: [*R:spellathigherlevels] Prep Toggle: [*R:prep] Spell Name [*R:spellname] --Rnext|  -->spell4Loop|    --:endSpell4| --<| --:Spell5Section| --+[c]5th LEVEL SPELLS[/c]|  --Rfirst|@{selected|character_id};repeating_spell-5  --:spell5Loop|  --?"[*R:spellname]" -eq NoRepeatingAttributeLoaded|endSpell5  --+[*R:spellname]:|Spell Prepared: [*R:spellprepared] Spell School: [*R:spellschool] Spell Ritual Flag: [*R:spellritualflag] Spell Casting Time: [*R:spellcastingtime] Spell Range: [*R:spellrange] Spell Target: [*R:spelltarget] Spell Comp V: [*R:spellcomp_v] Spell Comp S: [*R:spellcomp_v] Spell Comp M: [*R:spellcomp_m] Spell Comp Materials: [*R:spellcomp_materials] Concentration Flag: [*R:spellconcentrationflag] Spell Duration: [*R:spellduration] Spell Output: [*R:spelloutput] Spell Attack: [*R:spellattack] Spell Damage: [*R:spelldamage] Spell Damage Type: [*R:spelldamagetype] Spell Damage2[*R:spelldamage2] Spell Damage2 Type: [*R:spelldamagetype2] Spell Healing: [*R:spellhealing] Spell Damage Mod: [*R:spelldmgmod] Spell Save: [*R:spellsave] Spell Save Success: [*R:spellsavesuccess] Spell Higher Level Die: [*R:spellhldie] Spell Higher Level Die Type: [*R:spellhldietype] Spell Higher Level Bonus: [*R:spellhlbonus] Description: [*R:spelldescription] Spell at the Highe Levels: [*R:spellathigherlevels] Prep Toggle: [*R:prep] Spell Name [*R:spellname] --Rnext|  -->spell5Loop|    --:endSpell5| --<| --:Spell6Section| --+[c]6th LEVEL SPELLS[/c]|  --Rfirst|@{selected|character_id};repeating_spell-6  --:spell6Loop|  --?"[*R:spellname]" -eq NoRepeatingAttributeLoaded|endSpell6  --+[*R:spellname]:|Spell Prepared: [*R:spellprepared] Spell School: [*R:spellschool] Spell Ritual Flag: [*R:spellritualflag] Spell Casting Time: [*R:spellcastingtime] Spell Range: [*R:spellrange] Spell Target: [*R:spelltarget] Spell Comp V: [*R:spellcomp_v] Spell Comp S: [*R:spellcomp_v] Spell Comp M: [*R:spellcomp_m] Spell Comp Materials: [*R:spellcomp_materials] Concentration Flag: [*R:spellconcentrationflag] Spell Duration: [*R:spellduration] Spell Output: [*R:spelloutput] Spell Attack: [*R:spellattack] Spell Damage: [*R:spelldamage] Spell Damage Type: [*R:spelldamagetype] Spell Damage2[*R:spelldamage2] Spell Damage2 Type: [*R:spelldamagetype2] Spell Healing: [*R:spellhealing] Spell Damage Mod: [*R:spelldmgmod] Spell Save: [*R:spellsave] Spell Save Success: [*R:spellsavesuccess] Spell Higher Level Die: [*R:spellhldie] Spell Higher Level Die Type: [*R:spellhldietype] Spell Higher Level Bonus: [*R:spellhlbonus] Description: [*R:spelldescription] Spell at the Highe Levels: [*R:spellathigherlevels] Prep Toggle: [*R:prep] Spell Name [*R:spellname] --Rnext|  -->spell6Loop|    --:endSpell6| --<| --:Spell7Section| --+[c]7th LEVEL SPELLS[/c]|  --Rfirst|@{selected|character_id};repeating_spell-7  --:spell7Loop|  --?"[*R:spellname]" -eq NoRepeatingAttributeLoaded|endSpell7  --+[*R:spellname]:|Spell Prepared: [*R:spellprepared] Spell School: [*R:spellschool] Spell Ritual Flag: [*R:spellritualflag] Spell Casting Time: [*R:spellcastingtime] Spell Range: [*R:spellrange] Spell Target: [*R:spelltarget] Spell Comp V: [*R:spellcomp_v] Spell Comp S: [*R:spellcomp_v] Spell Comp M: [*R:spellcomp_m] Spell Comp Materials: [*R:spellcomp_materials] Concentration Flag: [*R:spellconcentrationflag] Spell Duration: [*R:spellduration] Spell Output: [*R:spelloutput] Spell Attack: [*R:spellattack] Spell Damage: [*R:spelldamage] Spell Damage Type: [*R:spelldamagetype] Spell Damage2[*R:spelldamage2] Spell Damage2 Type: [*R:spelldamagetype2] Spell Healing: [*R:spellhealing] Spell Damage Mod: [*R:spelldmgmod] Spell Save: [*R:spellsave] Spell Save Success: [*R:spellsavesuccess] Spell Higher Level Die: [*R:spellhldie] Spell Higher Level Die Type: [*R:spellhldietype] Spell Higher Level Bonus: [*R:spellhlbonus] Description: [*R:spelldescription] Spell at the Highe Levels: [*R:spellathigherlevels] Prep Toggle: [*R:prep] Spell Name [*R:spellname] --Rnext|  -->spell7Loop|    --:endSpell7| --<| --:Spell8Section| --+[c]8th LEVEL SPELLS[/c]|  --Rfirst|@{selected|character_id};repeating_spell-8  --:spell8Loop|  --?"[*R:spellname]" -eq NoRepeatingAttributeLoaded|endSpell8  --+[*R:spellname]:|Spell Prepared: [*R:spellprepared] Spell School: [*R:spellschool] Spell Ritual Flag: [*R:spellritualflag] Spell Casting Time: [*R:spellcastingtime] Spell Range: [*R:spellrange] Spell Target: [*R:spelltarget] Spell Comp V: [*R:spellcomp_v] Spell Comp S: [*R:spellcomp_v] Spell Comp M: [*R:spellcomp_m] Spell Comp Materials: [*R:spellcomp_materials] Concentration Flag: [*R:spellconcentrationflag] Spell Duration: [*R:spellduration] Spell Output: [*R:spelloutput] Spell Attack: [*R:spellattack] Spell Damage: [*R:spelldamage] Spell Damage Type: [*R:spelldamagetype] Spell Damage2[*R:spelldamage2] Spell Damage2 Type: [*R:spelldamagetype2] Spell Healing: [*R:spellhealing] Spell Damage Mod: [*R:spelldmgmod] Spell Save: [*R:spellsave] Spell Save Success: [*R:spellsavesuccess] Spell Higher Level Die: [*R:spellhldie] Spell Higher Level Die Type: [*R:spellhldietype] Spell Higher Level Bonus: [*R:spellhlbonus] Description: [*R:spelldescription] Spell at the Highe Levels: [*R:spellathigherlevels] Prep Toggle: [*R:prep] Spell Name [*R:spellname] --Rnext|  -->spell8Loop|    --:endSpell8| --<| --:Spell9Section| --+[c]9th LEVEL SPELLS[/c]|  --Rfirst|@{selected|character_id};repeating_spell-9  --:spell9Loop|  --?"[*R:spellname]" -eq NoRepeatingAttributeLoaded|endSpell9  --+[*R:spellname]:|Spell Prepared: [*R:spellprepared] Spell School: [*R:spellschool] Spell Ritual Flag: [*R:spellritualflag] Spell Casting Time: [*R:spellcastingtime] Spell Range: [*R:spellrange] Spell Target: [*R:spelltarget] Spell Comp V: [*R:spellcomp_v] Spell Comp S: [*R:spellcomp_v] Spell Comp M: [*R:spellcomp_m] Spell Comp Materials: [*R:spellcomp_materials] Concentration Flag: [*R:spellconcentrationflag] Spell Duration: [*R:spellduration] Spell Output: [*R:spelloutput] Spell Attack: [*R:spellattack] Spell Damage: [*R:spelldamage] Spell Damage Type: [*R:spelldamagetype] Spell Damage2[*R:spelldamage2] Spell Damage2 Type: [*R:spelldamagetype2] Spell Healing: [*R:spellhealing] Spell Damage Mod: [*R:spelldmgmod] Spell Save: [*R:spellsave] Spell Save Success: [*R:spellsavesuccess] Spell Higher Level Die: [*R:spellhldie] Spell Higher Level Die Type: [*R:spellhldietype] Spell Higher Level Bonus: [*R:spellhlbonus] Description: [*R:spelldescription] Spell at the Highe Levels: [*R:spellathigherlevels] Prep Toggle: [*R:prep] Spell Name [*R:spellname] --Rnext|  -->spell9Loop|    --:endSpell9| --<| --:inventorySection| --+[c]INVENTORY[/c]| --+Coins:| CP:[*S:cp] SP:[*S:sp] EP:[*S:ep] GP:[*S:gp] PP:[*S:pp]  --Rfirst|@{selected|character_id};repeating_inventory  --:inventoryLoop|  --?"[*R:itemname]" -eq NoRepeatingAttributeLoaded|endinventory  --+[*R:itemcount] [*R:itemname]:| Weight: [*R:itemweight] Equipped: [*R:equipped] Used As Resource: [*R:useasresource] Has Attack: [*R:hasattack] Properties: [*R:itemproperties] Modifiers: [*R:itemmodifiers] Content: [*R:itemcontent]  --Rnext|  -->inventoryLoop|    --:endinventory| --<| --:proficienciesSection| --+[c]PROFICIENCIES[/c]|  --Rfirst|@{selected|character_id};repeating_proficiencies  --:proficienciesLoop|  --?"[*R:name]" -eq NoRepeatingAttributeLoaded|endproficiencies  --+[*R:name]:| Proficiency Type: [*R:prof_type]  --Rnext|  -->proficienciesLoop|    --:endproficiencies| --<| --:toolsSection| --+[c]TOOLS[/c]|  --Rfirst|@{selected|character_id};repeating_tool  --:toolLoop|  --?"[*R:toolname]" -eq NoRepeatingAttributeLoaded|endtool  --+[*R:toolname]:| Tool Bonus Base: [*R:toolbonus_base] Tool Attribute Base: [*R:toolattr_base] Options Flag: [*R:options-flag] Tool Attribute: [*R:toolattr] --Rdump|  --Rnext|  -->toolLoop|    --:endtool| --<| --X| }}
1622242905

Edited 1622243186
Kurt J.
Pro
API Scripter
Michael C. said: @Kurt - thank you!  I looked back at the wiki and saw why I didn't understand - I didn't get the three parameter requirement. So, all --i commands need two parameters other than designating target or query type and they can be the same variable name.  Got it!  Oh...just curious - but why do you have an empty comment line in the subroutine? @tim - that is a very big help and I am grateful for the time and effort you put into the explanation!  I will read through it several more times but I think I get the gist now of the "whys" and "wherefores".  I see why the --i command is necessary (pretty sharp, Kurt!) and why it now needs both variablename and target identifier.   Suggestion:  I don't know if there is one and I just missed it but your explanation would be really useful in a "Beginners Guide to Macro Writing" wiki!  If there isn't such a thing, I would think it would be massive to have one. @Michael - for very, very technical reasons... those being I was probably going to put a comment there and then my mind went blank :) lol I'm getting old...
1622243146
Kurt J.
Pro
API Scripter
Andy said: Also, are there any hooks into pushing data like images or just text into the 5e by roll20 BIO page? I have access to everything but that. lol. Some of you might find this interesting. This code is for the 5E by Roll20 NPC sheet that has all the hooks for the sheet. Select a token and find out its data, the names of the fields, etc. Below, is also the version for the PCs. It's raw data and not pretty, but it's all there. :) Do what you will with it. There are a couple of fields (bio, notes, gmnotes) that are not directly retrievable by the API. That isn't precisely true - the API can get them, but not inline with other code. They rely on a callback, so even though you can "ask" for them with ScriptCards notation (like [*S:bio]) they will come back as blank because by the time the callback returns a value your script has already finished processing.
1622243376
Kurt J.
Pro
API Scripter
Andy said: Is it possible to create a 2D Array in scriptcards? Something to the equivalent of... array = [ [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0]             ]; I tried some experiments using stingify and array;define;arrayname;[&arrayname0];[&arrayname1];[&arrayname2];[&arrayname3];[&arrayname4];[&arrayname5];[&arrayname6];[&arrayname7];[&arrayname8];[&arrayname9] or creating a for loop to add the arrays into another array, but I was unable to crack it. Is it possible to nest arrays at all or am I just missing something that's in front of my face? As always, thank you Kurt for creating this. It has changed my attitude toward playing games on roll20 in a very positive way. Currently there isn't a way to do this. I have some ideas, but nothing solid to implement yet. I'd like to add the ability to directly reference array members in the same way you can reference rollVariables and stringVariables. That would allow at least a workaround that would behave like 2D arrays.
1622249515
timmaugh
Pro
API Scripter
Brien V. said: I have more questions. I'm trying to set a variable based on how well something succeeds over the DC of a roll.  I'm trying to avoid a long list of conditionals, thought I don't know if that is possible.  Basically there's an additional success for every 5 points above the DC, which I want to be able to display in one of the subtitles. Thoughts? I'm not sure how ScriptCards handles the in-house parsing of inline rolls, but if you're open to a meta-script solution, I think I can suggest one. Can you post the base roll you want to augment with the extra successes?
Kurt J. said: Andy said: Also, are there any hooks into pushing data like images or just text into the 5e by roll20 BIO page? I have access to everything but that. lol. Some of you might find this interesting. This code is for the 5E by Roll20 NPC sheet that has all the hooks for the sheet. Select a token and find out its data, the names of the fields, etc. Below, is also the version for the PCs. It's raw data and not pretty, but it's all there. :) Do what you will with it. There are a couple of fields (bio, notes, gmnotes) that are not directly retrievable by the API. That isn't precisely true - the API can get them, but not inline with other code. They rely on a callback, so even though you can "ask" for them with ScriptCards notation (like [*S:bio]) they will come back as blank because by the time the callback returns a value your script has already finished processing. Kurt, thanks for the quick response. I get it. No problem. It's easy enough to provide the same info on handouts or put the data on my mule character; a great suggestion for managing macro calls I learned on this forum. Thanks everybody!!
1622251203

Edited 1622251942
Kurt J. said: Andy said: Is it possible to create a 2D Array in scriptcards? Something to the equivalent of... array = [ [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0] [0,0,0,0,0,0,0,0,0,0]             ]; I tried some experiments using stingify and array;define;arrayname;[&arrayname0];[&arrayname1];[&arrayname2];[&arrayname3];[&arrayname4];[&arrayname5];[&arrayname6];[&arrayname7];[&arrayname8];[&arrayname9] or creating a for loop to add the arrays into another array, but I was unable to crack it. Is it possible to nest arrays at all or am I just missing something that's in front of my face? As always, thank you Kurt for creating this. It has changed my attitude toward playing games on roll20 in a very positive way. Currently there isn't a way to do this. I have some ideas, but nothing solid to implement yet. I'd like to add the ability to directly reference array members in the same way you can reference rollVariables and stringVariables. That would allow at least a workaround that would behave like 2D arrays. The pontential for this using ScriptCards is huge. The abstract layers you could create for the map alone makes this tool practically essential. IMO. :) TrapArray =[ [0,0,0,0] [0,0,0,0] [0,0,1,0] [0,0,0,0] ] trap = 1 get the coords of a token, if it matches coordinate (2,2) BOOM! That sort of thing. Could be used to trigger any sort of event you could think of...secret doors, atmospheric sounds, initiative rolls, animations, etc. You could even use it to procedurally generate maps if you set the graphics up for it. in the grid size you use 70px X 70px per graph TerrainArray= [ [0,1,0,2,0] [0,0,0,1,0] [0,1,0,0,0] [0,1,0,2,0] [0,1,0,0,0] [0,1,0,0,3] ] grass = 0 tree = 1 bush = 2 water = 3 the implementations are almost endless really... You could switch tokens on or off on the map layer to show distances, movement possibilities, calculate who gets damaged, adjacency for attacks of opportunities, and so on... It doesn't have to be visually pleasing to code. It just needs to be able to nest the arrays and then read from the coordinate points(x,y) Whatever is in the array[array[]] will index will be what is at the coordinate on the map. It could be used to determine difficult terrain. DifficultTerrainArray = [ [4,4,4,4,4] [3,3,3,3,4] [2,2,2,3,4] [1,1,2,3,4] [0,1,2,3,4] ] This would show a steep incline going from southwest to northeast. It could be mud that gets thicker or whatever you wanted. Is there a way to acheive this? BTW- great use of the Bresenham's line algorithm in the lightning bolt example. I'm using it to gauge PC pathing when they move over grid squares to trigger events like traps and such. Keep the awesome examples coming! Nice job, Kurt!
1622254305

Edited 1622254335
Do we know if storing common functions in a library (handout) has any impact on speed?  I've gotten so many utility functions built, I often just copy them into my next script as needed, but at some point it would make sense to just store all my common routines in a library handout.  My concern is the extra time it would take to load the handout when the script executes.  Also, if the library becomes very large, like say 5,000 lines, does that bog down the parser/interpreter and make even simple macros slow?
@Kurt - funny, the older I get the more "very, very technical reasons" I come up with.  LOL
timmaugh said: Brien V. said: I have more questions. I'm trying to set a variable based on how well something succeeds over the DC of a roll.  I'm trying to avoid a long list of conditionals, thought I don't know if that is possible.  Basically there's an additional success for every 5 points above the DC, which I want to be able to display in one of the subtitles. Thoughts? I'm not sure how ScriptCards handles the in-house parsing of inline rolls, but if you're open to a meta-script solution, I think I can suggest one. Can you post the base roll you want to augment with the extra successes? Here's what I have.  Basically, succeeding by 5 or less over the DC is a success.  Every additional 5 over is an addition degree of success.  Same with the reverse.  Ever 5 under the DC is a degree of failure. --=D1|[$DC] --=D2|[$DC] + 5 --=D3|[$DC] + 10 --=D4|[$DC] + 15 --=DN1|[$DC] - 5 --=DN2|[$DC] - 10 --=DN3|[$DC] - 15 --=DN4|[$DC] - 20
1622292561
Kurt J.
Pro
API Scripter
Brien V. said: timmaugh said: Brien V. said: I have more questions. I'm trying to set a variable based on how well something succeeds over the DC of a roll.  I'm trying to avoid a long list of conditionals, thought I don't know if that is possible.  Basically there's an additional success for every 5 points above the DC, which I want to be able to display in one of the subtitles. Thoughts? I'm not sure how ScriptCards handles the in-house parsing of inline rolls, but if you're open to a meta-script solution, I think I can suggest one. Can you post the base roll you want to augment with the extra successes? Here's what I have.  Basically, succeeding by 5 or less over the DC is a success.  Every additional 5 over is an addition degree of success.  Same with the reverse.  Ever 5 under the DC is a degree of failure. --=D1|[$DC] --=D2|[$DC] + 5 --=D3|[$DC] + 10 --=D4|[$DC] + 15 --=DN1|[$DC] - 5 --=DN2|[$DC] - 10 --=DN3|[$DC] - 15 --=DN4|[$DC] - 20 You can do this purely mathematically using the integer division symbol: !script {{ --=DC|10 --=Extras|0 --=Roll|1d20+8 --?[$Roll] -gt [$DC]|[ --=Extras|[$Roll] - [$DC] \ 5 --]| --+|Roll:[$Roll] DC:[$DC] Extras:[$Extras] }} Given a Roll and DC, Extras will contain the number of extra successes.
1622292755
Kurt J.
Pro
API Scripter
Will M. said: Do we know if storing common functions in a library (handout) has any impact on speed?  I've gotten so many utility functions built, I often just copy them into my next script as needed, but at some point it would make sense to just store all my common routines in a library handout.  My concern is the extra time it would take to load the handout when the script executes.  Also, if the library becomes very large, like say 5,000 lines, does that bog down the parser/interpreter and make even simple macros slow? When a script is executed, the contents of any included libraries are added to the end of the script's code. The next step is running through the script to look for labels (--:) and caching their locations. The same pre-parse loop looks for data (--d!) statements and caches those. Other than that (should shouldn't be noticeable unless a library gets truly enormous, there isn't any other impact on performance, as from that point onward only lines that are going to be executed are processed.
Kurt J. said: You can do this purely mathematically using the integer division symbol: !script {{ --=DC|10 --=Extras|0 --=Roll|1d20+8 --?[$Roll] -gt [$DC]|[ --=Extras|[$Roll] - [$DC] \ 5 --]| --+|Roll:[$Roll] DC:[$DC] Extras:[$Extras] }} Given a Roll and DC, Extras will contain the number of extra successes. I'm an idiot.  I was trying to build a loop and everything and it is that simple.   When I run your code, I get an even number regardless.  When I modify it to fit my card I get this: Here's the code I am using: !scriptcards {{ --#title|Acrobatics --#leftsub|Trained --#rightsub|Agility --#sourceToken|@selected|token_id} --=SkillAbility|@{selected|agility} + @{selected|agility-misc} --=SkillRanks|@{selected|acrobatics-ranks} + @{selected|acrobatics-other} --=Mod|?{Modifier?|None,0|Minor Bonus,2|Major Bonus,5|Minor Penalty,-2|Major Penalty,-5} --=DC|?{DC:|} --+DC:|[$DC] --=SkillMod|[$SkillAbility] + [$SkillRanks] --=SkillRoll|1d20 + [$SkillRanks] [Skill] + [$SkillAbility] [Ability] + [$Mod] [Circ. Mod] --+Skill Roll:|[$SkillRoll] --?[$SkillRoll] -ge [$DC]|Success --+Failed:|@{selected|character_name} rolled a [$SkillRoll] on their Acrobatics roll. --X| --:Success| --=DC|10 --=Degree|0 --?[$SkillRoll] -ge [$DC]|[ --=Degree|[$Roll] - [$DC] \ 5 --]| --+Success:|@{selected|character_name} rolled a [$SkillRoll], succeeding by [$Degree] degree on their Acrobatics roll. --X| }} Messy as hell but I've never claimed to be good at this.
1622297613
Kurt J.
Pro
API Scripter
Brien V. said: Kurt J. said: You can do this purely mathematically using the integer division symbol: !script {{ --=DC|10 --=Extras|0 --=Roll|1d20+8 --?[$Roll] -gt [$DC]|[ --=Extras|[$Roll] - [$DC] \ 5 --]| --+|Roll:[$Roll] DC:[$DC] Extras:[$Extras] }} Given a Roll and DC, Extras will contain the number of extra successes. I'm an idiot.  I was trying to build a loop and everything and it is that simple.   When I run your code, I get an even number regardless.  When I modify it to fit my card I get this: Here's the code I am using: !scriptcards {{ --#title|Acrobatics --#leftsub|Trained --#rightsub|Agility --#sourceToken|@selected|token_id} --=SkillAbility|@{selected|agility} + @{selected|agility-misc} --=SkillRanks|@{selected|acrobatics-ranks} + @{selected|acrobatics-other} --=Mod|?{Modifier?|None,0|Minor Bonus,2|Major Bonus,5|Minor Penalty,-2|Major Penalty,-5} --=DC|?{DC:|} --+DC:|[$DC] --=SkillMod|[$SkillAbility] + [$SkillRanks] --=SkillRoll|1d20 + [$SkillRanks] [Skill] + [$SkillAbility] [Ability] + [$Mod] [Circ. Mod] --+Skill Roll:|[$SkillRoll] --?[$SkillRoll] -ge [$DC]|Success --+Failed:|@{selected|character_name} rolled a [$SkillRoll] on their Acrobatics roll. --X| --:Success| --=DC|10 --=Degree|0 --?[$SkillRoll] -ge [$DC]|[ --=Degree|[$Roll] - [$DC] \ 5 --]| --+Success:|@{selected|character_name} rolled a [$SkillRoll], succeeding by [$Degree] degree on their Acrobatics roll. --X| }} Messy as hell but I've never claimed to be good at this. You need to change $Roll in the line that sets Degree to $SkillRoll, since that is the name of your roll variable.
::sigh:: one more issue with the mass healing word script. Sorry.  I cannot seem to get the token id to pass to the alterbars or token-mod subroutine.  Here is a shortened version of what I am doing modified to not take up a huge part of the forum: !script {{  --:BuildAndAskTargets|    --&TargetString|    --=targetCount|1    --:TargetLoop|      --&TargetString|+t;target[$targetCount.Total];target[$targetCount.Total]      --=targetCount|[$targetCount.Total] + 1      --?[$targetCount.Total] -le 6|>AddSeparator    --?[$targetCount.Total] -le 6|TargetLoop    --iPlease click the button below to select characters to heal. The same target can be selected multiple times;Select 6 Targets|[&TargetString]   --:Healing|   --=Count|1   --=HPRecovered|20   --:HealLoop|     --&ThisTarget|[&target[$Count]]       --@ApplyHealingAlterbars|[&ThisTarget];1;+[$HPRecovered.Total]     --=Count|[$Count] + 1     --?[$Count] -le 6|HealLoop   --X|   --:AddSeparator|     --&TargetString|+||   --<|   --:ApplyHealingAlterbars|   --@alter|_target|[%1%] _bar|[%2%] _amount|[%3%]   --<| }} [I have also used the token-mod alternative with the same result.]  With Kurt's fix, the --i subroutine works correctly but [&ThisTarget], or [*[&ThisTarget]:character_id] for token-mod, passes a null string to ApplyHealingAlterbars.  (Debug shows no errors, just a null string so please tell me it's not another syntax screw-up on my part.)  :-(
1622303568

Edited 1622307635
Any of you coders able to find out the flag setting for global attack mod I found save  repeating_savemod_$0_global_save_active_flag and damage  repeating_damagemod_$0_global_damage_active_flag with 0 turning of the flag and 1 turning it on.  After many hrs of digging in the html code ( because I know nothing about HTML ) I found it !setattr --name @{selected|character_name} --repeating_tohitmod_$0_global_attack_active_flag|1. 
1622303789
David M.
Pro
API Scripter
@Michael, I haven't tried running your code, but this line in your HealLoop seems pretty sus: --@ApplyHealingAlterbars|[&ThisTarget];1;+[$HPRecovered.Total] Assuming you meant to use " -->ApplyHealingAlterbars " to call the subprocedure?
1622307907
Kurt J.
Pro
API Scripter
I posted this over on my Patreon, but I wanted to post it here as well so everyone is aware (My current codebase is broken right now while I make these changes): What's Coming Next for ScriptCards I wanted to lay out some information on what I'm currently working on for ScriptCard, as it will probably take me some time to get it working right so it may be a couple of weeks before the next major release. Right now, the variable/attribute substitution code is... lets just say sub-optimal. There are several problems with it, not the least of which is that it is difficult to know what order operations will take when replacing variables. I'm begun consolidating and rewriting all of this code, including: Roll Variable Substitution ([$...]) String Variable Substitution ([&...]) Token/Character Attribute Substitution ([*S:], [*T:], and [*-:] Repeating Attribute Substitution ([*R:] and [*R>]) Gosub Parameter Substitution ([%...%]) Array Variable Substitution ( NEW! [#Array(index)]) This rewrite will accomplish a few things: It will clean up the mess of javascript functions that handle this right now. They are all individual functions that duplicate much of the same code. It will improve efficiency. Not sure what I was thinking when I wrote the roll and string variable functions. They work, but they could be optimized to run in a fraction of the time they currently take. It will make implementing any future substitution syntax easier. It will provide a definitive way to know what order substitutions will happen in. The innermost substitution in a group of brackets will happen first, and the code will work its way outward from there.
Kurt J. said: You need to change $Roll in the line that sets Degree to $SkillRoll, since that is the name of your roll variable. Well duh.  I need to work on my attention to detail. 
1622317997
timmaugh
Pro
API Scripter
Craven said: Anyone have a macro that uses the Global Damage mod and the 5E tools Library.  You could try using XRay to walk the character sheet... It's part of the InsertArg script. It should show you all of the standard attributes, repeating attributes, and abilities, with 2 caveats... 1) It doesn't yet account for corrupted"ghost" attributes, so you'll see the same attribute listed a couple of times ( I have a fix, I just haven't applied it yet). And 2) it doesn't show auto-calc fields. Those are essentially "virtual" fields. But otherwise, if it's there, x-ray will find it.
@David - That was certainly a mistype - thanks for catching it - but, sadly (though to some extent thankfully), not the problem. This is the actual macro: !scriptcards {{&nbsp; &nbsp; --#title|Mass Healing Word &nbsp; --#sourceToken|@{selected|token_id} &nbsp; --#emoteText|[*S:character_name] Casts Mass Healing Word&nbsp; &nbsp; --#titleCardBackground|#440000 &nbsp; --#titleCardFont|#7fff00 &nbsp; --#leftsub|3rd Level : Evocation &nbsp; --#rightsub|Bonus Action : 60' : V&nbsp; &nbsp; --#evenRowBackground|#00ffff &nbsp; --#evenRowFontColor|#000000 &nbsp; --#oddRowBackground|#006400&nbsp;&nbsp; &nbsp; --#oddRowFontColor|#ffff00 &nbsp; --#debug|1 &nbsp; --&gt;GetAndCheckSlotInformation| &nbsp; --&gt;AbilityAssign|[*S:spellcasting_ability] &nbsp; --:HPCalc| Calculate 1d4 + spellcasting ability modifier +1d4/level over 3rd &nbsp; &nbsp; --=HPCalc|[$SlotLevel] - 2 &nbsp; &nbsp; --=HPRecovered|[$HPCalc]d4 + [%1%] &nbsp; --=Count|1 &nbsp; --&gt;BuildAndAskTargets| &nbsp; --:HealLoop| &nbsp; &nbsp; --&amp;ThisTarget|[&amp;target[$Count]] &nbsp; &nbsp; --+|[*[&amp;ThisTarget]:character_name] Is Healed for [$HPRecovered.Total] Points! &nbsp; &nbsp; --&gt;ApplyHealingTokenmod|[*[&amp;ThisTarget]:character_id];1;+[$HPRecovered] &nbsp; &nbsp; --/ApplyHealingAlterbars|[&amp;ThisTarget];1;+[$HPRecovered] &nbsp; &nbsp; --=Count|[$Count] + 1 &nbsp; &nbsp; --?[$Count] -le 6|HealLoop &nbsp; --X| --:PROCEDURES| &nbsp; --:GetAndCheckSlotInformation| &nbsp; &nbsp; --=SlotLevel|?{Spell Slot Level Used?|3|4|5|6|7|8|9} &nbsp; &nbsp; --=SlotsTotal|[*S:lvl[$SlotLevel]_slots_total] &nbsp; &nbsp; --=SlotsExpended|[*S:lvl[$SlotLevel]_slots_expended] &nbsp; &nbsp; --?[$SlotsExpended.Total] -ge [$SlotsTotal.Total]|NoSlotsLeft &nbsp; --:DeductSpellSlot| &nbsp; &nbsp; --=SlotsExpended|[$SlotsExpended] + 1 &nbsp; &nbsp; --@setattr|_charid [*S:character_id] _lvl[$SlotLevel]_slots_expended|[$SlotsExpended] _silent &nbsp; &nbsp; --=SlotsRemaining|[$SlotsTotal] - [$SlotsExpended] &nbsp; &nbsp; --+|[*S:character_name] has [$SlotsRemaining] Level [$SlotLevel] Slots Left&nbsp; &nbsp; --&lt;| &nbsp; --:NoSlotsLeft| &nbsp; &nbsp; --+|[b][*S:character_name] has no level [$SlotLevel.Total] spell slots available.[/b] &nbsp; --X|NoSlotsLeftStop &nbsp; --:AbilityAssign| &nbsp; &nbsp; --&amp;Attribute|[%1%] &nbsp; &nbsp; --?[&amp;Attribute] -inc "strength"|&gt;Strength &nbsp; &nbsp; --?[&amp;Attribute] -inc "dexterity"|&gt;Dexterity &nbsp; &nbsp; --?[&amp;Attribute] -inc "intelligence"|&gt;Intelligence &nbsp; &nbsp; --?[&amp;Attribute] -inc "wisdom"|&gt;Wisdom &nbsp; &nbsp; --?[&amp;Attribute] -inc "charisma"|&gt;Charisma &nbsp; --X| &nbsp; --:Strength| &nbsp; &nbsp; --=Mod|@{selected|strength_mod} &nbsp; --&gt;HPCalc|[$Mod] &nbsp; --:Dexterity| &nbsp; &nbsp; --=Mod|@{selected|dexterity_mod} &nbsp;--&gt;HPCalc|[$Mod] &nbsp; --:Intelligence| &nbsp; &nbsp; --=Mod|@{selected|intelligence_mod} &nbsp; --&gt;HPCalc|[$Mod] &nbsp; --:Wisdom| &nbsp; &nbsp; --=Mod|@{selected|wisdom_mod} &nbsp;--&gt;HPCalc|[$Mod] &nbsp; --:Charisma| &nbsp; &nbsp; --=Mod|@{selected|charisma_mod} &nbsp;--&gt;HPCalc|[$Mod] &nbsp;--:BuildAndAskTargets| &nbsp; &nbsp;--&amp;TargetString| &nbsp; &nbsp;--=targetCount|1 &nbsp; &nbsp;--:TargetLoop| &nbsp; &nbsp; &nbsp;--&amp;TargetString|+t;target[$targetCount.Total];target[$targetCount.Total] &nbsp; &nbsp; &nbsp;--=targetCount|[$targetCount.Total] + 1 &nbsp; &nbsp; &nbsp;--?[$targetCount.Total] -le 6|&gt;AddSeparator &nbsp; &nbsp;--?[$targetCount.Total] -le 6|TargetLoop &nbsp; &nbsp;--iPlease click the button below to select characters to heal. The same target can be selected multiple times;Select 6 Targets|[&amp;TargetString] &nbsp; --&lt;| &nbsp; --:AddSeparator| &nbsp; &nbsp; --&amp;TargetString|+|| &nbsp; --&lt;| &nbsp; --:ApplyHealingTokenmod|Parameters are tokenid;bar#;amount &nbsp; &nbsp; --@token-mod|_ignore-selected _ids [%1%] _set bar[%2%]_value|[%3%] &nbsp; --&lt;| &nbsp; --:ApplyHealingAlterbars|Parameters are tokenid;bar#;amount &nbsp; --@alter|_target|[%1%] _bar|[%2%] _amount|[%3%] &nbsp; --&lt;| }} Debug:&nbsp;"Line Counter: 27, Tag:X, Content:" My output using alterbars (repeated 6 times):&nbsp; (From ERROR): &nbsp;Not a valid target id. My output using token-mod looks like this: Johnny Casts Mass Healing Word &nbsp; Mass Healing Word 3rd Level : Evocation ♦ Bonus Action : 60' : V Johnny has&nbsp;<span class="userscript-showtip userscript-tipsy" original-title="Roll: 3 - 2 Result: 3 - 2 " style="box-sizing: content-box; min-width: 1.75em; font-family: undefined; text-align: center; display: inline-block; font-weight: bold; height: 1em; margin-top: -1px; margin-bottom: 1px; padding: 0px 2px; border: 1px solid rgb(135, 133, 10); border-radius: 3px; background-color: rgb(255, 254, 162); color: rgb(0, 0, 0);">1 &nbsp;Level&nbsp;<span class="userscript-showtip userscript-tipsy" title="Roll: 3 Result: 3 " style="box-sizing: content-box; min-width: 1.75em; font-family: undefined; text-align: center; display: inline-block; font-weight: bold; height: 1em; margin-top: -1px; margin-bottom: 1px; padding: 0px 2px; border: 1px solid rgb(135, 133, 10); border-radius: 3px; background-color: rgb(255, 254, 162); color: rgb(0, 0, 0);">3 &nbsp;Slots Left [ :character_name] Is Healed for 7 Points! [:character_name] Is Healed for 7 Points! [ :character_name] Is Healed for 7 Points! [:character_name] Is Healed for 7 Points! [ :character_name] Is Healed for 7 Points! [:character_name] Is Healed for 7 Points!
1622372898
Kurt J.
Pro
API Scripter
Michael - My guess is that this isn't your code that is the problem but the order of variable substitution that is causing the issue. This is what I'm working on addressing in 1.3.0. This line: --&amp;ThisTarget|[&amp;target[$Count]] Is likely where things are going wrong, as I believe the way the code currently works, string variables are substituted before roll variables, so it tries to find a string variable named "target[$Count]". Since that doesn't exist, it replaces it with nothing. The reason it works in the Magic Missile script is that there, the code is&nbsp; --&amp;ThisTarget|[&amp;target[%1%]] , and gosub parameters are replaced before strings. The easiest way around this until I get 1.3.0 working would be to create a subroutine to assign ThisTarget: --:AssignTarget| --&amp;ThisTarget|[&amp;target[%1%]] --&lt;| and then just call in in place of your original line: --&gt;AssignTarget|[$Count] This is exactly the reason I'm rewriting the substitution code to work from the innermost brackets outward and not based on variable type. Logically, what you have makes sense :)
1622383254

Edited 1622383300
Appears the string replace function (--~Ret|string;replace) replaces only the first item it finds.&nbsp; Is there an option or function to replace all instances of searchstring? For example, I may want to remove all spaces.&nbsp;&nbsp; BTW, loving the latest version.&nbsp; Am beginning to utilize the For loop and have incorporated the new distance functions.&nbsp;&nbsp;
1622383801
Kurt J.
Pro
API Scripter
Will M. said: Appears the string replace function (--~Ret|string;replace) replaces only the first item it finds.&nbsp; Is there an option or function to replace all instances of searchstring? For example, I may want to remove all spaces.&nbsp;&nbsp; BTW, loving the latest version.&nbsp; Am beginning to utilize the For loop and have incorporated the new distance functions.&nbsp;&nbsp; the most recent update added "replaceall" as a string function. Same parameters as replace, but replaces all occurrances.
Kurt J. said: Will M. said: Appears the string replace function (--~Ret|string;replace) replaces only the first item it finds.&nbsp; Is there an option or function to replace all instances of searchstring? For example, I may want to remove all spaces.&nbsp;&nbsp; BTW, loving the latest version.&nbsp; Am beginning to utilize the For loop and have incorporated the new distance functions.&nbsp;&nbsp; the most recent update added "replaceall" as a string function. Same parameters as replace, but replaces all occurrances. You seem to be one step ahead a lot of the time.&nbsp; I'm trying to parse the Turnorder JSON string found in the Campaign Object and all the special characters were giving me fits trying to get it into an array.&nbsp; Now I can clean up the string, and then use the array;fromstring function.&nbsp;&nbsp; Thanks
1622384480

Edited 1622385053
@Kurt - lol&nbsp; - oh, thank goodness, for once it isn't a silly syntax error on my part.&nbsp; Aha!&nbsp; I was thinking that maybe it was due to the fact that I wasn't passing it as a parameter as that was the only difference in copying over your macro to mine but it just didn't make programming sense to me.&nbsp; That's a good workaround and thanks. Edit: the workaround worked so you are definitely on top of the problem.&nbsp;&nbsp;
@ Kurt J Hey can you tell me how the +++5E tools+++ work? Little confused.&nbsp; I am trying to use the&nbsp; Lib5E_Active_Global_Attack_Modifiers. I read the wiki and it return whatever is set the example was Bless and Being Cool. How do I get that info from the source and how do I use the variables?&nbsp;&nbsp;Does it wrok the same for the&nbsp; Lib5E_Active_Save_Modifiers? If you have the time thanks in advance.&nbsp;
1622463394
Kurt J.
Pro
API Scripter
Craven said: @ Kurt J Hey can you tell me how the +++5E tools+++ work? Little confused.&nbsp; I am trying to use the&nbsp; Lib5E_Active_Global_Attack_Modifiers. I read the wiki and it return whatever is set the example was Bless and Being Cool. How do I get that info from the source and how do I use the variables?&nbsp;&nbsp;Does it wrok the same for the&nbsp; Lib5E_Active_Save_Modifiers? If you have the time thanks in advance.&nbsp; The way it is supposed to work is that you pass it a character and it sets a string variable that you can then use as part of a roll. If there are not global modifiers, the string will be empty, otherwise it will contain something like "+1d4 [BLESS]" that would get added to whatever you rolled. I'll have to go back and look at it, because we never used global modifiers in our games... we just did it manually :)
1622505465

Edited 1622505569
I am baffled&nbsp; &nbsp;I've been trying to make for loops wok but&nbsp; they always fail in precisely&nbsp; the same way&nbsp; This is the super basic script I copied from the examples higher up&nbsp; !script {{ &nbsp; --%LoopCounter|1;10;1 &nbsp; &nbsp; --=Roll|1d20 &nbsp; &nbsp; --+Loop|Counter is [&amp;LoopCounter], roll was [$Roll] &nbsp; --%| }} And this is the output: It clearly makes the d20 roll but never loops. All the other example scripts fail in the same way.&nbsp; Can anyone tell me what I'm missing?
1622506359
Kurt J.
Pro
API Scripter
CURTIS C. said: I am baffled&nbsp; &nbsp;I've been trying to make for loops wok but&nbsp; they always fail in precisely&nbsp; the same way&nbsp; This is the super basic script I copied from the examples higher up&nbsp; !script {{ &nbsp; --%LoopCounter|1;10;1 &nbsp; &nbsp; --=Roll|1d20 &nbsp; &nbsp; --+Loop|Counter is [&amp;LoopCounter], roll was [$Roll] &nbsp; --%| }} And this is the output: It clearly makes the d20 roll but never loops. All the other example scripts fail in the same way.&nbsp; Can anyone tell me what I'm missing? Do you have the latest GIST version of the script installed? For Loops haven't made it to the version on OneClick yet.
Well, that would explain a lot. I am a moron, just not the sort of moron I thought I was. Kurt J. said: Do you have the latest GIST version of the script installed? For Loops haven't made it to the version on OneClick yet.
1622518964
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Craven said: Anyone have a macro that uses the Global Damage mod and the _________ Library.&nbsp; Please don't refer to piracy sites on this forum. Thanks!
1622521290
David M.
Pro
API Scripter
keithcurtis said: Please don't refer to piracy sites on this forum. Thanks! Pretty sure Craven was referring to the "5e Tools" Scriptcards procedure library found on the wiki and not the similarly named website :)
1622525033
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
My deepest and sincere apologies. That is an unfortunate coincidence of naming.
1622525145
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Especial apologies to Craven. Let me know if you get any negative feedback from the posts, and I will do my best to intercede and rectify my mistake.
Pursuant to Richard M’s miscreant token_id (the one with the double-dash id), and David &nbsp;M‘s possible solution of deleting the token on the board and bringing out a new copy: I thought once you created a token, that token’s id was permanent. Or, at least, when a token is assigned to a “Default Token” the id would be permanent. It seems to me a number of helpful hints I’ve read over this past year indicated using the actual token ids in some macros. That is: rather than this example @{target|token_id), instead use a hard coded id like this: @(target,-M_kyr62GreDzmqWEoAr). &nbsp;If the id is not permanent, the latter example would break code pretty quick. It has been a long tough year navigating the Roll20 learning curve, so maybe I misunderstood those suggested solutions. What then is the actual status of token ids?
1622549929
David M.
Pro
API Scripter
Roscoe, you might be thinking of character ids (either that or the previous hardcoding advice was not very future-proof). Token ids only apply to "that" instance. You could for example drag two copies of a character onto the map or multiple maps, creating two instances of the default token. A unique token id will be created for each token instance, but the character id associated with the token will be the same. You can test this using @{selected|token_id} and&nbsp;@{selected|character_id} on two copies of a default token.
Thanks, David M. Let me describe a phenonium I can’t get my head around. I pull a goblin token I’ve created from my journal. When I pull another of the same token to the board, it has a unique token_id. When I make a copy of either one of them, it also has a unique id. All as expected. If, by hand, I change the bar1 (hp) on one, they all change. But, if I use a macro like !token-mod{{ --set bar1_value|?{ } }} to change the bar1(hp), only the selected token changes. If I copy all three to a separate board, they all get new token_id’s. Changing one Bar1(hp) by hand not only changes all on that board, but all others regardless of what board they reside. Changing one Bar1(hp) via the above macro changes only that one. No matter which token I use or the method of change employed, the character sheet always reflects the hp change. If, by chance, I use the character_id ( say, from another unsuspecting macro) to retrieve hp info on a goblin token that, itself, reflects no hp change, I’ll get misleading intel. The only manageable solution I’ve been able to come up with is to spend lots of time building macros.&nbsp;
1622564292
David M.
Pro
API Scripter
Rosco, this is getting off-topic from scriptcards, but it sounds like you still have the token bar1's linked to the hp of the character sheet, rather than setting them up as "mooks" (bar values de-linked from char sheet). Through some weirdness with the api, the token-mod command will do what you described (changing only one) even if the bars are still linked.&nbsp; If you then open up the token properties of the token you just changed with token-mod and do nothing but hit save, all the other tokens associated with that character will suddenly update. Solution: If you de-link the bar values, I think you will get the behavior you want. Luckily, there is a token-mod command to do this: just pass a blank value to the bar#_link, like this !token-mod --set bar1_link| ...then resave the token as the new default token with this !token-mod --set defaulttoken In case the tokens were automatically set up this way and to avoid having to go through this process in the future, go into your game settings and remove the bar links if they exist.
Well I got one of the libraries working for Saving throws. Use&nbsp;--&gt;Lib5E_Active_Global_Save_Modifiers|@{selected|character_id};Bless to save the var and then roll it in the saving throw. If no check on the sheet you get nothing. You can use&nbsp;--@setattr|_name @{target|1|token_name} _repeating_tohitmod_$0_global_attack_active_flag|1&nbsp; _silent and&nbsp;--@setattr|_name @{target|2|token_name} _repeating_savemod_$0_global_save_active_flag|1 _silent inside a scriptcard to turn the bless flag for both attack and save and change 1 to a 0 to turn the flag off. I have these in my condition macro for bless that marks the targets, turns the flags on and then print a card to chat.&nbsp; Below is my Save macro.&nbsp;&nbsp; !scriptcard {{ +++5E Tools+++ --#title|SavingThrows --#emoteText|@{selected|token_name} --#sourceToken|@{selected|token_id} --#leftsub|[*S:character_name] --#rightsub| --#titleFontColor|#FFFFFF --#titleCardBackground|#135A9C --#evenRowBackground|#B6AB91 --#evenRowFontColor|#000000 --#oddRowBackground|#CEC7B6 --#oddRowFontColor|#000000 --#emoteBackground|#FFFFFF --#tableBorderRadius|8px --:Initial variable population| --=strength_save_bonus|[*S:strength_save_bonus] --=dexterity_save_bonus|[*S:dexterity_save_bonus] --=constitution_save_bonus|[*S:constitution_save_bonus] --=intelligence_save_bonus|[*S:intelligence_save_bonus] --=wisdom_save_bonus|[*S:wisdom_save_bonus] --=charisma_save_bonus|[*S:charisma_save_bonus] --&gt;Lib5E_Active_Global_Save_Modifiers|@{selected|character_id};Bless --:Type| --&amp;Type|?{Saving Throw Type?|Strength,strength|Dexterity,dexterity|Constition,constition|Intelligence,intelligence|Wisdom,wisdom|Charisma,charisma} --+Type of Save : |[b][&amp;Type][/b] --:Bonus| --=BonusType|[$[&amp;Type]_save_bonus] --+Bonus| [$BonusType] --:Advantage, Disadvantage, Normal| --&amp;RollType|?{Advantage or Disadvantage?|Normal,1d20|Advantage,2d20kh1|Disadvantage,2d20kl1} --:Roll| --=Save|[&amp;RollType] + [$BonusType][Bonus] [&amp;Bless] --+Saving Throw is|[$Save] }}
1622576198
Kurt J.
Pro
API Scripter
keithcurtis said: My deepest and sincere apologies. That is an unfortunate coincidence of naming. I didn't know about that site &nbsp;:) I have renamed the library to "dnd5elib" on the wiki and the GIST. It won't break anything for users using it to not &nbsp;rename it (the only parts that matter are the handout title and the +++library+++ code, so as long as they match it can be called anything.
1622576406
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Kurt J. said: keithcurtis said: My deepest and sincere apologies. That is an unfortunate coincidence of naming. I didn't know about that site &nbsp;:) I have renamed the library to "dnd5elib" on the wiki and the GIST. It won't break anything for users using it to not &nbsp;rename it (the only parts that matter are the handout title and the +++library+++ code, so as long as they match it can be called anything. Cool. They need as little exposure as possible.
@ David M. Sorry about the platform. I wondered if this might be the wrong place for this question. I plowed through because I use token-mod within Scriptcards, then use Scriptcards to read the tokens, character sheets, and a host of macros covering encounters. (I heart Scriptcards) Is there an index of which forums handle which types of question/inputs?