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

Scritpcard API Working and Sharing.

1634324897

Edited 1634324970
Mads
Pro
Will M. said: Mads said: This is fantastic Will. Many thx You might grab the new version I posted.  It runs much quicker.  However, it is no longer using the TurnOrder list, and instead processing all tokens based on the filter I describe in my post above (pc, npc, char).   I see what you mean. I use it with the CombatMaster script by Victor B, and it works perfectly. Many thx.
Will M. said: You might grab the new version I posted.  It runs much quicker.  However, it is no longer using the TurnOrder list, and instead processing all tokens based on the filter I describe in my post above (pc, npc, char).   I installed the TurnMarker script from Aaron.  Then I created a new macro with your updated code.  But nothing is happening when I select the token for the current turn and click the macro button, other than the turn advances.  Nothing get populated in the token tooltips.  Am I missing a step somewhere?
1634361264
Make sure you have the development version of TokenMod (Version  v0.8.72) .  The current One-Click version doesn't support the new Tooltip fields yet. Will Matt M. said: Will M. said: You might grab the new version I posted.  It runs much quicker.  However, it is no longer using the TurnOrder list, and instead processing all tokens based on the filter I describe in my post above (pc, npc, char).   I installed the TurnMarker script from Aaron.  Then I created a new macro with your updated code.  But nothing is happening when I select the token for the current turn and click the macro button, other than the turn advances.  Nothing get populated in the token tooltips.  Am I missing a step somewhere?
Yep.  That was it.  Thanks, working now.  My players will appreciate this in our game this week :-) Will M. said: Make sure you have the development version of TokenMod (Version  v0.8.72) .  The current One-Click version doesn't support the new Tooltip fields yet. Will
1639245849
Hello I'm trying to setup a Sun Blade (radiant damage) script but keep getting hung up on trying to setup a "-and" statement. A little background to this code: 1. It's for a champion so it crits at 19 or higher (solved) 2. Applies proper resistances and vulnerabilities calculations to damage based on damage type (solved) 3. Applies another 1d8 damage to undead. (solved) 4. Applies an extra 1d8 if undead AND vulnerable to radiant but it still applies a 1d8 from this portion of the code to vulnerable non-undead (shadow demon for example). (problem) !scriptcard {{ --#title|Sun Blade (One-Handed) --#leftsub|Melee Attack --#rightsub|Range: 5ft --#subtitleFontColor|#000000 --#sourceToken|@{selected|token_id} --#targetToken|@{target|token_id} --#emoteText|@{selected|token_name} swings Sun Blade! --#titlecardbackgroundimage|linear-gradient(red, yellow) --&DamageType|radiant --=TargetAC|@{target|npc_ac} --?[$TargetAC.Total] -gt 0|DoneWithAC --=TargetAC|@{target|ac} --:DoneWithAC| --&TargID|@{target|token_id} --&rtype|@{selected|rtype} --?"[&rtype]" -inc "normal"|[ --&d20|1d20 --&rollType| --]| --?"[&rtype]" -inc "adv"|[ --&d20|2d20kh1 --&rollType|[#009900][b](Adv)[/b][/#] --]| --?"[&rtype]" -inc "disadv"|[ --&d20|2d20kl1 --&rollType|[#990000][b](DisAdv)[/b][/#] --]| --=AttackRoll|1d20 + @{selected|strength_mod} [STR] + @{selected|pb} [PROF] + 2[MAGIC] + @{selected|global_attack_mod} [MOD] --+Attack|@{selected|token_name} rolls [$AttackRoll][&rollType] --?[$AttackRoll.Base] -ge 19|Crit --?[$AttackRoll.Base] -eq 1|Fumble --?[$AttackRoll.Total] -ge [$TargetAC.Total]|Hit --+Miss|The attack missed. --^Final| --:Fumble| --+Fumble!|The attack went horribly wrong. --^Final| --:|Magic change settings here --=Magic|0 --:Hit| --&Damage|1d8 + @{selected|strength_mod} [STR] + 2[MAGIC] [BASE] -->CheckResistVulnerableImmune|[&Damage] --=Damage|[&Damage] + [&UndeadDamage] --+Hit!|The attack hits for [$Damage] [&DamageType] damage --@token-mod|_ids [&TargID] _set bar1_value|-[$Damage] --^Final| --:Crit| --&Damage|1d8 [BASE] +2d8 [CRIT] + @{selected|strength_mod} [STR] + 2[MAGIC] [BASE] -->CheckResistVulnerableImmune|[&Damage] --=Damage|[&Damage] + [&UndeadDamage] + [&UndeadDamage] --+[#009900]Critical Hit![/#]|The attack hits for [$Damage] [&DamageType] damage. --@token-mod|_ids [&TargID] _set bar1_value|-[$Damage] --:Final| --X| --:CheckResistVulnerableImmune| --?"X[*[&TargID]:npc_immunities]" -inc "[&DamageType]"|[ --+[#990000]Immune![/#]| --&Damage|0 [Immune] --]| --?"X[*[&TargID]:npc_resistances]" -inc "[&DamageType]"|[ --+[#990000]Resistant![/#]| --&Damage|[%1%] \ 2 [Resistant] --]| --?"X[*[&TargID]:npc_vulnerabilities]" -inc "[&DamageType]"|[ --+[#990000]Vulnerable![/#]| --&Damage|[%1%] * 2 [Vulnerable] --]| --?"X[*[&TargID]:npc_vulnerabilities]" -inc "radiant" -and [&TargID]:npc_type]" -inc "undead"]|[ --&UndeadDamage|+1d8 [undead] --]| NPC TYPE --:Checknpc_type| --?"X[*[&TargID]:npc_type]" -inc "undead"|[ --+[#990000]undead![/#]| --&UndeadDamage|+1d8 [undead] --]| --<| }}
1639247511
Well solved it shortly after, that's how it goes !scriptcard {{ --#title|Sun Blade (One-Handed) --#leftsub|Melee Attack --#rightsub|Range: 5ft --#subtitleFontColor|#000000 --#sourceToken|@{selected|token_id} --#targetToken|@{target|token_id} --#emoteText|@{selected|token_name} swings Sun Blade! --#titlecardbackgroundimage|linear-gradient(red, yellow) --&DamageType|radiant --=TargetAC|@{target|npc_ac} --?[$TargetAC.Total] -gt 0|DoneWithAC --=TargetAC|@{target|ac} --:DoneWithAC| --&TargID|@{target|token_id} --&rtype|@{selected|rtype} --?"[&rtype]" -inc "normal"|[ --&d20|1d20 --&rollType| --]| --?"[&rtype]" -inc "adv"|[ --&d20|2d20kh1 --&rollType|[#009900][b](Adv)[/b][/#] --]| --?"[&rtype]" -inc "disadv"|[ --&d20|2d20kl1 --&rollType|[#990000][b](DisAdv)[/b][/#] --]| --=AttackRoll|1d20 + @{selected|strength_mod} [STR] + @{selected|pb} [PROF] + 2[MAGIC] + @{selected|global_attack_mod} [MOD] --+Attack|@{selected|token_name} rolls [$AttackRoll][&rollType] --?[$AttackRoll.Base] -ge 19|Crit --?[$AttackRoll.Base] -eq 1|Fumble --?[$AttackRoll.Total] -ge [$TargetAC.Total]|Hit --+Miss|The attack missed. --^Final| --:Fumble| --+Fumble!|The attack went horribly wrong. --^Final| --:|Magic change settings here --=Magic|0 --:Hit| --&Damage|1d8 + @{selected|strength_mod} [STR] + 2[MAGIC] [BASE] -->CheckResistVulnerableImmune|[&Damage] --=Damage|[&Damage] + [&UndeadDamage] --+Hit!|The attack hits for [$Damage] [&DamageType] damage --@token-mod|_ids [&TargID] _set bar1_value|-[$Damage] --^Final| --:Crit| --&Damage|1d8 [BASE] +2d8 [CRIT] + @{selected|strength_mod} [STR] + 2[MAGIC] [BASE] -->CheckResistVulnerableImmune|[&Damage] --=Damage|[&Damage] + [&UndeadDamage] + [&UndeadDamage] --+[#009900]Critical Hit![/#]|The attack hits for [$Damage] [&DamageType] damage. --@token-mod|_ids [&TargID] _set bar1_value|-[$Damage] --:Final| --X| --:CheckResistVulnerableImmune| --?"X[*[&TargID]:npc_immunities]" -inc "[&DamageType]"|[ --+[#990000]Immune![/#]| --&Damage|0 [Immune] --]| --?"X[*[&TargID]:npc_resistances]" -inc "[&DamageType]"|[ --+[#990000]Resistant![/#]| --&Damage|[%1%] \ 2 [Resistant] --]| --?"X[*[&TargID]:npc_vulnerabilities]" -inc "[&DamageType]"|[ --+[#990000]Vulnerable![/#]| --&Damage|[%1%] * 2 [Vulnerable] --]| --?"X[*[&TargID]:npc_vulnerabilities]" -inc "radiant" -and "@{target|npc_type}" -inc "undead"|[ --&UndeadDamage|+1d8 [undead] --]| NPC TYPE --:Checknpc_type| --?"X[*[&TargID]:npc_type]" -inc "undead"|[ --+[#990000]undead![/#]| --&UndeadDamage|+1d8 [undead] --]| --<| }}
1639310363
Andrew R.
Pro
Sheet Author
Here's a complex 13th Age initiative roll script from 13th Age Glorantha. !scriptcard {{ --Lsettings|RuneChaos --#title|Slaying Early, Slaying Often --+|The Crimson Bat takes the first turn in the battle; set its first initiative count one higher than the highest initiative character --+|Then it takes its second turn on an initiative count 5 less, a third turn on an initiative count 10 less, and a fourth turn on a count 15 less --IScriptCards needs additional information to continue;Click to provide information|q;Highest;What is the highest initiative? --=Turn|[&Highest] + 1 --%LoopCount|0;3;1 --=Less|[&LoopCount] * 5 --&Formula|0 --=Initial|[$Turn] - [$Less] --@act|[&Formula] [$Initial] _Crimson Bat --%|LoopCount }}
1640840029

Edited 1640892644
Barbarian Rage 5E Updated 12/30/2021 This one will toggle the Rage damage modifier flag on the Roll20 5E OGL Character sheet.&nbsp; It also plays shows a gif that looks like the barbarian character in my campaign, changes the side of the token to the rage side from the roll table, and plays a sound if you have it in Roll20AM.&nbsp; This was my first time using the repeating section to look for a modifier.&nbsp; I plan on using it more in the future for things like Bless or Bane. 12/30/21 Update - This will look for a where the resource is for tracking purposes now and reduce it by 1 even if it isn't a class resource. !Scriptcard {{ --#reentrant|RAGE @{selected|character_id} --/| &gt;&gt;&gt;&gt;&gt; Formatting &lt;&lt;&lt;&lt;&lt; --#emoteBackground|#transparent --#titleCardBackground|#ed0202 --#titlefontsize|1.75em --#titlefontlineheight|1.75em --#titleFontColor|white --#titlefontface|Shadows Into Light --#subtitleFontSize|12px --#subtitleFontFace|Verdana --#evenRowBackground|#B6AB91 --#evenRowFontColor|#000000 --#oddRowBackground|#CEC7B6 --#oddRowFontColor|#000000 --#whisper|self,gm --#title|RAGE BOB --#titleCardBackground|#FF0000 --#sourceToken|@{selected|token_id} --&gt;Global_mod_finder|@{selected|character_id};damage;Rage --&amp;ResourceUsed|Rage --:Global_mod_finder|character_id;modtype(tohit,save,skill,AC,damage);ModeName --&amp;ModType|[%2%] --&amp;ModName|[%3%] --Rfirst|[%1%];repeating_[&amp;ModType]mod --=ModLoop|0 --:Mod_Loop| --?"[*R:global_[&amp;ModType]_name]" -eq "[&amp;ModName]"|ModFound --=ModLoop| [$ModLoop] + 1 --Rnext| --?"[*R:global_damage_name]" -eq "NoRepeatingAttributeLoaded"|ModNotFound --^ModLoop| --:ModFound| --?"[*R:global_damage_active_flag]" -eq "1"|TurnOff --#whisper| --&gt;GetAndCheckAmmoInformation|[*S:character_id];Rage;Ammoname;Ammo --&gt;AmmoAvailable| --#emoteText|@{selected|token_name} goes into a pint sized fit of RAGE!!! --+|[img]<a href="https://c.tenor.com/ob62tslCeUIAAAAC/gnome-gravity-falls.gif[/img]" rel="nofollow">https://c.tenor.com/ob62tslCeUIAAAAC/gnome-gravity-falls.gif[/img]</a> --@roll20AM|_audio,play,nomenu|rage --vtoken|@{selected|token_id} burn-death --@setattr|_charid [*S:character_id] _repeating_[&amp;ModType]mod_$[$ModLoop.Raw]_global_[&amp;ModType]_active_flag|1 _silent --@act| -1| 10| _Rage Bob --@token-mod| _set currentside|2 _ids @{character_id} --&gt;AmmoSpent| --X| --:GetAndCheckAmmoInformation|character_id;resourceName;Ammoname;Ammo --?"[%2%]" -eq "[*[%1%]:class_resource_name]"|_Lib5E_IsResourceClass --?"[%2%]" -eq "[*[%1%]:other_resource_name]"|_Lib5E_IsResourceOther --Rfirst|[%1%];repeating_resource --:_Lib5E_ResourceLoop| --?"[*R:resource_left_name]" -eq "[%2%]"|_Lib5E_IsResourceLeft --?"[*R:resource_right_name]" -eq "[%2%]"|_Lib5E_IsResourceRight --Rnext| --?"[*R:resource_left_name]" -ne "NoRepeatingAttributeLoaded"|_Lib5E_ResourceLoop --&amp;[%3%]|NotFound --&amp;[%4%]|NotFound --$[%4%]|0 --&lt;| --:_Lib5E_IsResourceClass| --&amp;[%3%]|class_resource_name --&amp;[%4%]|class_resource --=[%4%]|[*[%1%]:class_resource] --&lt;| --:_Lib5E_IsResourceOther| --&amp;[%3%]|other_resource --&amp;[%4%]|other_resource --=[%4%]|[*[%1%]:other_resource] --&lt;| --:_Lib5E_IsResourceLeft| --&amp;[%3%]|[*R&gt;resource_left_name] --&amp;[%4%]|[*R&gt;resource_left] --=[%4%]|[*R:resource_left] --&lt;| --:_Lib5E_IsResourceRight| --&amp;[%3%]|[*R&gt;resource_right_name] --&amp;[%4%]|[*R&gt;resource_right] --=[%4%]|[*R:resource_right] --&lt;| --&lt;| --:AmmoAvailable| --?[$Ammo] -eq 0|NoAmmoLeft --=Ammo|[$Ammo] - 1 --&lt;| --:NoAmmoLeft| --#whisper| --+|[*S:character_name] has no [&amp;ResourceUsed] left. --#emoteText|[*S:character_name] is all out of [&amp;ResourceUsed]. --X| --:AmmoSpent| --@setattr|_charid [*S:character_id] _[&amp;Ammo]|[$Ammo] _silent --+|Rage Left: [$Ammo] --X| --:TurnOff| --#whisper| --#emoteText|@{selected|token_name} Calms down. --+|[img]<a href="https://media3.giphy.com/media/nfecRCYP9PjO/giphy.gif[/img]" rel="nofollow">https://media3.giphy.com/media/nfecRCYP9PjO/giphy.gif[/img]</a> --@setattr|_charid [*S:character_id] _repeating_[%2%]mod_$[$ModLoop.Raw]_global_[&amp;ModType]_active_flag|0 _silent --*|Get rid of the turn tracker. --@roll20AM|_audio,play,nomenu|Shrink --@token-mod| _set currentside|1 _ids @{character_id} --X| --:ModNotFound| --+No Global Mod|There is no global [%2%] mod named [%3%]. --X| }}
1642018770

Edited 1642018840
Ok, here's one that is a mashup of stuff. What this does is allow a door token to be selected and have the player interact with the door in any number of different ways; Find and remove traps, unlock, open and close, as well as force open. They can do all of this in game without (theoretically) any interaction from the GM at all with a little setup.&nbsp; You will need the following APIs: Scriptcards (duh), SmartAOE (for traps set off), Door Knocker (to open and close doors), Token-Mod (to set up door tokens.&nbsp; I have a token that I place on any door a character can interact with. That token is associated with a character named "Door" cause I'm creative like that. Then run this macro to set up the door properties.&nbsp; !token-mod {{ --set bar2|?{Is this door locked?|No,0|Yes,1} bar2_max|?{What is the open lock DC?|0} bar1|?{Is this door trapped?|No,0|Yes,1|Yes &amp; Resets,2} bar1_max|?{What is the find trap DC?|0} bar3|?{What is the remove trap DC?|0} bar3_max|?{What is the force open DC?|0} aura1_radius|?{What skill is needed to remove a trap?|No Trap,0|Computer,1|Engineering,2|Computer or Engineering} aura2_radius|?{What skill is needed to unlock this door?|No Trap,0|Computer,1|Engineering,2|Computer or Engineering} }} Other trap status for bar1_value are 0,None|3,Triggered|4,Disabled. I'll use these in the scriptcard. Also, make sure your auras are transparent on your default token unless you want the aura to show.&nbsp; This just sets up the token with what the script needs to interact with the door. You can change the skills required based on the game you are running. This is setup for a Starfinder campaign.&nbsp; Now for the Door Knocker script, just create an unlocked door line on the Dynamic Lighting layer where the door is. This is the easiest way I've found to open and close a door.&nbsp; Now on your Door character, place the scriptcard on the character as a token action with whatever name you want. I've added comments throughout so you can kinda see my logic flow.&nbsp; !script {{&nbsp; --/|If you want to use the Smart AOE script like I do when a trap is triggered, you will need the player ID of yourself so you can control the trap. --&amp;PlayerID|Player ID here --#sourceToken|@{selected|token_id} --#emoteState|Hidden --#whisper|self --/|This allows your player to have the door selected and not themselves. They will need to have the chat dropdown set to their character --~Character|string;after;|;[&amp;SendingPlayerSpeakingAs] --#title|[*[&amp;Character]:character_name] - Door Interaction --#leftsub|What would you like to do? --/|These are for starting to track repeat attempts in each sub-section --=RemoveAttempt|0 --=UnlockAttempt|0 --=FindAttempt|0 --=ForceAttempt|0 --=TrapFound|0 --/|Creates the initial menu. We will loop back to this a ton as a player interacts with the door token. --:DoorMenu| --+|[c][rbutton]Find Traps::FindTraps[/rbutton] [rbutton]Remove Traps::RemoveTraps[/rbutton] [rbutton]Unlock Door::UnlockDoor[/rbutton] [rbutton]Open Door::OpenDoor[/rbutton] [rbutton]Close Door::CloseDoor[/rbutton] [rbutton]Force Door::ForceDoor[/rbutton][/c] --X| --:FindTraps| --#title|[*[&amp;Character]:character_name] - Find Traps --#whisper| --#leftsub| --/|I use a -2 cumuluative penalty for each find trap attempt. You can delete the next line if you don't --=FindRepeat|[$FindAttempt] * 2 --=TrapStatus|[*S:t-bar1_value] --=PerceptionRoll|1d20 [Base] + [*[&amp;Character]:perception] [Perception] - [$FindRepeat] [Repeated Attempt] --/|Send the roll to the GM for funsies --*|Perception roll is [$PerceptionRoll] --?[$TrapStatus] -eq 0 -or [$TrapStatus] -eq 3 -or [$TrapStatus] -eq 4|NoTrapsApparent --=FindTrapDC|[*S:t-bar1_max] --?[$TrapStatus] -eq 1 -and [$PerceptionRoll] -ge [$FindTrapDC]|TrapFound --:NoTrapsApparent| --+Looks Clear|[i][*[&amp;Character]:character_name] does not detect any active traps on this door. [/i] --/|Delete attempt line below if no repeated attempt penalty --=FindAttempt|[$FindAttempt] + 1 --/|TrapFound variable to insure players must search for traps before attempting to remove --=TrapFound|1 --^DoorMenu| --:TrapFound| --+Danger!|[i][*[&amp;Character]:character_name] detects a trap on this door. [/i] --/|Delete attempt line below if no repeated attempt penalty --=FindAttempt|[$FindAttempt] + 1 --/|TrapFound variable to insure players must search for traps before attempting to remove --=TrapFound|1 --^DoorMenu| --:RemoveTraps| --#title|[*[&amp;Character]:character_name] - Remove Traps --#whisper| --#leftsub| --?[$TrapFound] -eq 0|SearchFirst --=TrapStatus|[*S:t-bar1_value] --?[$TrapStatus] -eq 0 -or [$TrapStatus] -eq 3 -or [$TrapStatus] -eq 4|NoTrapsActive --/|What skill is required to remove a trap for your game. Change as needed. --=RemoveSkillRequired|[*S:t-aura1_radius] --?[$RemoveSkillRequired] -eq 0|NoTrapsActive --?[$RemoveSkillRequired] -eq 1 -and [*[&amp;Character]:computers_ranks] -eq undefined|&gt;NoRemoveSkill; Computer --?[$RemoveSkillRequired] -eq 2 -and [*[&amp;Character]:engineering_ranks] -eq undefined|&gt;NoRemoveSkill; Engineering --?[$RemoveSkillRequired] -eq 3 -and [*[&amp;Character]:engineering_ranks] -eq undefined -and [*[&amp;Character]:computers_ranks] -eq undefined|&gt;NoRemoveSkill; Computer or Engineering --=RemoveRepeat|[$RemoveAttempt] * 2 --=RemoveDC|[*S:t-bar3_value] --/|DC increase by 5 for subtlety --IAre you trying to hide any ; signs of tampering?|q;Tamper;Are you trying to hide any signs of tampering?|No|Yes --?"[&amp;Tamper]" -eq "Yes"|=RemoveDC;[$RemoveDC] + 5 --/|May not be needed based on skill(s) required --~HighestScore|math;max;[*[&amp;Character]:computers];[*[&amp;Character]:engineering] --?[*[&amp;Character]:computers] -eq [*[&amp;Character]:engineering]|=HighestScore;[*[&amp;Character]:engineering] --?[$RemoveSkillRequired] -eq 1|=HighestScore;[*[&amp;Character]:computers] --?[$RemoveSkillRequired] -eq 2|=HighestScore;[*[&amp;Character]:engineering] --=RemoveCheck|1d20 [Base] + [$HighestScore] [Skill] - [$RemoveRepeat] [Repeated Attempt] --=CritFailDC|[$RemoveDC] - 5 --?[$RemoveCheck] -lt [$CritFailDC]|TrapTriggered --?[$RemoveCheck] -ge [$RemoveDC]|TrapRemoved --+Not Quite|[i]With a roll of [$RemoveCheck], [*[&amp;Character]:character_name] fails to remove the trap on this door. They may try again with a cumuluative -2 penalty.[/i] --=RemoveAttempt|[$RemoveAttempt] + 1 --^DoorMenu| --:TrapRemoved| --+Good work!|[i]With a roll of [$RemoveCheck], [*[&amp;Character]:character_name] removes the trap on this door.[/i] --!t:[*S:t-id]|bar1_value:4 --^DoorMenu| --:TrapTriggered| --+Whoops!|[i]With a roll of [$RemoveCheck], [*[&amp;Character]:character_name] triggers the trap on this door.[/i] --?[$TrapStatus] -eq 2|=Reset;2|=Reset;3 --!t:[*S:t-id]|bar1_value:[$Reset] --/|Smart AOE script commands go in the Name field of the token --@smartaoe|[*S:t-name] --^DoorMenu| --:NoTrapsActive| --+Looks Clear|[i]There do not appear to be any active traps on this door. [/i] --^DoorMenu| --:NoRemoveSkill| --+Too Complex|[i][*[&amp;Character]:character_name] does not have the required [%1%] skill to remove this trap.[/i] --^DoorMenu| --:SearchFirst| --+Not Yet|[i]You must first search for traps before you can remove them.[/i] --^DoorMenu| --:UnlockDoor| --#title|[*[&amp;Character]:character_name] - Unlock Door --#whisper| --#leftsub| --=UnlockSkillRequired|[*S:t-aura2_radius] --?[*S:t-bar2_value] -eq 0|DoorNotLocked --/|Required Skill --?[$UnlockSkillRequired] -eq 1 -and [*[&amp;Character]:computers_ranks] -eq undefined|&gt;NoUnlockSkill; Computer --?[$UnlockSkillRequired] -eq 2 -and [*[&amp;Character]:engineering_ranks] -eq undefined|&gt;NoUnlockSkill; Engineering --?[$UnlockSkillRequired] -eq 3 -and [*[&amp;Character]:engineering_ranks] -eq undefined -and [*[&amp;Character]:computers_ranks] -eq undefined|&gt;NoUnlockSkill; Computer or Engineering --=UnlockDC|[*S:t-bar2_max] --=UnlockRepeat|[$UnlockAttempt] * 2 --IAre you trying to hide any ; signs of tampering?|q;Tamper;Are you trying to hide any signs of tampering?|No|Yes --?"[&amp;Tamper]" -eq "Yes"|=UnlockDC;[$UnlockDC] + 5 --~HighestScore|math;max;[*[&amp;Character]:computers];[*[&amp;Character]:engineering] --?[*[&amp;Character]:computers] -eq [*[&amp;Character]:engineering]|=HighestScore;[*[&amp;Character]:engineering] --?[$UnlockSkillRequired] -eq 1|=HighestScore;[*[&amp;Character]:computers] --?[$UnlockSkillRequired] -eq 2|=HighestScore;[*[&amp;Character]:engineering] --=UnlockCheck|1d20 [Base] + [$HighestScore] [Skill] - [$UnlockRepeat] [Repeated Attempt] --?[$UnlockCheck] -ge [$UnlockDC]|DoorUnlocked --+Not Quite|[i]With a roll of [$UnlockCheck], [*[&amp;Character]:character_name] fails to unlock this door. They may try again with a cumuluative -2 penalty.[/i] --=UnlockAttempt|[$UnlockAttempt] + 1 --^DoorMenu| --:DoorUnlocked| --+Success|[i]With a roll of [$UnlockCheck], [*[&amp;Character]:character_name] unlocks this door.[/i] --!t:[*S:t-id]|bar2_value:0 --^DoorMenu| --:DoorNotLocked| --+Congratulations!|[i]You have unlocked an unlocked door.[/i] --^DoorMenu| --:NoUnlockSkill| --+Too Complex|[i][*[&amp;Character]:character_name] does not have the required [%1%] skill to unlock this door.[/i] --^DoorMenu| --:OpenDoor| --#title|[*[&amp;Character]:character_name] - Open Door --#whisper| --#leftsub| --/|Have to unlock before opening --?[*S:t-bar2_value] -eq 1|LockedDoor --/|Trigger trap on open if not removed --=TrapStatus|[*S:t-bar1_value] --?[$TrapStatus] -eq 1 -or [$TrapStatus] -eq 2|SetOffTrap --/|This is where the Door Knocker script comes into play.&nbsp; --@knock|_push|toggle --^DoorMenu| --:LockedDoor| --+Not yet|[i]This door is still locked. You will have to unlock it first. [/i] --^DoorMenu| --:SetOffTrap| --+Whoops!|[i]Trying to unlock it, [*[&amp;Character]:character_name] triggers the trap on this door.[/i] --?[$TrapStatus] -eq 2|=Reset;2|=Reset;3 --!t:[*S:t-id]|bar1_value:[$Reset] --/|Smart AOE script commands go in the Name field of the token --@smartaoe|[*S:t-name] --^DoorMenu| --:CloseDoor| --#title|[*[&amp;Character]:character_name] - Close Door --#whisper| --#leftsub| --@knock|_push|toggle --^DoorMenu| --:ForceDoor| --#title|[*[&amp;Character]:character_name] - Force Door --#whisper| --#leftsub| --=TrapStatus|[*S:t-bar1_value] --?[$TrapStatus] -eq 1 -or [$TrapStatus] -eq 2|ForcedTrap --=ForceDC|[*S:t-bar3_max] --=ForceRepeat|[$ForceAttempt] * 2 --=ForceCheck|1d20 [Base] + [*[&amp;Character]:athletics] [Athletics] - [$ForceRepeat] [Repeated Attempt] --?[$ForceCheck] -gt [$ForceDC]|ForcedOpen --+Not Quite|[i]With a roll of [$ForceCheck], [*[&amp;Character]:character_name] fails to force this door open. They may try again with a cumuluative -2 penalty.[/i] --=ForceAttempt|[$ForceAttempt] + 1 --^DoorMenu| --:ForcedOpen| --+Success|[i]With a roll of [$ForceCheck], [*[&amp;Character]:character_name] forces this door open.[/i] --!t:[*S:t-id]|bar2_value:0 --@knock|_push|toggle --^DoorMenu| --:ForcedTrap| --+Whoops!|[i]Trying to force the door open, [*[&amp;Character]:character_name] triggers the trap on this door.[/i] --?[$TrapStatus] -eq 2|=Reset;2|=Reset;3 --!t:[*S:t-id]|bar1_value:[$Reset] --/|Smart AOE script commands go in the Name field of the token --@smartaoe|[*S:t-name] --^DoorMenu| }} For the SmartAOE command, just write those into the name field of the token like you would into the card. For example, a 10' radius Explosive Blast Trap would read like: _selectedID|[*S:t-id] _playerID|[&amp;PlayerID] _title|Explosive Blast _leftsub|Trap! _rightsub|DC 20 _radius|10ft _aoetype|PFcircle, float _instant|yes _origin|nearest _forceIntersection|1 _mingridarea|0.25 _fx|burst-fire _dc|20 _saveformula|&lt;&lt;1d20+a{ref}&gt;&gt; _damageformula1|[[4d6]] _damagesaverule|*0.5 _damageType1|fire _bar|1,3 _autoapply|true Let me know if you have any questions or enhancements!
1642019683
David M.
Pro
API Scripter
Pretty cool, Erik!
1642880573
Another version of Bless: I took the Magic Missile script and the other Bless script and modified it to target the number of targets based on casting level, turn on the global save and attack modifiers and add a status marker. Previous versions I found didn't turn on the global attack modifier. The key was is this bit of code: &nbsp;--@setattr|_charid [*[%2%]:character_id] _repeating_savemod_$0_global_save_active_flag|1 _silent &nbsp; --@setattr|_charid [*[%2%]:character_id] _repeating_tohitmod_$0_global_attack_active_flag|1 _silent Notice in line 2 "tohitmod" isn't intuitively called "attackmod". !scriptcard {{ --#title|Bless --#sourceToken|@{selected|token_id} --&gt;GetAndCheckSlotInformation| --=BlessCount|[$SlotLevel] + 2 --&gt;BuildAndAskTargets|[$BlessCount.Total] --=DisplayCount|1 --#leftsub|Slot level [$SlotLevel] --#rightsub|Range: 30 feet --#emoteText|@{selected|character_name} uses a level [$SlotLevel.Total] spell slot to Bless [$BlessCount.Total] friends! --+|Blessed targets will be able to add 1d4 to their attack rolls or saving throws for the duration of the spell. --:BlessLoop| --&gt;FireMissile|[$DisplayCount.Total] --=DisplayCount|[$DisplayCount] + 1 --?[$DisplayCount] -le [$BlessCount]|BlessLoop --&gt;DeductSpellSlot| --#rightsub|Level [$SlotLevel] Left: [$SlotsRemaining] --X| --:FireMissile| --&amp;ThisTarget|[&amp;target[%1%]] --+|The [*[&amp;ThisTarget]:character_name] is Blessed. --@act| -1| 10| _Bless [*[&amp;ThisTarget]:character_name] --&gt;PlayEffects|@{selected|token_id};[&amp;ThisTarget];none;frost;burn;bless --&lt;| --:GetAndCheckSlotInformation| --=SlotLevel|?{Spell Slot Level Used?|1|2|3|4|5|6|7|8|9} --=SlotsTotal|0 --=SlotsExpended|[*S:lvl[$SlotLevel]_slots_expended] --?[$SlotsExpended.Total] -eq [$SlotsTotal.Total]|NoSlotsLeft --&lt;| --:NoSlotsLeft| --+|[*S:character_name] has no level [$SlotLevel.Total] spell slots available. --#emoteText|[*S:character_name] tries to cast a spell but farts in instead. --X|NoSlotsLeftStop --:DeductSpellSlot| --=SlotsExpended|[$SlotsExpended] - 1 --@setattr|_charid [*S:character_id] _lvl[$SlotLevel]_slots_expended|[$SlotsExpended] _silent --+|Level [$SlotLevel] Slots Left: [$SlotsExpended] --X|Full Stop --:PlayEffects|Parameters are : sourcetoken; targettoken; source effect; target effect; line effect; sound effect --@setattr|_charid [*[%2%]:character_id] _repeating_savemod_$0_global_save_active_flag|1 _silent --@setattr|_charid [*[%2%]:character_id] _repeating_tohitmod_$0_global_attack_active_flag|1 _silent --@token-mod| _ids [*[%2%]:character_id] _set statusmarkers|angel-outfit --vtoken|[%1%] [%3%] --vtoken|[%2%] [%4%] --vbetweentokens|[%1%] [%2%] [%5%] --@roll20AM|_audio,play,nomenu|[%6%] --&lt;| --:BuildAndAskTargets| --&amp;TargetString| --=targetCount|1 --:TargetLoop| --&amp;TargetString|+t;target[$targetCount.Raw];Missile [$targetCount.Raw] Target --=targetCount|[$targetCount.Raw] + 1 --?[$targetCount] -le [%1%]|&gt;AddSeparator --?[$targetCount] -le [%1%]|TargetLoop --iPlease click the button below to select targets to bless;Select [%1%] Targets|[&amp;TargetString] --/| --&lt;| --:AddSeparator| --&amp;TargetString|+|| --&lt;| --:AddSeparator| --&amp;TargetString|+|| --&lt;| --^Final| --&lt;| }}
1646197477

Edited 1646197673
5E Aid This script will get slot level, ask how many targets, let you select targets 1 at a time, increase max HP, increase 5 HP, keep track of max HP change, turn on a token marker, and reduce spell slot count.&nbsp; I also provided a buff removal.&nbsp; You will need to create an attribute called&nbsp;TempHPMaxBonusAid to the character. !scriptcards {{ +++5ETools+++ --#sourceToken|@{selected|token_id} --#reentrant|@{selected|character_id} --#emoteBackground|#transparent --#titleCardBackground|#ff8000 --#titlefontsize|1.75em --#titlefontlineheight|1.75em --#titleFontColor|white --#titlefontface|Shadows Into Light --#subtitleFontSize|12px --#subtitleFontFace|Verdana --#evenRowBackground|#B6AB91 --#evenRowFontColor|#000000 --#oddRowBackground|#CEC7B6 --#oddRowFontColor|#000000 --#whisper|self,gm --#title|Aid --#rightsub|Duration: 8 hours --&gt;Lib5E_GetAndCheckSlotInformation|2 --#leftsub|Range: 30 ft Slot Level:[$SlotLevel] --+How Many Targets?|[rbutton]1::ThisMany;1[/rbutton][rbutton]2::ThisMany;2[/rbutton][rbutton]3::ThisMany;3[/rbutton] --X| --:ThisMany| --=HowMany|[&amp;reentryval] --:TargetLoop| --?[$Target] -eq [$HowMany]|End --=Target|[$Target] + 1 --?[$Target] -gt 1|NextTarget --+Target|[rbutton]Click this button to select your first target.::DoIt;&amp;#64;{target|token_id}[/rbutton] --X| --:NextTarget| --+Target|[rbutton]Click this button to select your next target.::DoIt;&amp;#64;{target|token_id}[/rbutton] --X| --:DoIt| --#whisper| --#targetToken|[&amp;reentryval] --=HPGain|[$SlotLevel] - 1 * 5 --#emoteText|[*S:t-name] text a heart emoji to [*T:t-name], making them feel better. --+|[*T:t-name] now has [$HPGain] additional Max HP and is healed for those [$HPGain] additional HP. --=NewHPMax|[*S:hp^] + [$HPGain] --=Heal|[*S:hp] + [$HPGain] --=TempHPMaxBonusChange|[$HPGain] --!a:[*T:character_id]|hp^:+=[$HPGain] --@alter|_target|[*T:t-id] _bar|1 _amount|+[$HPGain] --!a:[*T:character_id]|TempHPMaxBonusAid:[$HPGain] --@token-mod| _ids [*T:t-id] _set statusmarkers|bolt-shield --^TargetLoop| --:End| --&gt;Lib5E_DeductSpellSlot|[*S:character_id];[$SlotLevel] --X| }} Things you can add as a library hand out or put into the macro: --:Lib5E_GetAndCheckSlotInformation|Minimum Level --=MLVL|[%1%] --=MaxSlotLoop|[%1%] --:Lib5E_Caster_SlotLoop| --&amp;CasterButtons|+ [rbutton][$MaxSlotLoop]::knowYourLVL1;[$MaxSlotLoop][/rbutton] --=MaxSlotLoop|[$MaxSlotLoop] + 1 --?[*S:lvl[$MaxSlotLoop]_slots_total] -gt 0|Lib5E_Caster_SlotLoop --=MaxLevel|[$MaxSlotLoop] - 1 --?[$MLVL] -eq [$MaxLevel]|&amp;reentryval;[$MaxLevel] --?[$MLVL] -eq [$MaxLevel]|knowYourLVL1 --+Spell Level|[&amp;CasterButtons] --X| --:knowYourLVL1| --#whisper| --=SlotLevel|[&amp;reentryval] --=SpellLevel|[&amp;reentryval] --=SlotsExpended|[*S:lvl[$SlotLevel]_slots_expended] --?[$SlotsExpended.Raw] -eq 0|Lib5E_NoSlotsLeft --&lt;| --:Lib5E_NoSlotsLeft| --+|[b][*S:character_name] has no level [$SlotLevel.Total] spell slots available.[/b] --X|NoSlotsLeftStop --:Lib5E_DeductSpellSlot|characterid;slotlevel --=_Lib5ESlotsExpended|[*[%1%]:lvl[%2%]_slots_expended] - 1 --~_Lib5ESlotsExpended|math;min;[$_Lib5ESlotsExpended];[*[%1%]:lvl[%2%]_slots_total] --@setattr|_charid [%1%] _lvl[%2%]_slots_expended|[$_Lib5ESlotsExpended] _silent --+Spell Slots Left|[*[%1%]:character_name] has [$_Lib5ESlotsExpended.Raw] level [%2%] spell slots left. --&lt;| Here is the buff removal for aid section I have for my buff removal script: --:Aid| --#whisper| --+Aid Removed|[*S:t-name] is no longer getting a buff from Aid. Their Max HP has been reduced by [*S:TempHPMaxBonusAid]. --!a:[*S:character_id]|hp^:-=[*S:TempHPMaxBonusAid] --!a:[*S:character_id]|TempHPMaxBonus:0 --@token-mod| _ids [*S:t-id] _set statusmarkers|-bolt-shield
1646199148
Max HP Change Tracker If you are forgetful like me, you may have changed the max HP of a character and forgot by how much.&nbsp; This macro will change the max HP for you and keep track of it.&nbsp; There is a macro below that will undo it if they do what is needed to get that max HP back.&nbsp; You will need to add the attribute&nbsp;TempHPMaxBonus to the character's to keep track of changes of Max HP. !scriptcards {{ --#sourceToken|@{selected|token_id} --#reentrant|@{selected|character_id} --#emoteBackground|#transparent --#titleFontColor|white --#titlefontface|Shadows Into Light --#subtitleFontSize|12px --#subtitleFontFace|Verdana --#whisper|gm --#title|Max HP Change --IHow much do you want to change [*S:t-name] Max HP by?;Click the button to enter the change in Max HP.|q;NewHPMax;Enter the change in HP Max? --=TempHPMaxBonusChange|[*S:TempHPMaxBonus] + [&amp;NewHPMax] --#whisper| --+Max HP change|[*S:t-name] Max HP has changed by [&amp;NewHPMax]. --!a:[*S:character_id]|hp^:+=[&amp;NewHPMax] --!a:[*S:character_id]|TempHPMaxBonus:[$TempHPMaxBonusChange] --?[&amp;NewHPMax] -gt 0|increase --@token-mod| _ids [*S:t-id] _set statusmarkers|death-zone --X| --:increase| --@token-mod| _ids [*S:t-id] _set statusmarkers|strong --X| }} Here is the macro addition to return max HP to normal. --:MaxHPChange| --#whisper| --?[*S:TempHPMaxBonus] -gt 0|decreaseMaxHPChange --!a:[*S:character_id]|hp^:-=[*S:TempHPMaxBonus] --!a:[*S:character_id]|TempHPMaxBonus:0 --@token-mod| _ids [*S:t-id] _set statusmarkers|-strong --+|[*S:t-name] Max HP has returned to normal. --X| --:decreaseMaxHPChange| --!a:[*S:character_id]|hp^:-=[*S:TempHPMaxBonus] --!a:[*S:character_id]|TempHPMaxBonus:0 --@token-mod| _ids [*S:t-id] _set statusmarkers|-death-zone --+|[*S:t-name] Max HP has returned to normal. --X|
Hi everyone, I am currently using a basic macro to change light and vision settings via the token-mod api but I would like to get it to look like the Character Action Menu using script cards (I am already using that specific macro) but I am a total noob and complex programming. Could anyone please help me. Images for reference: From This Style - To This Style - I also have a vision version of the above light macro which I would also like to look the same as the Action Menu one but If I can get the Light one I hope I can adapt it to work for others.
Thanks to Kurt who has made another great template using his Scriptcards API I now have my light and vision macros looking how I want them to. The code is in Kurts Github