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 - Thread #2

1684007770
David M.
Pro
API Scripter
Try using object modification as described here . Air coding example without testing below. It assumes you have already populated roll variables with the new xy dimensions. You could also optionally replace those variables with direct queries. --!t:@{selected|token_id}|width:[$newWidth] --!t:@{selected|token_id}|height:[$newHeight]
Hi all.&nbsp; I am just starting to delve in the world of Scriptcards...that is to say, I just came across it and started reading about all the things that are possible.&nbsp; amazing. I am hoping that there is some guidance/advice that I can get for the following: my group, we play ADnD 2e.&nbsp; and we use this sheet in roll20:&nbsp; <a href="https://wiki.roll20.net/ADnD_2nd_Edition_Character_sheet" rel="nofollow">https://wiki.roll20.net/ADnD_2nd_Edition_Character_sheet</a> I am trying to create a script that allows to click a single button, that will then list in chat all the weapons on that character to choose with which to attack. the problem I am running into is that I am unable to dynamically check and only list weapons if weapons are on the sheet. the sheet itself has weapons listed in 2 sections, for attack and for damage. here is a screenshot: the weapon designation is @{repeating_weapons_$X_weaponname} for attack and @repeating_weapons-damage_$X_weaponname1} for damage $X is the place designation on the list, where $0 is the first weapon, $1 is the second, and so on. As mentioned, when I write a macro, I have to write it with up to 10+ weapon references, but if no actual weapon is listed, it errors out. I am not sure if scriptcards can help do a if/then validation to accomplish this.&nbsp; I am hoping it can.&nbsp; If someone has already done something like this that I can use as a reference point, I would really appreciate being pointed to it.&nbsp; thank you!
Heya, Gabriel.&nbsp; What you are asking about is 100% possible to do using repeating section lookups and loops.&nbsp; I suggest you take a look at&nbsp; ScriptCards Wiki Page &nbsp;and take a look at the&nbsp; Original ScriptCards Thread. &nbsp; Both have tons of useful links, resources and examples to get you started.&nbsp; There is even a discord with tons of awesome folks to help you get started. TBH, I'm just a beginner with ScriptCards myself, and I dont know exactly how to do what you are suggesting but I'd be happy to try and help.&nbsp; That being said.&nbsp; You need to provide more details, at the very least you need to post the ScriptCards Code so we can see what you are trying to do. There is also another question that I have-and is somewhat important.&nbsp; Are you trying to create a ScriptCards to handle the rolls themselves as well?&nbsp; Or are you just wanting to create a ScriptCards that displays the Weapon Name, some basic attack details and a button to activate the sheet's own built in rolltemplate.&nbsp; The first should be straight forward, the second would require a bit more work, but honestly is a perfect project to use to teach yourself more about the syntax and code. On an unrelated note, why are you wanting to output all weapons on a sheet to chat?&nbsp; Why not roll it from the token or character sheet?
How do you make multiple rolls on a rollable table in a scriptcard? I want to roll the equivalent of: [[{5t[Tablename]}kh3]]
Hi Toby, thanks for the response. not all of our players like/prefer to use the character sheet.&nbsp; However, the DM wants us to use macros to speed mundane things along.&nbsp; So, the character sheet is really a repository of core data for the character.&nbsp; nothing else.&nbsp; &nbsp;everything we do is with macros. as far as why through chat, well, that's not a hard requirement. basically, I would like to give the players a single button, that would give them options for weapon they are using in the attack, then trigger the attack and damage macro. Toby said: Heya, Gabriel.&nbsp; What you are asking about is 100% possible to do using repeating section lookups and loops.&nbsp; I suggest you take a look at&nbsp; ScriptCards Wiki Page &nbsp;and take a look at the&nbsp; Original ScriptCards Thread. &nbsp; Both have tons of useful links, resources and examples to get you started.&nbsp; There is even a discord with tons of awesome folks to help you get started. TBH, I'm just a beginner with ScriptCards myself, and I dont know exactly how to do what you are suggesting but I'd be happy to try and help.&nbsp; That being said.&nbsp; You need to provide more details, at the very least you need to post the ScriptCards Code so we can see what you are trying to do. There is also another question that I have-and is somewhat important.&nbsp; Are you trying to create a ScriptCards to handle the rolls themselves as well?&nbsp; Or are you just wanting to create a ScriptCards that displays the Weapon Name, some basic attack details and a button to activate the sheet's own built in rolltemplate.&nbsp; The first should be straight forward, the second would require a bit more work, but honestly is a perfect project to use to teach yourself more about the syntax and code. On an unrelated note, why are you wanting to output all weapons on a sheet to chat?&nbsp; Why not roll it from the token or character sheet?
1684192420

Edited 1684192603
Gauss
Forum Champion
gabriel b. said: Hi Toby, thanks for the response. not all of our players like/prefer to use the character sheet.&nbsp; However, the DM wants us to use macros to speed mundane things along.&nbsp; So, the character sheet is really a repository of core data for the character.&nbsp; nothing else.&nbsp; &nbsp;everything we do is with macros. as far as why through chat, well, that's not a hard requirement. basically, I would like to give the players a single button, that would give them options for weapon they are using in the attack, then trigger the attack and damage macro. This should be achievable without a character sheet, just using Attributes, then using either Abilities (character macros) or Macros (collection tab macros).&nbsp; As for a single button with options, that is also doable. Chat Menus and/or Queries can work like that.&nbsp; If you need help setting this up, let me know.&nbsp; Note: I know you are looking for API scripting help, just saying that there are also regular non-scripting options. :)
Gauss said: gabriel b. said: Hi Toby, thanks for the response. not all of our players like/prefer to use the character sheet.&nbsp; However, the DM wants us to use macros to speed mundane things along.&nbsp; So, the character sheet is really a repository of core data for the character.&nbsp; nothing else.&nbsp; &nbsp;everything we do is with macros. as far as why through chat, well, that's not a hard requirement. basically, I would like to give the players a single button, that would give them options for weapon they are using in the attack, then trigger the attack and damage macro. This should be achievable without a character sheet, just using Attributes, then using either Abilities (character macros) or Macros (collection tab macros).&nbsp; As for a single button with options, that is also doable. Chat Menus and/or Queries can work like that.&nbsp; If you need help setting this up, let me know.&nbsp; Note: I know you are looking for API scripting help, just saying that there are also regular non-scripting options. :) I definitely could use help.&nbsp; all my attempts so far have resulted in failures, which brought me to look for a better way to do things...then I ran into a scriptcards video :) would you prefer I send you a PM?
1684257566
Gauss
Forum Champion
Sure, or if you are on Discord it might be easier to work this out there in a real time discussion. I am on the r/Roll20 Discord server.&nbsp;
1684295168
Senjak
Pro
Sheet Author
David M. said: Try using object modification as described here . Air coding example without testing below. It assumes you have already populated roll variables with the new xy dimensions. You could also optionally replace those variables with direct queries. --!t:@{selected|token_id}|width:[$newWidth] --!t:@{selected|token_id}|height:[$newHeight] I've been reading this over, and I don't think that it will do what I want.&nbsp;&nbsp; I don't want to change the size of the token on the map -- I've got that down with TokenMod.&nbsp; I want to change the size of the token displayed in the chat box at the top of the script. Any suggestion on how to accomplish that?
1684321839
David M.
Pro
API Scripter
Ah, I misunderstood what you meant! Assuming you mean the emote region (above the title portion of your scriptcard output) that prints the selected &amp; target token graphics, I don't believe that is possible. I took a peek at the code for v2.3.6a and it it looks like those graphic sizes are hardcoded to 50px.
Gauss said: Sure, or if you are on Discord it might be easier to work this out there in a real time discussion. I am on the r/Roll20 Discord server.&nbsp; Gauss, is your discord alias the same?
1684373956
Gauss
Forum Champion
gabriel b. said: Gauss said: Sure, or if you are on Discord it might be easier to work this out there in a real time discussion. I am on the r/Roll20 Discord server.&nbsp; Gauss, is your discord alias the same? Yup
1684403636

Edited 1684405607
Kurt J.
Pro
API Scripter
Senjak said: David M. said: Try using object modification as described here . Air coding example without testing below. It assumes you have already populated roll variables with the new xy dimensions. You could also optionally replace those variables with direct queries. --!t:@{selected|token_id}|width:[$newWidth] --!t:@{selected|token_id}|height:[$newHeight] I've been reading this over, and I don't think that it will do what I want.&nbsp;&nbsp; I don't want to change the size of the token on the map -- I've got that down with TokenMod.&nbsp; I want to change the size of the token displayed in the chat box at the top of the script. Any suggestion on how to accomplish that? This will be settable in the next update for ScriptCards. I've already added the new setting to the code, but I need to test it before pushing it to the github This is now live on the 2.3.7 version on GitHub ( <a href="https://github.com/kjaegers/ScriptCards/tree/main/ScriptCards_API" rel="nofollow">https://github.com/kjaegers/ScriptCards/tree/main/ScriptCards_API</a> ). There are two new settings: #emotesourcetokensize #emotetargettokensize both default to 50, but are settable independently. !script {{ --#emotesourcetokensize|150 --#emotetargetokensize|20 --#sourcetoken|@{selected|token_id} --#targettoken|@{target|token_id} --#emotetext|Hello world! }}
Kurt is always quick to respond to the needs of the masses!
I want to take a token’s/sheets ID, store it in an attribute in my MacroMule sheet, then later use it to remotely modify the previously referenced sheet. Namely, use @{MuleBoy|LastToken} value to target a token sheet, and modify an attribute there, then take the currently selected token’s ID and store it in @{MuleBoy|LastToken}, overwriting the previous pointer. How do I use&nbsp; --!a: to modify @{MuleBoy|LastToken} ?
1684667210

Edited 1684677268
Kick
Pro
Hey everyone! I have a problem, and I'm not sure whether I'm misunderstanding or overlooking something as I haven't used Scriptcards a lot yet. What I'm trying to do is organize an uncertain number of dice rolls&nbsp; (Xd3) &nbsp;into an array and then sort that array so that I can subtract these numbers from an incoming attack one at a time through a loop, starting with the lowest rolled values. Example: Sort 2;3;1;3 into 1;2;3;3 and then reduce incoming damage in that order, taking damage each time the defence value is exceeded. I have a good idea of what the looping structure will look like, but sorting the array is causing me some trouble. What I'm currently doing is the following:&nbsp; &nbsp; --~|array;numericsort;[$Defence Roll.RolledDice] My reasoning being that the .RolledDice function already gives me what appears to be a perfectly usable array. However, upon retrieving&nbsp; [$Defence Roll.RolledDice] later in the script, it is not sorted. Is it not possible to sort a .RolledDice array? I've had no luck making my own arrays so far, so I was really hoping this would work.
1684686400

Edited 1684686418
Kurt J.
Pro
API Scripter
Kaspar K. said: I want to take a token’s/sheets ID, store it in an attribute in my MacroMule sheet, then later use it to remotely modify the previously referenced sheet. Namely, use @{MuleBoy|LastToken} value to target a token sheet, and modify an attribute there, then take the currently selected token’s ID and store it in @{MuleBoy|LastToken}, overwriting the previous pointer. How do I use&nbsp; --!a: to modify @{MuleBoy|LastToken} ? So there is some terminology confusion here that will need to be cleared up before I can give you an appropriate answer. Tokens are any graphic on the VTT. They have properties (bar1_value, left, top, etc.), but they don't have attributes. A token may or may not represent a character. A character is an object that has both properties (like inplayerjournals, controlledby, name, etc.) and attributes (anything non-Roll20 related, so the values on a character sheet, etc.) Technically, even that isn't exactly accurate, because all attributes in the game are stored in their own object that just contain a character id to let roll20 know what character owns them, but it is useful to say that characters have attributes). If I'm reading this part correctly:&nbsp; use @{MuleBoy|LastToken} value to target a token sheet, and modify an attribute there , you want to take the token id that is stored in the LastToken attribute of the MuleBoy character, find out if it references a token that represents a character and make some change to an attribute of that character. You then want to put @{target|token_id} into MuleBoy|LastToken. Here is an example, which can be run multiple times and will display the before/after of the LastToken property as well as what the token represents: !script {{ --&amp;LastToken|@{Demo_Mule|LastToken} --+Last Token|[&amp;LastToken] --&amp;LastCharacter|[*[&amp;LastToken]:t-represents] --+Last Token Represents|[*[&amp;LastCharacter]:name] ([&amp;LastCharacter]) --/|You could make modifications to the last character here... --+Updating LastToken to|@{target|token_id} --!a:@{Demo_Mule|character_id}|!LastToken:@{target|token_id} }} The --!a line here breaks down like this: --!a: &lt;-- The modify attribute command @{Demo_Mule|character_id} &lt;-- A mule usually won't have a token on the page, so we use the character ID to specify the mule | &lt;-- Statement/content separator !LastToken: &lt;-- The name of the attribute, followed by a colon. Note the "!" in front, which means to create it if it doesn't exist. @{target|token_id} &lt;-- What we want to store in LastToken
1684687166
Kurt J.
Pro
API Scripter
Kick said: Hey everyone! I have a problem, and I'm not sure whether I'm misunderstanding or overlooking something as I haven't used Scriptcards a lot yet. What I'm trying to do is organize an uncertain number of dice rolls&nbsp; (Xd3) &nbsp;into an array and then sort that array so that I can subtract these numbers from an incoming attack one at a time through a loop, starting with the lowest rolled values. Example: Sort 2;3;1;3 into 1;2;3;3 and then reduce incoming damage in that order, taking damage each time the defence value is exceeded. I have a good idea of what the looping structure will look like, but sorting the array is causing me some trouble. What I'm currently doing is the following:&nbsp; &nbsp; --~|array;numericsort;[$Defence Roll.RolledDice] My reasoning being that the .RolledDice function already gives me what appears to be a perfectly usable array. However, upon retrieving&nbsp; [$Defence Roll.RolledDice] later in the script, it is not sorted. Is it not possible to sort a .RolledDice array? I've had no luck making my own arrays so far, so I was really hoping this would work. [$Defence Roll.RolledDice] isn't actually an array, but an object stored on the Roll variable itself, so the array command can't actually sort it. You can work around this like this: !script {{ --=Roll|6d6 --+Roll|[$Roll.RolledDice] --#parameterdelimiter|, --~|array,define,rollArray,[$Roll.RolledDice] --#parameterdelimiter|; --~|array;numericsort;rollArray --%loop|foreach;rollArray --/|Each dice roll will now be iterated through, and [&amp;loop] will contain the roll value for that die --+Number|[&amp;loop] --%| }} Since the RolledDice list is separated with commas, we change the parameter delimiter to a comma before running the command to define an array. There are other ways to do this, but this is the simplest as far as I know. Whenever I change the parameterdelimiter for any reason, I immediately change it back to ; after that is done. Once we have "rollArray" as a real array, we can numericsort it as expected and loop through it with a foreach. Again, you could do this with other looping structures if desired.
Kurt J. said: [$Defence Roll.RolledDice] isn't actually an array, but an object stored on the Roll variable itself, so the array command can't actually sort it. You can work around this like this: !script {{ --=Roll|6d6 --+Roll|[$Roll.RolledDice] --#parameterdelimiter|, --~|array,define,rollArray,[$Roll.RolledDice] --#parameterdelimiter|; --~|array;numericsort;rollArray --%loop|foreach;rollArray --/|Each dice roll will now be iterated through, and [&amp;loop] will contain the roll value for that die --+Number|[&amp;loop] --%| }} Since the RolledDice list is separated with commas, we change the parameter delimiter to a comma before running the command to define an array. There are other ways to do this, but this is the simplest as far as I know. Whenever I change the parameterdelimiter for any reason, I immediately change it back to ; after that is done. Once we have "rollArray" as a real array, we can numericsort it as expected and loop through it with a foreach. Again, you could do this with other looping structures if desired. Thank you so much! This is perfect for what I wanted to do. I'm glad to know how to do this now!
Kurt J. said: - Thank you. But what is the exact command for modifying the sheet by using it's ID? I tried --!a:@{[*[&amp;LastCharacter]:name]|character_id}|Shock:77 --!a:@{[&amp;LastCharacter]|character_id}|Shock:77 --!a:@{[&amp;LastToken]|token_id}|Shock:77 No luck.
1684747485
Kurt J.
Pro
API Scripter
Kaspar K. said: Kurt J. said: - Thank you. But what is the exact command for modifying the sheet by using it's ID? I tried --!a:@{[*[&amp;LastCharacter]:name]|character_id}|Shock:77 --!a:@{[&amp;LastCharacter]|character_id}|Shock:77 --!a:@{[&amp;LastToken]|token_id}|Shock:77 No luck. You don't want to include the @{} characters. Those tell the chat server to look up what you are intending and substitute it as plain text into the script command, so they never get processed by ScriptCards. Try: --!a:[&amp;LastCharacter]|Shock:77
1685043393

Edited 1685180192
Kick
Pro
Hey there! It's me again. I have an interesting thing happening with this following piece of code: &nbsp; --/This wraps up the defence section of the calculation. &nbsp; --:Defence End| &nbsp; --!t:@{target|1|token_id}|bar1_value:-=[$Damage] &nbsp; --+@{target|1|token_name}| takes [$Damage] damage! &nbsp; --?[*T:t-bar1_value] -le 0|Kill Switch|End Point This correctly triggers, displays the message with the damage taken, and deals the listed damage to the target token. However, when the target token reaches 0 HP, the Kill Switch branch is not reached. It IS reached when the token is targeted while already on 0 HP. I checked to make sure that target|1 and *T: are the same, and this line earlier in the macro should have sorted that out to the best of my understanding: &nbsp; --#targettoken|@{target|1|token_id} It's almost as if the condition check for the HP bar happens before the damage is dealt. After fiddling around with it a bit, I'm not sure how to change this behaviour. EDIT: Turning the kill switch into a subroutine and swapping the order in which damage is dealt and the kill switch is triggered solved the problem for me, though I'm still unsure what went wrong originally.
Hi everyone, We pressed pause on our DD5 game. We just got back to it today, and we have a whole bunch a macro that seem "broken". For a whole bunch of them, we have this message :&nbsp; + &gt; ROLL ID NOT FOUND &lt; In this one, it is the barbarian who is not working anymore.... Here is one of them, for a weapon (a big axe) : !power {{ --tokenid|@{selected|token_id} --target_list|@{target|Cible|token_id} --replaceattrs|T1-|@{target|Cible|character_id} --replaceattrs|ME-|@{selected|character_id} --inlinereplace|AttrMOD|~ME-MSTR$ [FOR] --inlinereplace|WeaponDMG|1d8 --inlinereplace|WeaponMOD|2 --inlinereplace|WeaponType|Tranchants/Magiques/Radiant --inlinereplace|WeaponSUP|0 --inlinereplace|WeaponSUPType|non --inlinereplace|WeaponSoundHit|Axe Hit --inlinereplace|WeaponSoundMiss|Arrow Miss --inlinereplace|WeaponFX|glow-blood --inlinereplace|WeaponGIFCRIT|( <a href="https://media.giphy.com/media/xT9KVow2qtmpLPfH0Y/giphy.gif" rel="nofollow">https://media.giphy.com/media/xT9KVow2qtmpLPfH0Y/giphy.gif</a> ) --emote|**~ME-CN$** balance sa hache dans la tronche de ~T1-CN$ --name|Hache de Mille --leftsub|Action --rightsub|Dist: cac 1m50 --hroll|[[ [$WeaponSupDice] 0d0 + 0 ]][[ [$RAG] ?{Rage ? |Oui, 0d0 + @{selected|Rage_mod} |Non, 0 + 0d0} ]] --!infoArme1|~C**Dés de l'arme:** [! ~WeaponDMG$ + ~WeaponMOD$ !]~C --!infodegat1|~C**Type de Dégats:** [! ~WeaponType$ !]~C --?? $WeaponSupDice == 1 ?? !infoArme2|~C**Dés supp:** [! ~WeaponSUP$ !]~C --?? $WeaponSupDice == 1 ?? !infodegat2|~C**Type de Dégats supp:** [! ~WeaponSUPType$ !]~C --!infotarget|**Cible : ** $$#98111D| ~T1-CN$ $$ --!interligne|~C ★★★★★★★★★★ ~C --!InfoAttack|**Attack : **[#[ [$Atk] ?{Avantage?| Normal, 1d20&nbsp; | Avantage, 2d20kh1&nbsp; | Désadvantage, 2d20kl1 } + ~AttrMOD$ + ~ME-PB$ [PROF] + ~WeaponMOD$ [MOD] ]#] --?? $RAG == 0 ?? skipto*1|AtkNoRag --?? $RAG &lt;&gt; 0 ?? skipto*2|AtkRag --:AtkNoRag| --?? $RAG == 0 AND $Atk.base == 1 ?? !Cmiss1|$$#98111D|**Echec Critique**. $$ --?? $RAG == 0 AND $Atk.base &lt;&gt; 1 AND $Atk.total &lt; ~T1-AC$ ?? !Miss1|$$#98111D|**Echec.**$$ --?? $RAG == 0 AND $Atk.base &gt;= 20 ?? !InfoCrit1|$$#077034|**Coup critique :**$$ [#[ [$CritDmg1] 0d0 + ~WeaponDMG$ [ARME] + ~WeaponDMG$ [ARME] + ~WeaponMOD$ [MOD] + ~AttrMOD$ ]#] --?? $RAG == 0 AND $Atk.total &gt;= ~T1-AC$ AND $Atk.base &lt;&gt; 20 AND $Atk.base &lt;&gt; 1 ?? !InfoDmg1|**Dégâts : **[#[ [$Dmg1] 0d0 + ~WeaponDMG$ [ARME] + ~WeaponMOD$ [MOD] + ~AttrMOD$ ]#] --?? $RAG == 0 AND $Atk.base &gt;= 20 AND $WeaponSupDice == 1 ?? !InfoCrit2|$$#077034|**Dégats Critique de ~WeaponSUPType$: **$$ [#[ [$CritDmg2] 0d0 + ~WeaponSUP$ [SUP] + ~WeaponSUP$ [SUP] ]#] --?? $RAG == 0 AND $Atk.total &gt;= ~T1-AC$ AND $Atk.base &lt;&gt; 20 AND $Atk.base &lt;&gt; 1 AND $WeaponSupDice == 1 ?? !InfoDmg2|**Dégats de ~WeaponSUPType$: ** [#[ [$Dmg2] 0d0 + ~WeaponSUP$ [SUP] ]#] --?? $RAG == 0 AND $Atk.base &gt;= 20 AND $WeaponSupDice == 1 ?? alterbar*1|_target|@{target|Cible|token_id} _bar|1 _amount|-[^CritDmg2] _show|all --?? $RAG == 0 AND $Atk.total &gt;= ~T1-AC$ AND $Atk.base &lt;&gt; 20 AND $Atk.base &lt;&gt; 1 AND $WeaponSupDice == 1 ?? alterbar*2|_target|@{target|Cible|token_id} _bar|1 _amount|-[^Dmg2] _show|all --?? $RAG == 0 AND $Atk.total &gt;= ~T1-AC$ AND $Atk.base &lt;&gt; 20 AND $Atk.base &lt;&gt; 1 ?? alterbar*3|_target|@{target|Cible|token_id} _bar|1 _amount|-[^Dmg1] _show|all --?? $RAG == 0 AND $Atk.base &gt;= 20 ?? alterbar*4|_target|@{target|Cible|token_id} _bar|1 _amount|-[^CritDmg1] _show|all --skipTo*3|VFXcheck --:AtkRag| --?? $RAG &lt;&gt; 0 ?? !Raging|**Dégats de Rage : **&nbsp; [! + [^RAG] !] --?? $RAG &lt;&gt; 0 AND $Atk.base == 1 ?? !CmissR1|$$#98111D|**Echec Critique**. $$ --?? $RAG &lt;&gt; 0 AND $Atk.base &lt;&gt; 1 AND $Atk.total &lt; ~T1-AC$ ?? !MissR1|$$#98111D|**Echec.**$$ --?? $RAG &lt;&gt; 0 AND $Atk.base &gt;= 20 ?? !InfoCritR1|$$#077034|**Coup critique :**$$ [#[ [$CritDmgR1] 0d0 + ~WeaponDMG$ [ARME] + ~WeaponDMG$ [ARME] + ~WeaponMOD$ [MOD] + ~AttrMOD$ + @{selected|Rage_mod} [RAGE] ]#] --?? $RAG &lt;&gt; 0 AND $Atk.total &gt;= ~T1-AC$ AND $Atk.base &lt;&gt; 20 AND $Atk.base &lt;&gt; 1 ?? !InfoDmgR1|**Dégâts :** [#[ [$DmgR1] ~WeaponDMG$ [ARME] + ~WeaponMOD$ [MOD] + ~AttrMOD$ + @{selected|Rage_mod} [RAGE] ]#] --?? $RAG &lt;&gt; 0 AND $Atk.base &gt;= 20 AND $WeaponSupDice == 1 ?? !InfoCritR2|$$#077034|**Dégats Critique de ~WeaponSUPType$: **$$ [#[ [$CritDmgR2] 0d0 + ~WeaponSUP$ [SUP] + ~WeaponSUP$ [SUP] ]#] --?? $RAG &lt;&gt; 0 AND $Atk.total &gt;= ~T1-AC$ AND $Atk.base &lt;&gt; 20 AND $Atk.base &lt;&gt; 1 AND $WeaponSupDice == 1 ?? !InfoDmgR2|**Dégats de ~WeaponSUPType$: ** [#[ [$DmgR2] 0d0 + ~WeaponSUP$ [SUP] ]#] --?? $RAG &lt;&gt; 0 AND $Atk.base &gt;= 20 AND $WeaponSupDice == 1 ?? alterbar*5|_target|@{target|Cible|token_id} _bar|1 _amount|-[^CritDmgR2] _show|all --?? $RAG &lt;&gt; 0 AND $Atk.total &gt;= ~T1-AC$ AND $Atk.base &lt;&gt; 20 AND $Atk.base &lt;&gt; 1 AND $WeaponSupDice == 1 ?? alterbar*6|_target|@{target|Cible|token_id} _bar|1 _amount|-[^DmgR2] _show|all --?? $RAG &lt;&gt; 0 AND $Atk.total &gt;= ~T1-AC$ AND $Atk.base &lt;&gt; 20 AND $Atk.base &lt;&gt; 1 ?? alterbar*7|_target|@{target|Cible|token_id} _bar|1 _amount|-[^DmgR1] _show|all --?? $RAG &lt;&gt; 0 AND $Atk.base &gt;= 20 ?? alterbar*8|_target|@{target|Cible|token_id} _bar|1 _amount|-[^CritDmgR1] _show|all --skipTo*5|EndOfCard --:EndOfCard| --!interligne*2|~C ★★★★★★★★★★ ~C }} If anyone can see what is wrong ? Thank you so much. Sibylline
1685634164

Edited 1685638028
Hi all I am trying to use a variable in a select !scriptcard {{ --#title|Test --#sourceToken|@{selected|token_id} --&amp;Question|Spell Slot Level? --%LoopCounter|1;9;1 --&amp;Question|+|Lvl --&amp;Question|+ [&amp;LoopCounter] --&amp;Question|+ (remaining : --&amp;Question|+ [*S:lvl[&amp;LoopCounter]_slots_expended] --&amp;Question|+) --%| --+|[&amp;Question] --=Choice|?{[&amp;Question]} + 2 --X| The 'Question' var contains the correct string to use (list of slot levels with remaining slots in each) Is there a solution to use this 'Question' var in my select statement ? Thank you :)
1685645241
Andrew R.
Pro
Sheet Author
You can't use a ScriptCard variable in a Roll Query like that because the Roll Query happens before the parser hands the script to ScriptCards.&nbsp; You could use the "--i" command instead.&nbsp;
Andrew R. said: You can't use a ScriptCard variable in a Roll Query like that because the Roll Query happens before the parser hands the script to ScriptCards.&nbsp; You could use the "--i" command instead.&nbsp; Thank you :)
Senjak said: I was looking through the docs but couldn't find a way to increase the size of the token.&nbsp; Is there a way to do that?&nbsp; For reference: The token that shows up at the top with the&nbsp; --#sourceToken|@{selected|token_id} &nbsp;command. Thanks! I actually call a TokenMod Macro to enlarge: &nbsp;&nbsp;&nbsp;&nbsp;!token-mod --set scale|*2 and to reduce, &nbsp;&nbsp;&nbsp;&nbsp;!token-mod --set scale|*.5 You can call token-mod directly from Scriptcards with the --a command I believe.&nbsp;&nbsp;
1685992744
Senjak
Pro
Sheet Author
Kurt J. said: Senjak said: David M. said: Try using object modification as described here . Air coding example without testing below. It assumes you have already populated roll variables with the new xy dimensions. You could also optionally replace those variables with direct queries. --!t:@{selected|token_id}|width:[$newWidth] --!t:@{selected|token_id}|height:[$newHeight] I've been reading this over, and I don't think that it will do what I want.&nbsp;&nbsp; I don't want to change the size of the token on the map -- I've got that down with TokenMod.&nbsp; I want to change the size of the token displayed in the chat box at the top of the script. Any suggestion on how to accomplish that? This will be settable in the next update for ScriptCards. I've already added the new setting to the code, but I need to test it before pushing it to the github This is now live on the 2.3.7 version on GitHub ( <a href="https://github.com/kjaegers/ScriptCards/tree/main/ScriptCards_API" rel="nofollow">https://github.com/kjaegers/ScriptCards/tree/main/ScriptCards_API</a> ). There are two new settings: #emotesourcetokensize #emotetargettokensize both default to 50, but are settable independently. !script {{ --#emotesourcetokensize|150 --#emotetargetokensize|20 --#sourcetoken|@{selected|token_id} --#targettoken|@{target|token_id} --#emotetext|Hello world! }} Thank you!
Hey everyone! I just bumped into an issue with Kurt's Action Button.&nbsp; I had heavily modified it to become just a spell button by taking out all non-spell command lines, and it worked great for a few months.&nbsp; Then I had to take a month long hiatus from my game, and when I got back, the spell button was not working. According to my console log, it starts sorting through their spells, then at some point in the spell list, it crashes the sandbox. It even does it when I try to run the macro with a non-spellcaster with no spells on their list. I have tried updating to the most current version of the script (off of Kurt's GitHub repository) and the most current version of the Action Button macro, but it breaks my sandbox every time I try to use it.&nbsp;&nbsp; I did briefly opt into the new UI toolbar interface. When I opted back out again, I noticed my scripts were not working at all and I had to log out and log back in, then refresh my page a few times before my sandbox would spin up. Any thoughts on why this might be happening?
I found it!&nbsp; Through process of elimination I determined it was a conflict with the Fetch scripty by @timmaugh. I tried rolling it back several versions, but the issue persisted, so I have disabled Fetch until a fix is found.
1686136436
timmaugh
Pro
API Scripter
Hey, CatSwann... can you share the text of the command you are using (with Fetch included), and also the error from the sandbox? I can try to see what might be going on.
Sure thing! It is a modified version of Kurt's Action Button script, so it is big, but here is the command: !script {{ &nbsp;&nbsp; &nbsp; --&amp;hitPointsBar|3 &nbsp; --&amp;spellmulename|Spell_Mule &nbsp; --&amp;UseNamedCharacterSettings|0 &nbsp; --&amp;skipPreppedSpellsCheck|0 &nbsp; --&amp;skipNPCPrepCheck|1 &nbsp; --&amp;trackPCSpellSlots|1 &nbsp; --&amp;showPCSpellSlotList|1 &nbsp; --&amp;sendGmInfo|0 &nbsp; --&amp;AllNPCActionsToSender|0 &nbsp; --&amp;damageApplyScript|token-mod &nbsp; --&amp;whisperDamageButtonsToDM|1 &nbsp; --&amp;whisperDamageButtonResultsToDM|1 &nbsp; --&amp;selfHandleAdvantageMode|0 &nbsp; --&amp;defaultAdvantageMode|0 &nbsp; --&amp;showAdvantageModeText|0 &nbsp; --&amp;requireAmmo|1 &nbsp; --&amp;showGlobalModifierButtons|0 &nbsp; --&amp;showPCSkillsAndSaves|0 &nbsp; --&amp;showNPCSkillsAndSaves|0 &nbsp; --&amp;showPCStandardActions|1 &nbsp; --&amp;showNPCStandardActions|1 &nbsp; --&amp;compactGlobalModDisplay|1 &nbsp; --&amp;defaultButtonPadding|4px &nbsp; --&amp;smallButtonPadding|2px &nbsp; --&amp;bodyFontSize|12 &nbsp; --&amp;smallFontSize|10 &nbsp; --&amp;showCharacterSummary|1 &nbsp; --&amp;EnablePerCharacterConfiguration|1 &nbsp; --&amp;UseResistances|1 &nbsp; --&amp;ConcentrationMarkerName| &nbsp; --&amp;DetectPlayersToken|0 &nbsp; --&amp;ShowRestButtons|0 &nbsp; --&amp;Template|none &nbsp; --&amp;DisplayButtonsForAMAbilities|0 &nbsp; --~|array;define;SpellsToKeepWithSuffix; &nbsp; --~|array;define;SpellsToKeepNoSuffix; &nbsp; --/|End Settings Area &nbsp; --?"[@SC_SelectedTokens()]" -eq "undefined array" -and [&amp;DetectPlayersToken] -ne 1|REPORT_NEED_SELECTED_TOKEN &nbsp; --?"[@SC_SelectedTokens()]" -ne "undefined array" -and "X[@SC_SelectedTokens()]" -eq "X1"|BEGIN_WITH_SC_SELECTED_TOKENS &nbsp; --?"[@SC_SelectedTokens()]" -gt 1|REPORT_MULTIPLE_SELECTED_TOKEN &nbsp; --?[&amp;DetectPlayersToken] -ne 1 -and "X[@SC_SelectedTokens()]" -ne "X1"|REPORT_NEED_SELECTED_TOKEN &nbsp; --?[&amp;DetectPlayersToken] -ne 1 -and "X[@SC_SelectedTokens()]" -eq "X1"|BEGIN_WITH_SC_SELECTED_TOKENS &nbsp; --?[&amp;SendingPlayerIsGM] -eq 1 -and "X[@SC_SelectedTokens()]" -ne "X1"|REPORT_NEED_SELECTED_TOKEN &nbsp; --&gt;GET_CONTROLLED_TOKENS_FROM_PAGETOKENS|saveTokenID &nbsp; --?"X[&amp;saveTokenID]" -eq "X"|REPORT_NO_TOKENS_ON_PAGE &nbsp; --?"[&amp;saveTokenID]" -inc ","|REPORT_MULTIPLE_POSSIBLE_TOKENS &nbsp; --^SKIP_SELECTED_TOKENS| &nbsp; --:BEGIN_WITH_SC_SELECTED_TOKENS| &nbsp; --&amp;saveTokenID|[@SC_SelectedTokens(0)] &nbsp; --:SKIP_SELECTED_TOKENS| &nbsp; --#reentrant|CharacterAction [&amp;saveTokenID] &nbsp; --&amp;QB|? --&amp;QB|+{ --&amp;QE|} &nbsp; --&amp;AB|@ --&amp;AB|+{ &nbsp; --&amp;TB|&amp; --&amp;TB|+# --&amp;TB|+64 --&amp;TB|+; --&amp;TB|+{ &nbsp; --&amp;BED|&amp; --&amp;BED|+# --&amp;BED|+128719; &nbsp; --&amp;CLOCK|&amp; --&amp;CLOCK|+# --&amp;CLOCK|+128336; &nbsp; --&amp;SPACE|X X --&amp;SPACE|[&amp;SPACE(1,1)] &nbsp;&nbsp; &nbsp; --#bodyfontface|Helvetica &nbsp; --#oddrowfontcolor|#382f18 &nbsp; --#evenrowfontcolor|#382f18 &nbsp; --#bodyfontsize|[&amp;bodyFontSize]px &nbsp; --#buttonfontsize|10px &nbsp; --#buttonbackground|#0417c4 &nbsp; --#buttonfontface|Tahoma &nbsp; --#titlecardbackgroundcolor|#0417c4 &nbsp; --#titlefontcolor|#ffffff &nbsp; --#titlefontsize|1.5em &nbsp; --#titlefontshadow|1 &nbsp; --#oddrowbackground|#fce19a &nbsp; --#evenrowbackground|#fce19a &nbsp; --#subtitlefontcolor|#fcdb86 &nbsp; --#tablebgcolor|#fcdb86 &nbsp; --#lineheight|10pt &nbsp; --#buttonpadding|[&amp;defaultButtonPadding] &nbsp; --#overridetemplate|[&amp;Template] &nbsp; --#whisper|self &nbsp; --#sourcetoken|[&amp;saveTokenID] &nbsp; --lsettings|[*S:character_name] &nbsp; --]| &nbsp; --&amp;damageRoutine|DontApplyDamage &nbsp; --?[&amp;damageApplyScript] -eq "scriptcards"|&amp;damageRoutine;ApplyDamageScriptCards &nbsp; --?[&amp;damageApplyScript] -eq "token-mod"|&amp;damageRoutine;ApplyDamageTokenmod &nbsp; --?[&amp;damageApplyScript] -eq "alterbars"|&amp;damageRoutine;ApplyDamageAlterbars &nbsp; --?[&amp;damageApplyScript] -eq "damagebuttons"|&amp;damageRoutine;SHOW_DAMAGE_BUTTONS &nbsp; --#emotestate|visible &nbsp; --#emoteFont|Helvetica &nbsp; --#emoteFontColor|#ffffff &nbsp; --#emoteFontSize|11px &nbsp; --#emoteFontWeight|bold &nbsp; --#emoteBackground|#0417c4 &nbsp; --#emoteText|[*S:character_name] [*S:castquote] &nbsp; --#title|[*S:character_name] &nbsp; --:AFTER_ADVMODE_CHANGE| &nbsp; --#leftsub|Spell Menu &nbsp; --?[&amp;EnablePerCharacterConfiguration] -eq 0|SKIP_PER_CHAR_SETTINGS &nbsp; --#leftsub|Action Menu [rbutton]&amp;#x2699;::DISPLAY_CHARACTER_CONFIG_MENU[/rbutton] &nbsp; --&gt;LOAD_PER_CHARACTER_CONFIG_OPTIONS|[*S:character_id] &nbsp; --:SKIP_PER_CHAR_SETTINGS| &nbsp; --?[*S:npc] -eq 1 -or [&amp;ShowRestButtons] -ne 1|SKIP_REST_BUTTONS &nbsp; --?"[&amp;perCharacterOptions]" -inc "$SHRB0$"|SKIP_REST_BUTTONS &nbsp; --#rightsub|Rest: [rbutton][&amp;CLOCK]::DO_SHORT_REST[/rbutton][rbutton][&amp;BED]::DO_LONG_REST[/rbutton] &nbsp; --:SKIP_REST_BUTTONS| &nbsp; --/|Determine if the selected character is a PC or NPC and process appropriately &nbsp; --?[*S:npc] -eq 1|proc_npc|proc_pc &nbsp; --/|Handle action menu creation for PCs &nbsp; --:proc_pc| &nbsp; --/+|[hr #58180d] &nbsp; --+|&nbsp; &nbsp; --#whisper|self &nbsp; --&gt;BuildCharacterSummary|[*S:character_id];CharSummaryText;ac &nbsp; --?[&amp;showCharacterSummary] -ne 1 -or "[&amp;perCharacterOptions]" -inc "$SCS0$" |SKIP_PC_SUMMARY &nbsp; --+|[c][F[&amp;smallFontSize]][&amp;CharSummaryText][/F][/c] &nbsp; --:SKIP_PC_SUMMARY| &nbsp; --+|[br] &nbsp; --+|[t border=0 width=90%] [tr][td][b] &amp;nbsp;&amp;nbsp; Save DC:[/b]&nbsp; &nbsp; &nbsp;[*S:spell_save_dc] [/td][td][r] [b]Attack Bonus:[/b]&nbsp; &nbsp;+[*S:spell_attack_bonus][/r][/td][/tr][/t][br] &nbsp; --+|[t border=0 width=90%] [tr][td][b]&amp;nbsp;&amp;nbsp;&amp;nbsp;[*S:class_resource_name]:[/b][/td][td][r][*S:class_resource][/r][/td][/tr] &nbsp; --+|[br] &nbsp; --/+|[hr #58180d] &nbsp; --?[&amp;trackPCSpellSlots] -eq 1|[ &nbsp; &nbsp; --&gt;GET_HIGHEST_LEVEL_SPELL_SLOT|HighestSlot &nbsp; &nbsp; --&amp;spellSlotInfo1|[t align=center width=100% border=0][tr][td][b]Level[/b][/td] &nbsp; &nbsp; --&amp;spellSlotInfo2|[/tr][tr][td][b]Slots[/b][/td] &nbsp; &nbsp; --&amp;anySpell|0 &nbsp; &nbsp; --%levelCounter|1;9 &nbsp; &nbsp; &nbsp; --&gt;GET_AVAILABLE_SPELL_SLOTS|[&amp;levelCounter];slotCount &nbsp; &nbsp; &nbsp; --/?[*S:lvl[&amp;levelCounter]_slots_total] -gt 0|&amp;spellSlotInfo;+L[&amp;levelCounter]([&amp;slotCount])&nbsp; &nbsp; &nbsp; &nbsp; --?[*S:lvl[&amp;levelCounter]_slots_total] -gt 0|&amp;spellSlotInfo1;+[td align=center][b][i][&amp;levelCounter][/i][/b][/td]&nbsp; &nbsp; &nbsp; &nbsp; --?[*S:lvl[&amp;levelCounter]_slots_total] -gt 0|&amp;spellSlotInfo2;+[td align=center][&amp;slotCount][/td]&nbsp; &nbsp; &nbsp; &nbsp; --?[*S:lvl[&amp;levelCounter]_slots_total] -gt 0|&amp;anySpell;1&nbsp; &nbsp; &nbsp; --%| &nbsp; &nbsp; --?[&amp;anySpell] -eq 0|SKIP_SLOT_DISPLAY &nbsp; &nbsp; --?[&amp;showPCSpellSlotList] -eq 0|SKIP_SLOT_DISPLAY &nbsp; &nbsp; --+|[c][b]Available Spell Slots[/b][/c][&amp;spellSlotInfo1][&amp;spellSlotInfo2][/tr][/t] &nbsp; &nbsp; --+|[br] &nbsp; &nbsp; --+|[hr #58180d]&nbsp;&nbsp; &nbsp; &nbsp; --:SKIP_SLOT_DISPLAY| &nbsp; --]| &nbsp;--/|The PC's cantrips &nbsp; --Rfirst|[*S:character_id];repeating_spell-cantrip &nbsp; --&amp;PCCantrips|[br] &nbsp; --?"[*R:spellname]" -ne "NoRepeatingAttributeLoaded"|[ &nbsp; &nbsp; --:PCCantrips_Display| &nbsp; &nbsp; &nbsp; --~testName|string;replaceall; ;-;[*R:spellname] &nbsp; &nbsp; &nbsp; --~testMule|system;findability;[&amp;spellmulename];[&amp;testName] &nbsp; &nbsp; &nbsp; --?[&amp;testMule] -ne "AbilityNotFound"|MULE_CANTRIP &nbsp; &nbsp; &nbsp; --?"[*R:spelloutput]" -eq ATTACK|CANTRIP_GENERATE_WITH_TARGET &nbsp; &nbsp; &nbsp; --&amp;PCCantrips|+[rbutton][*R:spellname]::EXEC_PC_CANTRIP;[*R:spellname]|NONE[/rbutton][&amp;SPACE] &nbsp; &nbsp; &nbsp; --^CANTRIP_END_GENERATE| &nbsp; &nbsp; &nbsp; --:CANTRIP_GENERATE_WITH_TARGET| &nbsp; &nbsp; &nbsp; --&amp;PCCantrips|+[rbutton][*R:spellname]::EXEC_PC_CANTRIP;[*R:spellname]|[&amp;TB]target|token_id}[/rbutton][&amp;SPACE] &nbsp; &nbsp; &nbsp; --^CANTRIP_END_GENERATE| &nbsp; &nbsp; &nbsp; --:MULE_CANTRIP| &nbsp; &nbsp; &nbsp; --&amp;PCCantrips|+[button][*R:spellname]::~[&amp;spellmulename]|[&amp;testName][/button][&amp;SPACE] &nbsp; &nbsp; &nbsp; --:CANTRIP_END_GENERATE| &nbsp; &nbsp; &nbsp; --Rnext| &nbsp; &nbsp; &nbsp; --?"[*R:spellname]" -ne "NoRepeatingAttributeLoaded"|PCCantrips_Display &nbsp; &nbsp; &nbsp; --+[c]Cantrips[/c]|[c][&amp;PCCantrips][/c] &nbsp; &nbsp; &nbsp; --+|[br] &nbsp; &nbsp; &nbsp; --+|[hr #58180d]&nbsp;&nbsp; &nbsp; --]| &nbsp; --+| &nbsp; --/|The PC's level 1 thru 9 spells &nbsp; --&amp;HighestSlot|9 &nbsp; &nbsp; --%levelCounter|1;9 &nbsp; &nbsp; --Rfirst|[*S:character_id];repeating_spell-[&amp;levelCounter] &nbsp; &nbsp; --&amp;PCSpells|[br] &nbsp; &nbsp; --&amp;slotString| &nbsp; &nbsp; --&amp;slotString||&amp;# &nbsp; &nbsp; --&amp;slotString|+63;{Slot Level| &nbsp; &nbsp; --%slotcounter|[&amp;levelCounter];[&amp;HighestSlot] &nbsp; &nbsp; &nbsp; --?[&amp;trackPCSpellSlots] -eq 0|SKIP_THIS_SLOT_CHECK &nbsp; &nbsp; &nbsp; --&gt;GET_AVAILABLE_SPELL_SLOTS|[&amp;slotcounter];hasSlots &nbsp; &nbsp; &nbsp; --?[&amp;hasSlots] -eq 0|SKIP_THIS_SLOT_STRING &nbsp; &nbsp; &nbsp; --:SKIP_THIS_SLOT_CHECK| &nbsp; &nbsp; &nbsp; --&amp;slotString|+[&amp;slotcounter] &nbsp; &nbsp; &nbsp; --?[&amp;slotcounter] -eq [&amp;HighestSlot]|SKIP_THIS_SLOT_STRING &nbsp; &nbsp; &nbsp; --&amp;slotString|+| &nbsp; &nbsp; &nbsp; --:SKIP_THIS_SLOT_STRING| &nbsp; &nbsp; --%| &nbsp; &nbsp; --?[&amp;levelCounter] -lt 9|DONE_SLOT_STRING &nbsp; &nbsp; --&amp;slotString||9 &nbsp; &nbsp; --:DONE_SLOT_STRING| &nbsp; &nbsp; --&amp;slotString|+} &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; --=PCSpellCount|0 &nbsp; &nbsp; --?"[*R:spellname]" -ne "NoRepeatingAttributeLoaded"|[ &nbsp; &nbsp; &nbsp; --:PCSpells_Display| &nbsp; &nbsp; &nbsp; --?[&amp;skipPreppedSpellsCheck] -eq 1|SKIP_PREP_CHECK &nbsp; &nbsp; &nbsp; --?[*S:class] -eq "Sorcerer"|SKIP_PREP_CHECK &nbsp; &nbsp; &nbsp; --?[*S:class] -eq "Warlock"|SKIP_PREP_CHECK &nbsp; &nbsp; &nbsp; --?"X[*S:multiclass1_flag]" -eq "X1" -and [*S:multiclass1] -eq "Sorcerer"|SKIP_PREP_CHECK &nbsp; &nbsp; &nbsp; --?"X[*S:multiclass2_flag]" -eq "X1" -and [*S:multiclass2] -eq "Sorcerer"|SKIP_PREP_CHECK &nbsp; &nbsp; &nbsp; --?"X[*S:multiclass3_flag]" -eq "X1" -and [*S:multiclass3] -eq "Sorcerer"|SKIP_PREP_CHECK &nbsp; &nbsp; &nbsp; --?"X[*S:multiclass1_flag]" -eq "X1" -and [*S:multiclass1] -eq "Warlock"|SKIP_PREP_CHECK &nbsp; &nbsp; &nbsp; --?"X[*S:multiclass2_flag]" -eq "X1" -and [*S:multiclass2] -eq "Warlock"|SKIP_PREP_CHECK &nbsp; &nbsp; &nbsp; --?"X[*S:multiclass3_flag]" -eq "X1" -and [*S:multiclass3] -eq "Warlock"|SKIP_PREP_CHECK&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; --&amp;isWizard|0 &nbsp; &nbsp; &nbsp; --?[*S:class] -eq "Wizard"|&amp;isWizard;1 &nbsp; &nbsp; &nbsp; --?"X[*S:multiclass1_flag]" -eq "X1" -and [*S:multiclass1] -eq "Wizard"|&amp;isWizard;1 &nbsp; &nbsp; &nbsp; --?"X[*S:multiclass2_flag]" -eq "X1" -and [*S:multiclass2] -eq "Wizard"|&amp;isWizard;1 &nbsp; &nbsp; &nbsp; --?"X[*S:multiclass3_flag]" -eq "X1" -and [*S:multiclass3] -eq "Wizard"|&amp;isWizard;1 &nbsp; &nbsp; &nbsp; --?[&amp;isWizard] -eq 0 -and "X[*R:spellprepared]" -ne "X1"|DONE_SPELL_BUTTON &nbsp; &nbsp; &nbsp; --?"X[*R:spellprepared]" -ne "X1" -and "X[*R:spellritual]" -ne "XYes"|DONE_SPELL_BUTTON &nbsp; &nbsp; &nbsp; --&amp;spellsuffix| &nbsp; &nbsp; &nbsp; --?"X[*R:spellritual]" -eq "XYes"|&amp;spellsuffix; [R] &nbsp; &nbsp; &nbsp; --:SKIP_PREP_CHECK| &nbsp; &nbsp; &nbsp; --?[&amp;trackPCSpellSlots] -eq 0|SKIP_FREE_SLOTS_CHECK &nbsp; &nbsp; &nbsp; --?[&amp;HighestSlot] -lt [&amp;levelCounter]|DONE_SPELL_BUTTON &nbsp; &nbsp; &nbsp; --:SKIP_FREE_SLOTS_CHECK|&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; --~testName|string;replaceall; ;-;[*R:spellname] &nbsp; &nbsp; &nbsp; --~testMule|system;findability;[&amp;spellmulename];[&amp;testName] &nbsp; &nbsp; &nbsp; --?[&amp;testMule] -ne "AbilityNotFound"|MULE_SPELL &nbsp; &nbsp; &nbsp; --&amp;PCSpells|+[rbutton][*R:spellname][&amp;spellsuffix]::EXEC_PC_SPELL;[&amp;levelCounter]|[*R:spellname]|[&amp;TB]target|token_id}[&amp;slotString][/rbutton][&amp;SPACE] &nbsp; &nbsp; &nbsp; --=PCSpellCount|[$PCSpellCount.Raw] + 1&nbsp; &nbsp; &nbsp; &nbsp; --^DONE_SPELL_BUTTON| &nbsp; &nbsp; &nbsp; --:MULE_SPELL| &nbsp; &nbsp; &nbsp; --&amp;PCSpells|+[button][*R:spellname][&amp;spellsuffix]::~[&amp;spellmulename]|[&amp;testName][/button][&amp;SPACE] &nbsp; &nbsp; &nbsp; --=PCSpellCount|[$PCSpellCount.Raw] + 1&nbsp; &nbsp; &nbsp; &nbsp; --:DONE_SPELL_BUTTON| &nbsp; &nbsp; &nbsp; --Rnext| &nbsp; &nbsp; &nbsp; --?"[*R:spellname]" -ne "NoRepeatingAttributeLoaded"|PCSpells_Display &nbsp; &nbsp; &nbsp; --?[$PCSpellCount] -eq 0|PC_SKIP_LEVEL_DISPLAY &nbsp; &nbsp; &nbsp; --+[c]Level [&amp;levelCounter] Spells[/c]|[c][&amp;PCSpells][/c] &nbsp; &nbsp; &nbsp; --+|[br] &nbsp; &nbsp; &nbsp; --+|[hr #58180d]&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; --:PC_SKIP_LEVEL_DISPLAY| &nbsp; &nbsp; &nbsp;--]| &nbsp; --%| &nbsp; --?[&amp;DisplayButtonsForAMAbilities] -eq 1|&gt;DISPLAY_ACTIONMENU_CHARACTER_ABILITIES;[*S:character_id] &nbsp; --#buttonpadding|[&amp;smallButtonPadding] &nbsp; --X| &nbsp; --/|Reentrant points for PC actions &nbsp; --:EXEC_PC_CANTRIP| &nbsp; --/+|[hr #58180d] &nbsp; --?[*S:npc] -eq 1 -and [&amp;AllNPCActionsToSender]||[ &nbsp; --#whisper|self &nbsp; --]|[ &nbsp; --#whisper| &nbsp; --]| &nbsp; --~cantrip_name|string;before;|;[&amp;reentryval] &nbsp; --~cantrip_target|string;after;|;[&amp;reentryval] &nbsp; --#whisper| &nbsp; --#emotestate|visible &nbsp; --#targettoken|[&amp;cantrip_target] &nbsp; --#emotetext|[*S:t-name] uses [&amp;cantrip_name] against [*T:t-name] &nbsp; --&gt;Find_Active_Global_Attack_Modifiers|[*S:character_id];PC_GAM &nbsp; --&gt;Find_Active_Global_Damage_Modifiers|[*S:character_id];PC_GDM &nbsp; --&gt;Find_Active_Global_Damage_Modifiers|[*S:character_id];PC_GDM_CRIT;1 &nbsp; --&gt;Find_Active_Global_Save_Modifiers|[$cantrip_target];TARGET_GSM &nbsp; --Rfind|[*S:character_id];[&amp;cantrip_name];repeating_spell-cantrip;spellname &nbsp; --?"[*R:spelloutput]" -eq ATTACK|PC_ATTACK_CANTRIP|PC_CARD_CANTRIP &nbsp; --=cantrip_crit|0 &nbsp; --:PC_ATTACK_CANTRIP| &nbsp; --?"X[*R:spellattack]" -eq "XRanged" -or "X[*R:spellattack]" -eq "XMelee"|CANTRIP_ATTACK_ROLL|CANTRIP_DONE_ATTACK_ROLL &nbsp; --:CANTRIP_ATTACK_ROLL| &nbsp; --&amp;rollType|1d20 &nbsp; --?"[*S:advantagetoggle]" -inc advantage|&amp;rollType;2d20kh1 &nbsp; --?"[*S:advantagetoggle]" -inc disadvantage|&amp;rollType;2d20kl1 &nbsp; --?[&amp;selfHandleAdvantageMode] -eq 1 -and [&amp;currentAdvantageMode] -eq 0|&amp;rollType;1d20 &nbsp; --?[&amp;selfHandleAdvantageMode] -eq 1 -and [&amp;currentAdvantageMode] -eq 1|&amp;rollType;2d20kh1 &nbsp; --?[&amp;selfHandleAdvantageMode] -eq 1 -and [&amp;currentAdvantageMode] -eq 2|&amp;rollType;2d20kl1&nbsp;&nbsp; &nbsp; --=attackRoll|[&amp;rollType] + [*S:spell_attack_bonus] [Spell Atk Bonus] [&amp;PC_GAM] &nbsp; --=AC|[*T:ac] &nbsp; --?"X[*T:npc_ac]" -ne "X"|=AC;[*T:npc_ac] &nbsp; --?[&amp;sendGmInfo] -eq 1|[ &nbsp; &nbsp; --+[*R:spellattack] Attack|rolled [$attackRoll] vs the target's AC[br][br] &nbsp; &nbsp; --*[*R:spellattack] Attack|rolled [$attackRoll] vs AC [b][$AC.Raw][/b] &nbsp; --]|[ &nbsp; &nbsp; --+[*R:spellattack] Attack|rolled [$attackRoll] vs AC [b][$AC.Raw][/b][br][br] &nbsp; --]| &nbsp; --?[$attackRoll.Base] -ge 20|=cantrip_crit;1|=cantrip_crit;0 &nbsp; --?[$attackRoll.Total] -lt [$AC]|CANTRIP_ATTACK_MISS &nbsp; --?[$attackRoll.Base] -eq 1|CANTRIP_ATTACK_MISS &nbsp; --:CANTRIP_DONE_ATTACK_ROLL| &nbsp; --&amp;damageRoll|[*R:spelldamage] &nbsp; --?[*S:level] -ge 5|&amp;damageRoll;+ + [*R:spelldamage] &nbsp; --?[*S:level] -ge 11|&amp;damageRoll;+ + [*R:spelldamage] &nbsp; --?[*S:level] -ge 17|&amp;damageRoll;+ + [*R:spelldamage] &nbsp; --?[$cantrip_crit] -eq 1|&amp;damageRoll;+ + [&amp;damageRoll] &nbsp; --?[$cantrip_crit] -eq 1|&amp;damageRoll;+ [&amp;PC_GDM_CRIT]|&amp;damageRoll;+ [&amp;PC_GDM] &nbsp; --&amp;dmgModType1| &nbsp; --?"X[*T:npc]" -ne "X1" -or [&amp;UseResistances] -eq 0|SKIP_PC_CANTRIP_RESIST &nbsp; --&gt;CheckDamageModifiersNPC|[*T:character_id];dmgModType1;[*R:spelldamagetype];1;0;0 &nbsp; --:SKIP_PC_CANTRIP_RESIST| &nbsp; --=cantripDamage|[&amp;damageRoll] [&amp;dmgModType1] &nbsp; --?"X[*R:spellsave]" -ne "X"|CANTRIP_SAVE|CANTRIP_NO_SAVE &nbsp; --:CANTRIP_NO_SAVE| &nbsp; --?[$cantrip_crit] -eq 1|&amp;hittag;Critical Hit!|&amp;hittag;Hit! &nbsp; --?[$cantrip_crit] -eq 1|&amp;hitdesc;critically hits|&amp;hitdesc;hits &nbsp; --+[&amp;hittag]|The [*R:spellname] [&amp;hitdesc] and deals [$cantripDamage] [*R:spelldamagetype] damage.[br][br] &nbsp; --&gt;[&amp;damageRoutine]|[&amp;cantrip_target];[&amp;hitPointsBar];-[$cantripDamage.Raw] &nbsp; --^PC_CARD_CANTRIP| &nbsp; --:CANTRIP_SAVE| &nbsp; --+|The target needs to make a DC [*S:spell_save_dc] [*R:spellsave] saving throw or take [$cantripDamage] [*R:spelldamagetype] damage.[br][br] &nbsp; --/&amp;output|The [b][i][*R:spellname][/i][/b] deals [$cantripDamage] [*R:spelldamagetype] damage.&nbsp; &nbsp; --/?"X[*R:spellsave]" -ne "X"|&amp;output;+ The target can make a [*R:spellsave] save vs DC [*S:spell_save_dc] to negate the damage. &nbsp; --^PC_CARD_CANTRIP| &nbsp; --:CANTRIP_ATTACK_MISS| &nbsp; --+The [*R:spellname] attack missed!|[br][br] &nbsp; --:PC_CARD_CANTRIP| &nbsp; --#title|[&amp;cantrip_name] &nbsp; --#leftsub|[*S:character_name] &nbsp; --#rightsub| &nbsp; --+|[*R:spelldescription] &nbsp; --:PC_DONE_CANTRIP| &nbsp; --X| &nbsp; --:EXEC_PC_SPELL|spellInfo1=Spell Level, 2=SpellName, 3=Target ID, 4=Slot Level &nbsp; --/+|[hr #58180d] &nbsp; --?[*S:npc] -eq 1 -and [&amp;AllNPCActionsToSender]||[ &nbsp; --#whisper|self &nbsp; --]|[ &nbsp; --#whisper| &nbsp; --]| &nbsp; --~spellInfo|string;split;|;[&amp;reentryval] &nbsp; --=UpCast|[&amp;spellInfo4] - [&amp;spellInfo1] &nbsp; --?[&amp;trackPCSpellSlots] -eq 0|SKIP_CASTING_SLOT_CHECK &nbsp; --&gt;GET_AVAILABLE_SPELL_SLOTS|[&amp;spellInfo4];castSlotAvailable &nbsp; --?[&amp;castSlotAvailable] -eq 0|NO_SLOTS_AVAILABLE &nbsp; --&gt;DEDUCT_SPELL_SLOT|[&amp;spellInfo4] &nbsp; --^SKIP_CASTING_SLOT_CHECK| &nbsp; --:NO_SLOTS_AVAILABLE| &nbsp; --#whisper|self &nbsp; --+|You do not have a level [$spellInfo4] spell slot available to cast [&amp;spellInfo2] &nbsp; --^PC_DONE_SPELL| &nbsp; --:SKIP_CASTING_SLOT_CHECK| &nbsp; --&amp;action_target|[&amp;spellInfo3] &nbsp; --#title|[&amp;spellInfo2] &nbsp; --#leftsub|[*S:character_name] &nbsp; --#rightsub| &nbsp; --#whisper| &nbsp; --#emotestate|visible &nbsp; --#targettoken|[&amp;action_target] &nbsp; --#emotetext|[*S:t-name] uses [&amp;spellInfo2] against [*T:t-name] &nbsp; --&gt;Find_Active_Global_Attack_Modifiers|[*S:character_id];PC_GAM &nbsp; --&gt;Find_Active_Global_Damage_Modifiers|[*S:character_id];PC_GDM &nbsp; --&gt;Find_Active_Global_Damage_Modifiers|[*S:character_id];PC_GDM_CRIT;1 &nbsp; --&gt;Find_Active_Global_Save_Modifiers|[$cantrip_target];TARGET_GSM &nbsp; --Rfind|[*S:character_id];[&amp;spellInfo2];repeating_spell-[&amp;spellInfo1];spellname &nbsp; --#targettoken|[&amp;spellInfo3] &nbsp; --?"[*R:spellconcentration]" -inc "concentration=1" -and [&amp;ConcentrationMarkerName]" -ne "0"|&gt;ADD_STATUS_MARKER;[&amp;saveTokenID];[&amp;ConcentrationMarkerName] &nbsp; --?"[*R:spelloutput]" -eq ATTACK|PC_ATTACK_SPELL|PC_CARD_SPELL &nbsp; --:PC_ATTACK_SPELL| &nbsp; --&amp;spell_crit|0 &nbsp; --?"X[*R:spellattack]" -eq "XRanged" -or "X[*R:spellattack]" -eq "XMelee"|SPELL_ATTACK_ROLL|SPELL_DONE_ATTACK_ROLL &nbsp; --:SPELL_ATTACK_ROLL| &nbsp; --&amp;rollType|1d20 &nbsp; --?"[*S:advantagetoggle]" -inc advantage|&amp;rollType;2d20kh1 &nbsp; --?"[*S:advantagetoggle]" -inc disadvantage|&amp;rollType;2d20kl1 &nbsp; --?[&amp;selfHandleAdvantageMode] -eq 1 -and [&amp;currentAdvantageMode] -eq 0|&amp;rollType;1d20 &nbsp; --?[&amp;selfHandleAdvantageMode] -eq 1 -and [&amp;currentAdvantageMode] -eq 1|&amp;rollType;2d20kh1 &nbsp; --?[&amp;selfHandleAdvantageMode] -eq 1 -and [&amp;currentAdvantageMode] -eq 2|&amp;rollType;2d20kl1&nbsp;&nbsp; &nbsp; --=attackRoll|[&amp;rollType] + [*S:spell_attack_bonus] [Spell Atk Bonus] [&amp;PC_GAM] &nbsp; --=AC|[*T:ac] &nbsp; --?"X[*T:npc_ac]" -ne "X"|=AC;[*T:npc_ac] &nbsp; &nbsp; --?[&amp;sendGmInfo] -eq 1|[ &nbsp; &nbsp; --+[*R:spellattack] Attack|rolled [$attackRoll] vs the target's AC[br][br] &nbsp; &nbsp; --*[*R:spellattack] Attack|rolled [$attackRoll] vs AC [b][$AC.Raw][/b] &nbsp; --]|[ &nbsp; &nbsp; --+[*R:spellattack] Attack|rolled [$attackRoll] vs AC [b][$AC.Raw][/b][br][br] &nbsp; --]| &nbsp; --?[$attackRoll.Base] -ge 20|=spell_crit;1|=spell_crit;0 &nbsp; --?[$attackRoll.Total] -lt [$AC]|SPELL_ATTACK_MISS &nbsp; --:SPELL_DONE_ATTACK_ROLL| &nbsp; --?"X[*T:npc]" -ne "X1" -or [&amp;UseResistances] -eq 0|SKIP_PC_SPELL_RESIST &nbsp; --&amp;dmgModType1| &nbsp; --&amp;dmgModType2| &nbsp; --&gt;CheckDamageModifiersNPC|[*T:character_id];dmgModType1;[*R:spelldamagetype];1;0;0 &nbsp; --&gt;CheckDamageModifiersNPC|[*T:character_id];dmgModType2;[*R:spelldamagetype2];1;0;0 &nbsp; --:SKIP_PC_SPELL_RESIST| &nbsp;&nbsp; &nbsp; --&amp;damageRoll|[*R:spelldamage] &nbsp; --?[$spell_crit] -eq 1|&amp;damageRoll;+ [&amp;PC_GDM_CRIT]|&amp;damageRoll;+ [&amp;PC_GDM] &nbsp; --&amp;damageRoll2|[*R:spelldamage2] &nbsp; --&amp;ability_bonus| &nbsp; &nbsp; --?"X[*R:spell_ability]" -eq "Xspell"|[ &nbsp; &nbsp; &nbsp; --~ability|string;before;};[*S:spellcasting_ability] &nbsp; &nbsp; &nbsp; --~ability|string;after;{;[&amp;ability] &nbsp; &nbsp; &nbsp; --?[&amp;ability] -eq strength_mod|&amp;ability_bonus; + [*S:strength_mod] [Spellcasting Ability] &nbsp; &nbsp; &nbsp; --?[&amp;ability] -eq dexterity_mod|&amp;ability_bonus; + [*S:dexterity_mod] [Spellcasting Ability] &nbsp; &nbsp; &nbsp; --?[&amp;ability] -eq constitution_mod|&amp;ability_bonus; + [*S:constitution_mod] [Spellcasting Ability] &nbsp; &nbsp; &nbsp; --?[&amp;ability] -eq intelligence_mod|&amp;ability_bonus; + [*S:intelligence_mod] [Spellcasting Ability] &nbsp; &nbsp; &nbsp; --?[&amp;ability] -eq wisdom_mod|&amp;ability_bonus; + [*S:wisdom_mod] [Spellcasting Ability] &nbsp; &nbsp; &nbsp; --?[&amp;ability] -eq charisma_mod|&amp;ability_bonus; + [*S:charisma_mod] [Spellcasting Ability] &nbsp; --]| &nbsp; --&amp;spell_heal|0 &nbsp; --?"X[*R:spellhealing]" -ne "X"|&amp;spell_heal;1 &nbsp; --?"X[*R:spellhealing]" -ne "X"|&amp;damageRoll;[*R:spellhealing] &nbsp; --&amp;damageToApply|- &nbsp; --?[$UpCast] -eq 0|NO_UPCAST &nbsp; --=upcastDice|[$UpCast.Raw] * [*R:spellhldie] &nbsp; --&amp;damageRoll|+ + [$upcastDice.Raw][*R:spellhldietype] [Upcasting] &nbsp; --:NO_UPCAST| &nbsp; --?[$spell_crit] -eq 1|&amp;damageRoll;+ + [&amp;damageRoll]&nbsp; &nbsp; --?[$spell_crit] -eq 1|&amp;damageRoll2;+ + [&amp;damageRoll2]&nbsp; &nbsp; --?[$spell_crit] -eq 1|&amp;hittag;Critical Hit!|&amp;hittag;Hit! &nbsp; --?[$spell_crit] -eq 1|&amp;hitdesc;critically hits|&amp;hitdesc;hits and deals &nbsp; --?[&amp;spell_heal] -eq 1|&amp;hittag;[b][/b]&nbsp;&nbsp; &nbsp; --?[&amp;spell_heal] -eq 1|&amp;hitdesc;heals for &nbsp; --?[&amp;spell_heal] -eq 1|[ &nbsp; &nbsp; --&amp;damageToApply| &nbsp; --]| &nbsp; &nbsp; --=spellDamage|[&amp;damageRoll] [&amp;dmgModType1] &nbsp; --=spellDamage2|[&amp;damageRoll2] [&amp;dmgModType2] &nbsp; --=TotalDamage|[$spellDamage.Raw] + [$spellDamage2.Raw] &nbsp; --?"X[*R:spelldamage2]" -ne "X"|TWO_DAMAGE &nbsp; --+[&amp;hittag]|The [*R:spellname] [&amp;hitdesc] [$spellDamage] [*R:spelldamagetype] damage.[br][br] &nbsp; --&amp;damageToApply|+[$spellDamage.Raw] &nbsp; --&gt;[&amp;damageRoutine]|[&amp;action_target];[&amp;hitPointsBar];[&amp;damageToApply] &nbsp; --^DONE_SPELL_DAMAGE| &nbsp; --:TWO_DAMAGE| &nbsp; --+[&amp;hittag]|The [*R:spellname] [&amp;hitdesc] [$spellDamage] [*R:spelldamagetype] damage and [$spellDamage2] [*R:spelldamagetype2] damage.[br][br] &nbsp; --&amp;damageToApply|+[$TotalDamage.Raw] &nbsp; --&gt;[&amp;damageRoutine]|[&amp;action_target];[&amp;hitPointsBar];[&amp;damageToApply] &nbsp; --:DONE_SPELL_DAMAGE| &nbsp; --?"X[*R:spellsave]" -eq "X"|PC_CARD_SPELL &nbsp; --+|The target can make a [*R:spellsave] save vs DC [*S:spell_save_dc] to modify the damage as described below.[br][br] &nbsp; --^PC_CARD_SPELL| &nbsp; --:SPELL_ATTACK_MISS| &nbsp; --+The [*R:spellname] attack missed!|[br][br] &nbsp; --:PC_CARD_SPELL| &nbsp; --+|[*R:spelldescription] &nbsp; --:PC_DONE_SPELL| &nbsp; --X| &nbsp; --:Get_Ability_Modifier|attribute_string;returnnumericvalue;returnnamestring &nbsp; --?"[%1%]" -eq "strength_mod"|=[%2%];[*S:strength_mod] &nbsp; --?"[%1%]" -eq "strength_mod"|&amp;[%3%];[STR] &nbsp; --?"[%1%]" -eq "intelligence_mod"|=[%2%];[*S:intelligence_mod] &nbsp; --?"[%1%]" -eq "intelligence_mod"|&amp;[%3%];[INT] &nbsp; --?"[%1%]" -eq "wisdom_mod"|=[%2%];[*S:wisdom_mod] &nbsp; --?"[%1%]" -eq "wisdom_mod"|&amp;[%3%];[WIS] &nbsp; --?"[%1%]" -eq "dexterity_mod"|=[%2%];[*S:dexterity_mod] &nbsp; --?"[%1%]" -eq "dexterity_mod"|&amp;[%3%];[DEX] &nbsp; --?"[%1%]" -eq "constitution_mod"|=[%2%];[*S:constitution_mod] &nbsp; --?"[%1%]" -eq "constitution_mod"|&amp;[%3%];[CON] &nbsp; --?"[%1%]" -eq "charisma_mod"|=[%2%];[*S:charisma_mod] &nbsp; --?"[%1%]" -eq "charisma_mod"|&amp;[%3%];[CHA] &nbsp; --&lt;| &nbsp; --/|There are four different options for applying damage. The selected option is set in the settings area of the macro. &nbsp; --/|When applying damage, one of the four functions listed below will be executed to alter the target's HP. The ScriptCards &nbsp; --/|method is recommended, as there won't be an issue with impacting the same target more than once. &nbsp; --/|Apply damage via ScriptCards' built-in object modification function (new in ScriptCards 1.5.0) &nbsp; --:ApplyDamageScriptCards|Parameters are tokenid;bar#;amount &nbsp; --=applyValue|[%3%] &nbsp; --=newValue|[*[%1%]:t-bar[%2%]_value] + [$applyValue] &nbsp; --?[$newValue] -lt 0|=newValue;0 &nbsp; --?[$newValue] -gt [*[%1%]:t-bar[%2%]_max]|=newValue;[*[%1%]:t-bar[%2%]_max] &nbsp; --!t:[%1%]|bar[%2%]_value:[$newValue.Raw] &nbsp; --&lt;| &nbsp; --/|Token-Mod doesn't have a "set to a relative number", so we get the current bar value, subtract thedamage amount &nbsp; --/|make sure it doesn't fall below 0, and set the amount back into the bar. &nbsp; --:ApplyDamageTokenmod|Parameters are tokenid;bar#;amount &nbsp; --=applyValue|[%3%] &nbsp; --=newValue|[*[%1%]:t-bar[%2%]_value] + [$applyValue] &nbsp; --?[$newValue] -lt 0|=newValue;0 &nbsp; --?[$newValue] -gt [*[%1%]:t-bar[%2%]_max]|=newValue;[*[%1%]:t-bar[%2%]_max] &nbsp; --@token-mod|_ignore-selected _ids [%1%] _set bar[%2%]_value|[$newValue.Raw] &nbsp; --&lt;|&nbsp; &nbsp;&nbsp; &nbsp; --/|Just a dummy routine that doesn't do anything, but it is easier to do it this way than adding logic to see if we are &nbsp; --/|skipping applying damage in the main routine. &nbsp; --:DontApplyDamage| &nbsp; --&lt;| &nbsp; --:FIND_REPEATING_RESOURCE|character_id;resourceName;resourceReturnNameStringVariable;ResourceReturnValueStringVariable;ResouceCurrentValue &nbsp; &nbsp; --?"[%2%]" -eq "[*[%1%]:class_resource_name]"|_IsResourceClass &nbsp; &nbsp; --?"[%2%]" -eq "[*[%1%]:other_resource_name]"|_IsResourceOther &nbsp; &nbsp; --Rfirst|[%1%];repeating_resource &nbsp; &nbsp; --:_ResourceLoop| &nbsp; &nbsp; --?"[*R:resource_left_name]" -eq "[%2%]"|_IsResourceLeft &nbsp; &nbsp; --?"[*R:resource_right_name]" -eq "[%2%]"|_IsResourceRight &nbsp; &nbsp; --Rnext| &nbsp; &nbsp; --?"[*R:resource_left_name]" -ne "NoRepeatingAttributeLoaded"|_ResourceLoop &nbsp; &nbsp; --&amp;[%3%]|NotFound --&amp;[%4%]|NotFound --&amp;[%5%]|0&nbsp; &nbsp; --&lt;| &nbsp;&nbsp; &nbsp; --:_IsResourceClass| --&amp;[%3%]|class_resource_name --&amp;[%4%]|class_resource --&amp;[%5%]|[*[%1%]:class_resource] --&lt;| &nbsp; --:_IsResourceOther| --&amp;[%3%]|other_resource_name --&amp;[%4%]|other_resource --&amp;[%5%]|[*[%1%]:other_resource] --&lt;| &nbsp; --:_IsResourceLeft| --&amp;[%3%]|[*R:resource_left_name]&nbsp; --&amp;[%4%]|[*R&gt;resource_left] --&amp;[%5%]|[*S:[*R&gt;resource_left]]&nbsp; &nbsp; --&lt;|&nbsp;&nbsp; &nbsp; --:_IsResourceRight| --&amp;[%3%]|[*R:resource_left_name] --&amp;[%4%]|[*R&gt;resource_right] --&amp;[%5%]|[*S:[*R&gt;resource_right]] --&lt;| &nbsp; --:_NO_AMMO_AVAILABLE| &nbsp; --#whisper| &nbsp; --+|[*S:character_name] has no [&amp;ResourceUsed] left. &nbsp; --#emoteText|[*S:character_name] is all out of [&amp;ResourceUsed]. &nbsp; --X| &nbsp; --:FIND_CLASS_LEVEL|class;variableToSet &nbsp; --&amp;[%2%]|0 &nbsp; --?"[*S:class]" -eq "[%1%]"|&amp;[%2%];[*S:base_level] &nbsp; --?"[*S:multiclass1]" -eq "[%1%]"|&amp;[%2%];[*S:multiclass1_lvl] &nbsp; --?"[*S:multiclass2]" -eq "[%1%]"|&amp;[%2%];[*S:multiclass2_lvl] &nbsp; --?"[*S:multiclass3]" -eq "[%1%]"|&amp;[%2%];[*S:multiclass3_lvl] &nbsp; --?"[*S:multiclass4]" -eq "[%1%]"|&amp;[%2%];[*S:multiclass4_lvl] &nbsp; --&lt;| &nbsp; --:GET_AVAILABLE_SPELL_SLOTS|slotlevel;variableToSet &nbsp; --&amp;_maxSlots|[*S:lvl[%1%]_slots_total] &nbsp; --&amp;[%2%]|[*S:lvl[%1%]_slots_expended] &nbsp; --&lt;| &nbsp; --:DEDUCT_SPELL_SLOT|slotlevel &nbsp; --!a:[*S:character_id]|lvl[%1%]_slots_expended:-=1 &nbsp; --&lt;| &nbsp; --:GET_HIGHEST_LEVEL_SPELL_SLOT|variableToSet &nbsp; --&amp;[%1%]|0 &nbsp; --%levelCounter|1;9 &nbsp; &nbsp; --&gt;GET_AVAILABLE_SPELL_SLOTS|[&amp;levelCounter];slotTest &nbsp; &nbsp; --?[&amp;slotTest] -gt 0|&amp;[%1%];[&amp;levelCounter] &nbsp; --%| &nbsp; --&lt;| &nbsp; &nbsp;--:BuildCharacterSummary|charid;Return variable;ac attribute (either ac or npc_ac) &nbsp; --?[%3%] -eq "npc_ac"|BuildNPCSummary &nbsp; --&amp;[%2%]|[*[%1%]:class_display], AC [*[%1%]:[%3%]], HP [*[%1%]:hp]/[*[%1%]:hp^] &nbsp; --&lt;|| &nbsp; --:BuildNPCSummary| &nbsp; --&amp;[%2%]|CR[*[%1%]:npc_challenge] [*[%1%]:npc_type], AC [*[%1%]:[%3%]], HP [*[%1%]:t-bar[&amp;hitPointsBar]_value]/[*[%1%]:hp^] &nbsp; --&lt;|| &nbsp; &nbsp; --:CheckDamageModifiersNPC|characterid;damageVariableName;damageType;isMagical(0 or 1);IsSilver (0 or 1);IsAdamantine (0 or 1);NPCType(A or T) &nbsp; --&amp;[%2%]| &nbsp; --#parameterdelimiter|!! &nbsp; --~Vulns|string!!split!!;!![*[%1%]:npc_vulnerabilities];[&amp;[%7%]NPC_VULNS] &nbsp; --~Resists|string!!split!!;!![*[%1%]:npc_resistances];[&amp;[%7%]NPC_RESISTS] &nbsp; --~Immunes|string!!split!!;!![*[%1%]:npc_immunities];[&amp;[%7%]NPC_IMMUNES] &nbsp; --#parameterdelimiter|; &nbsp; --%VulnLoop|1;[$VulnsCount] &nbsp; &nbsp; --&amp;hasModifier|0 &nbsp; &nbsp; --?"X[&amp;Vulns[&amp;VulnLoop]]" -inc "silver" -or "X[&amp;Vulns[&amp;VulnLoop]]" -inc "adamantine" -or "X[&amp;Vulns[&amp;VulnLoop]]" -inc "magical"|&amp;hasModifier;1 &nbsp; &nbsp; --?"X[&amp;Vulns[&amp;VulnLoop]]" -inc "[%3%]" -and "X[&amp;Vulns[&amp;VulnLoop]]" -inc "adamantine" -and [%6%] -eq 1|&gt;IsVulnerable;[%2%] &nbsp; &nbsp; --?"X[&amp;Vulns[&amp;VulnLoop]]" -inc "[%3%]" -and "X[&amp;Vulns[&amp;VulnLoop]]" -inc "silver" -and [%5%] -eq 1|&gt;IsVulnerable;[%2%] &nbsp; &nbsp; --?"X[&amp;Vulns[&amp;VulnLoop]]" -inc "[%3%]" -and "X[&amp;Vulns[&amp;VulnLoop]]" -inc "magical" -and [%4%] -eq 1|&gt;IsVulnerable;[%2%] &nbsp; &nbsp; --?"X[&amp;Vulns[&amp;VulnLoop]]" -inc "[%3%]" -and [&amp;hasModifier] -eq 0|&gt;IsVulnerable;[%2%] &nbsp; --%| &nbsp; --:SKIP_VULN_CHECK| &nbsp; --%ResistLoop|1;[$ResistsCount] &nbsp; &nbsp; --&amp;hasModifier|0 &nbsp; &nbsp; --?"X[&amp;Resists[&amp;ResistLoop]]" -inc "silver" -or "X[&amp;Resists[&amp;ResistLoop]]" -inc "adamantine" -or "X[&amp;Resists[&amp;ResistLoop]]" -inc "magical"|&amp;hasModifier;1 &nbsp; &nbsp; --?"X[&amp;Resists[&amp;ResistLoop]]" -inc "[%3%]" -and [&amp;hasModifier] -eq 0|&gt;IsResistant;[%2%] &nbsp; &nbsp; --?"X[&amp;Resists[&amp;ResistLoop]]" -inc "[%3%]" -and [&amp;hasModifier] -eq 0|FINISH_RESIST_CHECK&nbsp; &nbsp; &nbsp; &nbsp; --?"X[&amp;Resists[&amp;ResistLoop]]" -inc "[%3%]" -and "X[&amp;Resists[&amp;ResistLoop]]" -inc "adamantine" -and [%6%] -eq 1|FINISH_RESIST_CHECK &nbsp; &nbsp; --?"X[&amp;Resists[&amp;ResistLoop]]" -inc "[%3%]" -and "X[&amp;Resists[&amp;ResistLoop]]" -inc "silver" -and [%5%] -eq 1|FINISH_RESIST_CHECK &nbsp; &nbsp; --?"X[&amp;Resists[&amp;ResistLoop]]" -inc "[%3%]" -and "X[&amp;Resists[&amp;ResistLoop]]" -inc "magical" -and [%4%] -eq 1|FINISH_RESIST_CHECK &nbsp; &nbsp; --?"X[&amp;Resists[&amp;ResistLoop]]" -inc "[%3%]"|&gt;IsResistant;[%2%] &nbsp; &nbsp; --:FINISH_RESIST_CHECK| &nbsp; --%| &nbsp; --:SKIP_RESIST_CHECK| &nbsp; --%ImmuneLoop|1;[$ImmunesCount] &nbsp; &nbsp; --&amp;hasModifier|0 &nbsp; &nbsp; --?"X[&amp;Immunes[&amp;ImmuneLoop]]" -inc "silver" -or "X[&amp;Immunes[&amp;ImmuneLoop]]" -inc "adamantine" -or "X[&amp;Immunes[&amp;ImmuneLoop]]" -inc "magical"|&amp;hasModifier;1 &nbsp; &nbsp; --?"X[&amp;Immunes[&amp;ImmuneLoop]]" -inc "[%3%]" -and [&amp;hasModifier] -eq 0|&gt;IsImmune;[%2%] &nbsp; &nbsp; --?"X[&amp;Immunes[&amp;ImmuneLoop]]" -inc "[%3%]" -and [&amp;hasModifier] -eq 0|FINISH_IMMUNE_CHECK &nbsp; &nbsp; --?"X[&amp;Immunes[&amp;ImmuneLoop]]" -inc "[%3%]" -and [&amp;hasModifier] -eq 1 -and "X[&amp;Immunes[&amp;ImmuneLoop]]" -inc "adamantine" -and [%6%] -eq 1|FINISH_IMMUNE_CHECK &nbsp; &nbsp; --?"X[&amp;Immunes[&amp;ImmuneLoop]]" -inc "[%3%]" -and [&amp;hasModifier] -eq 1 -and "X[&amp;Immunes[&amp;ImmuneLoop]]" -inc "silver" -and [%5%] -eq 1|&gt;FINISH_IMMUNE_CHECK;[%2%] &nbsp; &nbsp; --?"X[&amp;Immunes[&amp;ImmuneLoop]]" -inc "[%3%]" -and [&amp;hasModifier] -eq 1 -and "X[&amp;Immunes[&amp;ImmuneLoop]]" -inc "magical" -and [%4%] -eq 1|&gt;FINISH_IMMUNE_CHECK;[%2%] &nbsp; &nbsp; --?"X[&amp;Immunes[&amp;ImmuneLoop]]" -inc "[%3%]"|&gt;IsImmune;[%2%] &nbsp; &nbsp; --:FINISH_IMMUNE_CHECK| &nbsp; --%| &nbsp; --:SKIP_IMMUNE_CHECK| &nbsp; --&lt;| &nbsp; --:IsVulnerable| --&amp;[%1%]| * 2 [Vulnerable] --&lt;| &nbsp; --:IsResistant| --&amp;[%1%]| \ 2 [Resistant] --&lt;| &nbsp; --:IsImmune| --&amp;[%1%]| * 0 [Immune] --&lt;| &nbsp; --:DISPLAY_CHARACTER_CONFIG_MENU| &nbsp; --#whisper|self &nbsp; --#rightsub| &nbsp; --#leftsub|Action Menu Configuration [rbutton]&amp;#x21b6;::AFTER_ADVMODE_CHANGE[/rbutton] &nbsp; --+|[b][c]Display Global Mods[/c][/b] &nbsp; --&gt;CREATE_SETTINGS_TOGGLE_BUTTON|[*S:character_id];Attack;SGAM;BTN_SGAM &nbsp; --&gt;CREATE_SETTINGS_TOGGLE_BUTTON|[*S:character_id];Damage;SGDM;BTN_SGDM &nbsp; --&gt;CREATE_SETTINGS_TOGGLE_BUTTON|[*S:character_id];Save;SGSM;BTN_SGSM &nbsp; --&gt;CREATE_SETTINGS_TOGGLE_BUTTON|[*S:character_id];AC;SGCM;BTN_SGAC &nbsp; --&gt;CREATE_SETTINGS_TOGGLE_BUTTON|[*S:character_id];Skill;SGKM;BTN_SGSK &nbsp; --+|[c][&amp;BTN_SGAM] [&amp;BTN_SGDM] [&amp;BTN_SGSM] [&amp;BTN_SGAC] [&amp;BTN_SGSK][/c] &nbsp; --+|[b][c]Display Skill and Saves Buttons[/c][/b] &nbsp; --&gt;CREATE_SETTINGS_TOGGLE_BUTTON|[*S:character_id];Skills &amp; Saves;SSAS;BTN_SSAS &nbsp; --+|[c][&amp;BTN_SSAS][/c] &nbsp; --&gt;CREATE_SETTINGS_TOGGLE_BUTTON|[*S:character_id];Rest Buttons in Header;SHRB;BTN_SHRB &nbsp; --+|[b][c]Other Features[/c][/b] &nbsp; --+|[c][&amp;BTN_SHRB][/c] &nbsp; --X| &nbsp; --:CREATE_SETTINGS_TOGGLE_BUTTON|character_id;SettingName;SettingCode;ReturnStringVar &nbsp; --&gt;GET_PER_CHARACTER_SETTING|[%1%];[%3%];_THIS_SETTING &nbsp; --&amp;_BUTTON_COLOR|AA0000 &nbsp; --?[&amp;_THIS_SETTING] -eq 1|&amp;_BUTTON_COLOR;00AA00 &nbsp; --&amp;[%4%]|[rbutton:#ffffff:#[&amp;_BUTTON_COLOR]:8px][%2%]::TOGGLE_PER_CHARACTER_SETTING;[%1%]|[%3%][/rbutton] &nbsp; --&lt;| &nbsp; --:GET_PER_CHARACTER_SETTING|CharID;SettingCode;Return String Var Name &nbsp; --&amp;[%3%]|0 &nbsp; --?"X[*[%1%]:5ECAM_SETTINGS]" -inc "[%2%]1"|&amp;[%3%];1 &nbsp; --&lt;| &nbsp; --:LOAD_PER_CHARACTER_CONFIG_OPTIONS|characterID &nbsp; --?"X[*[%1%]:5ECAM_SETTINGS]" -eq "X"|&gt;SET_DEFAULT_PER_CHARACTER_SETTINGS;[%1%] &nbsp; --?"X[*[%1%]:5ECAM_SETTINGS]" -eq "Xundefined"|&gt;SET_DEFAULT_PER_CHARACTER_SETTINGS;[%1%] &nbsp; --&amp;perCharacterOptions|[*[%1%]:5ECAM_SETTINGS] &nbsp; --&lt;| &nbsp; --:SET_DEFAULT_PER_CHARACTER_SETTINGS|CharacterID &nbsp; --&amp;SettingsString|$SGAM1$$SGDM1$$SGSM1$$SGMB1$$SSAS1$$SGCM1$$SGKM1$$SHRB1$ &nbsp; --!a:[%1%]|!5ECAM_SETTINGS:[&amp;SettingsString] &nbsp; --&lt;| &nbsp; --:TOGGLE_PER_CHARACTER_SETTING|CharacterID;Setting &nbsp; --~TOG_CHAR_ID|string;before;|;[&amp;reentryval] &nbsp; --~TOG_SETTING|string;after;|;[&amp;reentryval] &nbsp; --~beforeText|string;before;[&amp;TOG_SETTING];[*[&amp;TOG_CHAR_ID]:5ECAM_SETTINGS] &nbsp; --~beforeLength|string;length;[&amp;beforeText] &nbsp; --~wholeLength|string;length;[*[&amp;TOG_CHAR_ID]:5ECAM_SETTINGS] &nbsp; --?[$beforeLength] -eq [$wholeLength]|SETTING_NOT_FOUND &nbsp; --~oldSetting|string;substring;[$beforeLength];7;[*[&amp;TOG_CHAR_ID]:5ECAM_SETTINGS] &nbsp; --~oldValue|string;substring;6;1;[&amp;oldSetting] &nbsp; --~newSetting|string;left;5;[&amp;oldSetting] &nbsp; --?"X[&amp;oldValue]" -eq "X1"|&amp;newSetting;+0$ &nbsp; --?"X[&amp;oldValue]" -ne "X1"|&amp;newSetting;+1$ &nbsp; --~replacement|string;replace;[&amp;oldSetting];[&amp;newSetting];[*[&amp;TOG_CHAR_ID]:5ECAM_SETTINGS] &nbsp; --!a:[&amp;TOG_CHAR_ID]|5ECAM_SETTINGS:[&amp;replacement] &nbsp; --^DISPLAY_CHARACTER_CONFIG_MENU| &nbsp; --:SETTING_NOT_FOUND| &nbsp; --!a:[&amp;TOG_CHAR_ID]|5ECAM_SETTINGS:[*[&amp;TOG_CHAR_ID]:5ECAM_SETTINGS]$[&amp;TOG_SETTING]1$ &nbsp; --^DISPLAY_CHARACTER_CONFIG_MENU| &nbsp; --X| &nbsp; --:ADD_STATUS_MARKER|Token_ID;Status Marker;Count &nbsp; --&gt;REMOVE_STATUS_MARKER|[%1%];[%2%] &nbsp; --~|array;statusmarkers;Conditions;[%1%] &nbsp; --&amp;toAdd|[%2%] &nbsp; --?"X[%3%]" -ne "X" -and "X[%3%]" -ne "X0"|&amp;toAdd;[%2%]@[%3%] &nbsp; --~|array;add;Conditions;[&amp;toAdd] &nbsp; --~newConditions|array;stringify;Conditions &nbsp; --#parameterdelimiter|$ &nbsp; --~newConditions|string$replaceall$;$,$[&amp;newConditions] &nbsp; --#parameterdelimiter|; &nbsp; --!t:[%1%]|statusmarkers:[&amp;newConditions] &nbsp; --:DONE_ADD_STATUS_MARKER| &nbsp; --&lt;| &nbsp; --:REMOVE_STATUS_MARKER|Token_ID;Status Marker &nbsp; --&gt;CHECK_STATUS_MARKER|[%1%];[%2%];MarkerExists;MarkerCounter&nbsp;&nbsp; &nbsp; --?[&amp;MarkerExists] -eq 0|&lt; &nbsp; --~|array;statusmarkers;Conditions;[%1%] &nbsp; --?[&amp;MarkerCounter] -eq 0|&amp;toCheckFor;[%2%]|&amp;toCheckFor;[%2%]@[&amp;MarkerCounter] &nbsp; --~hasCondition|array;indexof;Conditions;[&amp;toCheckFor] &nbsp; --?[&amp;hasCondition] -eq "ArrayError"|DONE_REMOVE_STATUS_MARKER &nbsp; --~|array;remove;Conditions;[&amp;toCheckFor] &nbsp; --~newConditions|array;stringify;Conditions &nbsp; --#parameterdelimiter|$ &nbsp; --~newConditions|string$replaceall$;$,$[&amp;newConditions] &nbsp; --#parameterdelimiter|; &nbsp; --!t:[%1%]|statusmarkers: [&amp;newConditions] &nbsp; --:DONE_REMOVE_STATUS_MARKER| &nbsp; --&lt;|&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; --:CHECK_STATUS_MARKER|TokenID;MarkerToFind;Exists;Counter &nbsp; --~|array;statusmarkers;Conditions;[%1%] &nbsp; --&amp;FoundMarker|-1 &nbsp; --%loop|0;[@Conditions(maxindex)] &nbsp; &nbsp; --&amp;Temp|[@Conditions([&amp;loop])] --?[&amp;Temp(indexof,[%2%])] -eq 0|&amp;FoundMarker;[&amp;loop] &nbsp; --%| &nbsp; --?[&amp;FoundMarker] -ne -1|FOUND_STATUS_MARKER &nbsp; --&amp;[%3%]|0 --&amp;[%4%]|0 --&lt;| &nbsp; --:FOUND_STATUS_MARKER| &nbsp; --&amp;[%3%]|1 &nbsp; --&amp;[%4%]|0 &nbsp; --&amp;ThisMarker|[@Conditions([&amp;FoundMarker])] &nbsp; --?[&amp;ThisMarker(contains,@)] -eq 0|&lt; &nbsp; --~[%4%]|string;after;@;[@Conditions([&amp;FoundMarker])] &nbsp; --&lt;| &nbsp; --:GET_CONTROLLED_TOKENS_FROM_PAGETOKENS| &nbsp; --~|array;pagetokens;_FCT_Tokens;[*C:playerpageid];pc &nbsp; --%_loop|0;[@_FCT_Tokens(maxindex)] &nbsp; &nbsp; --&amp;_FCT_TID|[@_FCT_Tokens([&amp;_loop])] &nbsp; &nbsp; --&amp;_FCT_CHAR|[*[&amp;_FCT_TID]:t-represents] &nbsp; &nbsp; --?"X[*O:[&amp;_FCT_CHAR]:character:controlledby]" -ninc [&amp;SendingPlayerID]|% &nbsp; &nbsp; --?"X[&amp;[%1%]]" -eq "X"|&amp;[%1%];+[&amp;_FCT_TID]|&amp;[%1%];+,[&amp;_FCT_TID]] &nbsp; --%| &nbsp; --&lt;| &nbsp; --:REPORT_NEED_SELECTED_TOKEN| &nbsp; --#whisper|self &nbsp; --+No Token Selected|You need to have a single token selected in order to use the 5E Character Action Menu. &nbsp; --X| &nbsp; --:REPORT_MULTIPLE_SELECTED_TOKEN| &nbsp; --#whisper|self &nbsp; --+Multiple Tokens Selected|You need to have a single token selected in order to use the 5E Character Action Menu. &nbsp; --X| &nbsp; --:REPORT_NO_TOKENS_ON_PAGE| &nbsp; --#whisper|self &nbsp; --+No Controlled Tokens|You do not appear to have any tokens on this page under your control. &nbsp; --X| &nbsp; --:REPORT_MULTIPLE_POSSIBLE_TOKENS| &nbsp; --#whisper|self &nbsp; --+Multiple Tokens|You appear to have more than one controlled token on this page. You will need to select a token manually to use the 5E Character Action Menu &nbsp; --X| &nbsp; --:DISPLAY_ACTIONMENU_CHARACTER_ABILITIES|Character ID &nbsp; --&amp;DACA_BUTTONS| &nbsp; --~|array;objects:ability;AbilArray;AM-;[%1%] &nbsp; --~|array;define;DACA_OBJS_ID &nbsp; --%loop|foreach;AbilArray &nbsp; &nbsp; --&amp;DACA_OBJS_ID(9999)|[*O:[&amp;loop]:ability:name]|[&amp;loop] &nbsp; --%| &nbsp; --~|array;sort;DACA_OBJS_ID &nbsp; --&amp;DACA_BUTTONS| &nbsp; --%loop|foreach;DACA_OBJS_ID &nbsp; &nbsp; --~DACA_PARTS|string;split;|;[&amp;loop] &nbsp; &nbsp; --&amp;DACA_NAME|[&amp;DACA_PARTS1(3)] &nbsp; &nbsp; --&amp;DACA_BUTTONS|+[button][&amp;DACA_NAME(replaceall,-, )]::~[%1%]|[&amp;DACA_PARTS1][/button] &nbsp; --%| &nbsp; --?"X[&amp;DACA_BUTTONS"] -eq "X"|&lt; &nbsp; --+Custom Actions| &nbsp; --+|[&amp;DACA_BUTTONS] &nbsp; --&lt;| }} And here is the console log error message: TypeError: Cannot read properties of undefined (reading 'substring') TypeError: Cannot read properties of undefined (reading 'substring') at handleInput (apiscript.js:24623:35) at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:168:1), &lt;anonymous&gt;:65:16) at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:168:1), &lt;anonymous&gt;:70:8) at /home/node/d20-api-server/api.js:1762:12 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147) at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546) at Id.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:489) at Ld.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:94:425) at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:111:400
1686165706
timmaugh
Pro
API Scripter
OK, I'll dig into that later tonight. Can you also run a ScriptInfo check on that line number from the error? !scriptinfo&nbsp;24623 And see what it reports back to you? If you don't have ScriptInfo installed, it's in the 1-click... but since scripts can sometimes reorder themselves after a new script is installed, I would install ScriptInfo, then run the macro to generate the error again, then run the ScriptInfo command line but using the (potentially) new line number for the error. Let us know what it says...
Sure thing!&nbsp; Here is what it says: MODERATOR: Script Information (Line 24623) That line number does not correspond to any script reporting its offset. It occurs 16750 lines after the end of tokenActionMaker, and 32 lines before the start of libTokenMarkers. That doesn't seem too helpful...
Hey, @timmaugh, I found another conflict between ZeroFrame and RecursiveTable. Here is the RT command: !rt[ShowIcons:yes|IconScale:128px] /w GM &amp;{template:traits} {{name=A message from our sponsors!}}{{description=This episode of Escape from Undermountain is brought to you by:&nbsp; [[1t[Advert]]] }} and here is the error code: TypeError: Cannot read properties of undefined (reading 'substring') TypeError: Cannot read properties of undefined (reading 'substring') at handleInput (apiscript.js:24623:35) at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:168:1), &lt;anonymous&gt;:65:16) at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:168:1), &lt;anonymous&gt;:70:8) at /home/node/d20-api-server/api.js:1762:12 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147) at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546) at Id.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:489) at Ld.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:94:425) at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:111:400 Error seems to come from the same line of code.
Ok, so I have a new challenge.&nbsp; I am trying to build a Scriptcard to handle using a spell scroll.&nbsp; What I would like it to do is search a character's inventory section for any instance of the word Scroll and a provided spell name, cast the spell associated with it per the rules of using a spell scroll, then delete it from their inventory.&nbsp; This could also be used for any consumable (potions, rations, etc.) Surely this has already been written!&nbsp; Or do I need to hunker down and write it?
1686355738
Gauss
Forum Champion
CatSwann said: Ok, so I have a new challenge.&nbsp; I am trying to build a Scriptcard to handle using a spell scroll.&nbsp; What I would like it to do is search a character's inventory section for any instance of the word Scroll and a provided spell name, cast the spell associated with it per the rules of using a spell scroll, then delete it from their inventory.&nbsp; This could also be used for any consumable (potions, rations, etc.) Surely this has already been written!&nbsp; Or do I need to hunker down and write it? Out of curiosity, which character sheet is this for?&nbsp;
Sorry... should have specified. 5e OGL sheet
1686358352

Edited 1686358418
Gauss
Forum Champion
CatSwann said: Sorry... should have specified. 5e OGL sheet If you are interested, this may be able to be done without using a scriptcard.&nbsp; How I handle it is I drop the spell into the spell list like any other spell. Then I change the name to (Scroll) and put "Scroll" (without quotes) in the "Innate" field. That prevents the scroll from burning a spell slot when cast (if using the 5e OGL companion script). Finally, if you need to make a check you can bake that in too via an inline roll in the Spellcard. If you would like to go that route and would like some help I could&nbsp;help you with the macro for that.&nbsp;
1686405270
David M.
Pro
API Scripter
CatSwann, you might want to check out Will M.'s DM ToolKit scriptcard as a starting point for your macro. He's got some code in there that reads 5e inventory. It's a huge macro, so just search for "inventory".
1686698446
Kurt J.
Pro
API Scripter
ScriptCards 2.3.9 is now Live on OneClick Here is a summary of the changes since v2.3.5 (the last push to OneClick): Now handles XdY&gt;Zf&lt;Q (roll XdY, count successes greater than Z, subtract failures less than Q) New settings:&nbsp; emotesourcetokensize and emotetargetokensize. Default for both is 50. Numeric only ("px" gets appended to the value) New enhanced string referencing function: split. Takes a delimiter and a zero-based index (ie, [&amp;MyString(split,!,1))) Enhanced string reference methods can now use the "," (comma) character as part of the method by prefixing it with a \ (backslash): ex: [&amp;MyString(split,\,,3)] will split MyString on the comma charcter (\,) and return the 4th item. New inline formatting tag: [roll]...[/roll] will format whatever is between the tags to look like a roll (hilighting around) the text. You can use [roll:c] and [roll:f] to colorize the box as a (c)rit or a (f)umble Two new settings: #emotesourcetokenoverride and #emotetargettokenoverride. If one or both of these is set to a url, the token images in the emote area will be replaced with that image (source=left, target=right) Bug fixes
Kurt always making improvements!
Using --#overridetemplate|wizard causes all text to be in bold. It's coming from this css: <a href="https://cdn.roll20.net/production/vtt.css" rel="nofollow">https://cdn.roll20.net/production/vtt.css</a> Turning it off, make it look nicer, and acts the normal way, where I define where the bold tags are: Can we perhaps include this somewhere in there? font-weight : &nbsp;normal ;
1687700716

Edited 1687700757
Kurt J.
Pro
API Scripter
Jo said: Using --#overridetemplate|wizard causes all text to be in bold. It's coming from this css: <a href="https://cdn.roll20.net/production/vtt.css" rel="nofollow">https://cdn.roll20.net/production/vtt.css</a> Turning it off, make it look nicer, and acts the normal way, where I define where the bold tags are: Can we perhaps include this somewhere in there? font-weight : &nbsp;normal ; The Override Templates come from Keith's SuperNotes addon, so I can't change anything with them from ScriptCards. As an alternative, though, you can create your own template based on "wizard" if you want by following the instructions in the Override Templates section on the Wiki page for defining a template mule and adding styles. (I just updated this section to include this information, which was previously only in the change log for the script.
Kurt J. said: The Override Templates come from Keith's SuperNotes addon, so I can't change anything with them from ScriptCards. As an alternative, though, you can create your own template based on "wizard" if you want by following the instructions in the Override Templates section on the Wiki page for defining a template mule and adding styles. (I just updated this section to include this information, which was previously only in the change log for the script. Thank you! This worked perfectly!
1688398586

Edited 1688424100
Kurt
Pro
I'm working on making a new character roller for Shadowdark RPG. But, I can't understand how to get the variable to be read after prompting the user for a name for said character. here is my code !scriptcard {{ --#title|[&amp;SendingPlayerName] --#titlecardbackgroundimage| radial-gradient( ellipse farthest-side at Top center, [&amp;SendingPlayerColor], Black) --/#titlecardbackground|[&amp;SendingPlayerColor] --~|array;define;Ancestry; Human ; Human ; Human ; Human ; Elf ; Elf ; Dwarf ; Dwarf ; Halfling ; Halfling ; Half-orc ; Goblin ; Goblin; --=Anc|1d12 --=Bck|1d20 --~|array;define;Background; Urchin ; Wanted; Cult Initiate; Thieves' Guild; Banished; Orphaned; Wizard's Apprentice; Jeweler; Herbalist; Barbarian; Mercenary; Sailor; Acolyte; Sailor; Ranger; Scout; Minstrel; Scholar; Noble; Chirurgeon --#leftsub|[@Ancestry([$Anc.Base])] ([$Anc.Base]) --#rightsub|[@Background([$Bck.Base])] ([$Bck.Base]) --=Str|3d6 --=Dex|3d6 --=Con|3d6 --=Int|3d6 --=Wis|3d6 --=Cha|3d6 &nbsp; --/ Make sure to enter a reroll function --+|Str[$Str.Total] Dex[$Dex.Total] Con[$Con.Total]&nbsp; --+|Int[$Int.Total] Wis[$Wis.Total] Cha[$Cha.Total] --=HP|1d4 --+HP:|[$HP.Total] --iScriptCards needs additional information to continue;Click to provide information|q;MyNameIs;What is your character's name? --+[&amp;MyNameIs] }} Are there any examples anywhere I could look at?
1688420312
Andrew R.
Pro
Sheet Author
You don't have matching brackets on your --+ command.&nbsp; I recommend using a programmers editor, they help matching brackets.&nbsp;
1688424415

Edited 1688437415
Kurt
Pro
Thannks Andrew R. I'm using Notepad++. any idea what language I should set it to? It's not auto-detecting the language. here is a list of all Notepad++ languages&nbsp; <a href="https://npp-user-manual.org/docs/programing-languages/" rel="nofollow">https://npp-user-manual.org/docs/programing-languages/</a>
1688428077

Edited 1688428087
David M.
Pro
API Scripter
Old Man, did you change this --+[&amp;MyNameIs] to this? --+|[&amp;MyNameIs] Here's what I get after making that change. Were you expecting some other output?
1688435166

Edited 1688437449
Kurt
Pro
AHHH! Thank you! yes, that does make it work.&nbsp; I'm new to this language and I forgot that the vertical bar is a necessity. that definitely works. I'll have to figure something else out though, the fact that it doesn't show the characters what their ancestry, background, stats, and hp are might make it difficult for them to name. It prompts for input without displaying the card's information.. I was hoping it'd do 90% of the card and show that, then prompt the user, then append the card with the name.&nbsp; Maybe I'll just make the text for the prompt literally spell out everything like, "Your character is a Halfling Minstrel, S16,D13,C11,I15,W10,Ch16,HP3, What name would you like to use?" EDIT:&nbsp; I wrote this code&nbsp; --iYour character is a [@Ancestry([$Anc.Base])] ([$Anc.Base]) [@Background([$Bck.Base])] ([$Bck.Base])&nbsp; Str[$Str.Total] Dex[$Dex.Total] Con[$Con.Total] Int[$Int.Total]&nbsp; Wis[$Wis.Total] Cha[$Cha.Total] with [$HP.Total] HP; Click to provide a name|q;MyNameIs;What is your character's name? --+Name:|[&amp;MyNameIs] This is definitely usable for my game even if it isn't super polished.&nbsp;&nbsp;