Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

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

Craven said: anyone know why this wouldn't work? !token-mod --set statusmarkers|dead this work outside of scriptcard but --@token-mod| _set statusmarkers|dead doesn't work inside my card.I have tried --@token-mod| _set|statusmarkers|dead Did I translate it wrong?  You might want to get  SelectManager  and try this. --@forselected+|token-mod _set statusmarkers|dead This is how I got token-mod to work with scriptcard.
1618631061

Edited 1618631079
David M.
Pro
API Scripter
EDIT - ninja'd! @Craven: You are running into the problem of the api "forgetting" which token is selected after entering the initial (scriptcard) script. When it tries to run Token-mod, there is no token selected as far as the api knows. The solution is to either get the token/character id from the selected token and use the --ids command from token-mod, or to add the SelectManager script and use something like this syntax for your api call: --@forselected|token-mod _set statusmarkers|dead
David M. said: EDIT - ninja'd! @Craven: You are running into the problem of the api "forgetting" which token is selected after entering the initial (scriptcard) script. When it tries to run Token-mod, there is no token selected as far as the api knows. The solution is to either get the token/character id from the selected token and use the --ids command from token-mod, or to add the SelectManager script and use something like this syntax for your api call: --@forselected|token-mod _set statusmarkers|dead getting an error   (From API):  No selected tokens to use for that command. Please select some tokens then try again.  using selectmanager. 
1618654596
Kurt J.
Pro
API Scripter
Craven said: anyone know why this wouldn't work? !token-mod --set statusmarkers|dead this work outside of scriptcard but --@token-mod| _set statusmarkers|dead doesn't work inside my card.I have tried --@token-mod| _set|statusmarkers|dead Did I translate it wrong?  By default, Tokenmod acts on the selected token. When an API script calls another API, Roll20 doesn't include the list of selected tokens. You need to either user the IDs parameter for tokenmod (you'll need to set the Players Can Use IDs option if you want your players to run the card) or use the SelectManager API to trick the API into adding the selected token list to the message.
1618658178
David M.
Pro
API Scripter
Craven, do you happen to be using a --#targetToken call in your scriptcard also? There is currently an issue with with scriptcard/SelectManager compatibility that causes SelectManager to fail when --#targetToken is also used. You could try removing this line and keep the forselected syntax, or just use --ids in your token-mod call until this is resolved.  
Using some code i found in here, and advice from some of you I cam up with this.  It will produce a list of attacks but does not populate the roll query.  Thoughts? !script {{ --#title|Attack --#leftsub|[$Weapon] --#rightsub|[*R:engagement_range] --Rfirst|@{selected|character_id};repeating_attack --:DisplayLoop| --?"[*R:name]" -eq NoRepeatingAttributeLoaded|Done --+Action:|[*R:name] --Rnext| -->DisplayLoop| --:Done| --=Weapon|?{Choose Weapon:|[*R:name]} }}
David M. said: Craven, do you happen to be using a --#targetToken call in your scriptcard also? There is currently an issue with with scriptcard/SelectManager compatibility that causes SelectManager to fail when --#targetToken is also used. You could try removing this line and keep the forselected syntax, or just use --ids in your token-mod call until this is resolved.   First Thanks Kurt and David for trying to help,  I do have that in my script so i guess that's why forselected is not working. I tried --@token-mod| _ids | _set statusmarkers|dead as kurt and you have suggested and its still not working. I have check with !token-mod --config players-can-ids and its turn on. 
If you have written a scriptcard for finesse weapons that ask for dex or str mod to be used please post it. Example a dagger and use the PC str or dex mod and I would like to ask the player which to use then replace --=AttackRoll|1d20 + @{selected|strength_mod} [STR] + @{selected|pb} [PROF]   with it. Also looking for a sneak attach routine. 
You could do something like this for finesse: --?[*S:strength_mod] -gt [*S:dexterity_mod]|>SetMod;strength|>SetMod;dexterity --=AtkRoll|1d20 + [&FinesseMod] + [*S:pb] --=DamRoll|1d20 + [&FinesseMod] --X| <more code> <subroutines> --:SetMod|which mod to use --&FinesseMod|[*S:[%1%]_mod] --<| Craven said: If you have written a scriptcard for finesse weapons that ask for dex or str mod to be used please post it. Example a dagger and use the PC str or dex mod and I would like to ask the player which to use then replace --=AttackRoll|1d20 + @{selected|strength_mod} [STR] + @{selected|pb} [PROF]   with it. Also looking for a sneak attach routine. 
You're missing something in your line: --@token-mod|_ids @{selected|character_id} _set statusmarkers|dead Craven said: David M. said: Craven, do you happen to be using a --#targetToken call in your scriptcard also? There is currently an issue with with scriptcard/SelectManager compatibility that causes SelectManager to fail when --#targetToken is also used. You could try removing this line and keep the forselected syntax, or just use --ids in your token-mod call until this is resolved.   First Thanks Kurt and David for trying to help,  I do have that in my script so i guess that's why forselected is not working. I tried --@token-mod| _ids | _set statusmarkers|dead as kurt and you have suggested and its still not working. I have check with !token-mod --config players-can-ids and its turn on. 
The problem is that the roll query is processed by the chat server before the card is run, so there is nothing to populate the query at run time. Brien V. said: Using some code i found in here, and advice from some of you I cam up with this.  It will produce a list of attacks but does not populate the roll query.  Thoughts? !script {{ --#title|Attack --#leftsub|[$Weapon] --#rightsub|[*R:engagement_range] --Rfirst|@{selected|character_id};repeating_attack --:DisplayLoop| --?"[*R:name]" -eq NoRepeatingAttributeLoaded|Done --+Action:|[*R:name] --Rnext| -->DisplayLoop| --:Done| --=Weapon|?{Choose Weapon:|[*R:name]} }}
1618691982

Edited 1618692085
@Kurt: How can I adjust the distance function to account for the fact that the grids are 10ft sq but I need distance measured in 5ft increments? For instance, I get a result of 1 when I run this: !script {{ --~Dist|distance;@{target|Mook1|token_id};@{target|Mook2|token_id} --+|[$Dist] }} When the two tokens are 10' or 15' apart, but those extra 5' make a difference for range.
1618693604
Kurt J.
Pro
API Scripter
Colin C. said: @Kurt: How can I adjust the distance function to account for the fact that the grids are 10ft sq but I need distance measured in 5ft increments? For instance, I get a result of 1 when I run this: !script {{ --~Dist|distance;@{target|Mook1|token_id};@{target|Mook2|token_id} --+|[$Dist] }} When the two tokens are 10' or 15' apart, but those extra 5' make a difference for range. The distance function divides the positional coordinates of the tokens by the default Roll20 grid size of 70, and returns the number of grid units between the specified tokens. If your grid in Roll20 is configured to be 5ft, a distance of 2 grid units away should be 10 feet, 3=15 feet, etc. If you aren't using 70 unit grids, you would need to change the " / 70"s in the code to reflect your grid size, but the result is always in full grid units. You could potentially remove the /70s altogether and get the raw unit distance between the tokens, but then you would need to do math outside the function to determine what scale distance that covers.
1618693800

Edited 1618703588
Kurt J.
Pro
API Scripter
Brien V. said: Using some code i found in here, and advice from some of you I cam up with this.  It will produce a list of attacks but does not populate the roll query.  Thoughts? !script {{ --#title|Attack --#leftsub|[$Weapon] --#rightsub|[*R:engagement_range] --Rfirst|@{selected|character_id};repeating_attack --:DisplayLoop| --?"[*R:name]" -eq NoRepeatingAttributeLoaded|Done --+Action:|[*R:name] --Rnext| -->DisplayLoop| --:Done| --=Weapon|?{Choose Weapon:|[*R:name]} }} Colin is correct. When the chat server sees the ?{Choose...} syntax it will pop up the box before doing anything with the API and you'll probably just get a choice of *R:name. You would need to have a separate script that builds an attribute that you store on the character with the list of weapons and then use that attribute in the roll query to get a list of weapons. I'll see if I can put together an example. Edit: As it turns out, doing this with ScriptCards and ChatSetAttr is proving to be difficult when trying to create the attribute in the correct format (chatsetattr needs the vertical bars to be escaped, which overly complicates generating the list in ScriptCards and comparing it to what is already on the character. I'll be working on adding something to ScritpCards to support this directly, but it probably won't make an appearance until 1.1.19 is up on OneClick, since I'm in "feature freeze" right now.
I've put together an attack card.  It checks for crit threat and rolls accordingly.  Everything seems to work but the problem comes when there's a fumble.  It shows the fumble text but then, for some reason, runs the critical damage script.  I can't figure out why.   !scriptcard {{ --#title|Attack --#leftsub|@{selected|repeating_attack_$4_name} --#rightsub|@{selected|repeating_attack_$4_range} --#titlecardbackground|#993333 --#sourceToken|@{selected|token_id} --#targetToken|@{target|token_id} --#emoteText|[*S:character_name] attacks [*T:character_name] --=AttackRoll|1d1 + @{selected|repeating_attack_$4_total} [Attack Bonus] --+|@{selected|token_name} rolls a [$AttackRoll] to hit versus Armor Class @{target|eac} --?[$AttackRoll.Base] -eq 20|Crit --?[$AttackRoll.Base] -eq 1|Fumble --?[$AttackRoll.Total] -lt @{target|eac}|Miss --:Hit| -->RollDamage| --+Hit!|You did [$Damage] points damage. --@alter|_target|@{target|token_id} _bar|1 _amount|-[$Damage] --X| --:Miss| --+|You missed --X| --:Fumble| --+|Ya effed up A-A-Ron --:X| --:Crit| -->RollDamage|crit --+Critical Hit!!!| You hit really well. You did [$Damage] points of damage. --X| --:RollDamage| --?[%1%] -eq crit|CritDamage --=Damage|@{selected|repeating_attack_$4_damage_total} [Base] --<| --:CritDamage| --?[$AttackRoll.Total] -gt [*T|eac]|FullCrit --=Damage|@{selected|repeating_attack_$4_damage_total} [Base] --@alter|_target|@{target|token_id} _bar|1 _amount|-[$Damage] --<| --:FullCrit| --=Damage|@{selected|repeating_attack_$4_damage_total} [Base] + @{selected|repeating_attack_$4_damage_total} [Bonus] + @{selected|repeating_attack_$4_crit} [Weapon Crit] --+Critical Hit!!!| You hit really well. You did [$Damage] points of damage. --+Bonus|You get a roll on the [B]CRIT TABLE!!!!![/B] --+Crit Effect:|@{selected|repeating_attack_$4_crit} --@alter|_target|@{target|token_id} _bar|1 _amount|-[$Damage] --X| }}
You have a semi-colon at the end instruction for the fumble.   --:X|  it should be  --X|
Michael C. said: You have a semi-colon at the end instruction for the fumble.   --:X|  it should be  --X| Boom...just needed new eyes.  You the man.
Naw, I've just made the same or similar mistake 100x.  :-)
Colin C. said: You're missing something in your line: --@token-mod|_ids @{selected|character_id} _set statusmarkers|dead Craven said: David M. said: Craven, do you happen to be using a --#targetToken call in your scriptcard also? There is currently an issue with with scriptcard/SelectManager compatibility that causes SelectManager to fail when --#targetToken is also used. You could try removing this line and keep the forselected syntax, or just use --ids in your token-mod call until this is resolved.   First Thanks Kurt and David for trying to help,  I do have that in my script so i guess that's why forselected is not working. I tried --@token-mod| _ids | _set statusmarkers|dead as kurt and you have suggested and its still not working. I have check with !token-mod --config players-can-ids and its turn on.  OMG thank you its working. Had to change to target but I am so happy. Thanks again. 
I create a post called "Scritpcard API Working and Sharing" If anyone has working cards an would like to share. Thanks in advance to all whom share there hard work. 
Good Idea, I'll start posting some of mine there.
Has anyone figure out how to do advantage, disadvantage, normal attack with scriptcard?
1618831886

Edited 1618831950
Craven - pretty close to how powercards does it.      --&RollType|?{Advantage or Disadvantage?|Normal,1d20|Advantage,2d20kh1|Disadvantage,2d20kl1} --=AttackRoll|[&RollType] [BASE] + [$[&Attribute]] [MOD] + @{selected|pb} [PROF] + @{selected|global_attack_mod} [GLOBE] --+Attack|@{selected|character_name} rolls [$AttackRoll] vs AC [$TargetAC].
Kurt J. said: Brien V. said: Using some code i found in here, and advice from some of you I cam up with this.  It will produce a list of attacks but does not populate the roll query.  Thoughts? !script {{ --#title|Attack --#leftsub|[$Weapon] --#rightsub|[*R:engagement_range] --Rfirst|@{selected|character_id};repeating_attack --:DisplayLoop| --?"[*R:name]" -eq NoRepeatingAttributeLoaded|Done --+Action:|[*R:name] --Rnext| -->DisplayLoop| --:Done| --=Weapon|?{Choose Weapon:|[*R:name]} }} Colin is correct. When the chat server sees the ?{Choose...} syntax it will pop up the box before doing anything with the API and you'll probably just get a choice of *R:name. You would need to have a separate script that builds an attribute that you store on the character with the list of weapons and then use that attribute in the roll query to get a list of weapons. I'll see if I can put together an example. Edit: As it turns out, doing this with ScriptCards and ChatSetAttr is proving to be difficult when trying to create the attribute in the correct format (chatsetattr needs the vertical bars to be escaped, which overly complicates generating the list in ScriptCards and comparing it to what is already on the character. I'll be working on adding something to ScritpCards to support this directly, but it probably won't make an appearance until 1.1.19 is up on OneClick, since I'm in "feature freeze" right now. Since I cannot update an entire list, how about if I do a roll query using the the Rfind and plug the selection into a attribute.  That attribute is then used in the scriptcard.  Will it update in the same scriptcard so it can be used without two cards?  
Brien V. said: Since I cannot update an entire list, how about if I do a roll query using the the Rfind and plug the selection into a attribute.  That attribute is then used in the scriptcard.  Will it update in the same scriptcard so it can be used without two cards?   That's at least one way to do it, although if it's all in one card, the Roll Query that prompts the user will be based on whatever existed in the attribute before the card runs, which means anything that is updated through using the card will not be reflected in the menu generated. Realistically, this shouldn't be a problem very often, unless you change up the list items a lot.
Colin C. said: That's at least one way to do it, although if it's all in one card, the Roll Query that prompts the user will be based on whatever existed in the attribute before the card runs, which means anything that is updated through using the card will not be reflected in the menu generated. Realistically, this shouldn't be a problem very often, unless you change up the list items a lot. I think I have a way around that.  I have two cards.  One is just the player selecting the weapon.  That will direct you to a second card that just pulls the adjusted attribute.  I already have to use 2 card for powercards, so it's not a big deal. Here's the problem I am having.  I cannot get the script to pull the character ID. !scriptcard {{ --&WeaponSelect|?{Choose Your Weapon:|Missile|Sword|Cheese Knife} --sourceToken|@{selected|token_id} --@setattr|_charid [*S:character_id] _weapon|[$WeaponSelect] --#title|Set ATTR Test --#leftsub|[$WeaponSelect] }}
1618855469
David M.
Pro
API Scripter
Looks like your sourceToken line is missing a #  --#sourceToken|@{selected|token_id}
1618859973
Kurt J.
Pro
API Scripter
I started putting together a general "Spellbook" script that starts by displaying buttons for every level of spell the player is able to cast (ie, "Cast Cantrip", "Cast Level 1 Spell", etc.) and then when you click one of those it displays a line for each spell of that level you know with buttons for the slot levels you want to use to cast it. I got as far as working on the display when casting the spell when I found a bug (gasp!) in the Rfind code for certain values in a repeating section :) I'm working on resolving that and will then complete the script and post it as an example of reentrant scripts taken to way past what I had initially envisioned.
1618863270

Edited 1618863406
Hello, I have a question about using the new [sheetbutton] formatting (1.1.18) I have a repeating section that contains the names of different contacts of a character. I have made a script that lists these characters using the repeating sections. I create buttons that contain the names of the contacts.  I would then like these buttons to be able to fetch various abilities from the corresponding character sheets. [*R:name] = Gordon Tillman. When I do : [sheetbutton][*R:name]::-MYZEYOdetqFSn2SHQxw::testP[/sheetbutton] it is ok, the "testP" abilitie of Gordon Tillman Character Sheet run But if I do : [sheetbutton][*R:name]::[*R:name]::testP[/sheetbutton] it doesn't work Kurt Said New Formatting Option :  [sheetbutton]ButtonCaption::Character::AbilityMacro[/sheetbutton] . This works similarly to [button], but takes three parameters instead of two and is used for easily creating buttons that refer to macros on character sheets. The Character parameter can be a character ID, a token ID that represents a character, or a character name . ScriptCards will try to find a match and generate the button. I think that it works with the ID but not with the character name. Am I wrong somewhere? Thanks 
1618865526

Edited 1618865914
Kurt J.
Pro
API Scripter
Gabryel said: When I do : [sheetbutton][*R:name]::-MYZEYOdetqFSn2SHQxw::testP[/sheetbutton] it is ok, the "testP" abilitie of Gordon Tillman Character Sheet run But if I do : [sheetbutton][*R:name]::[*R:name]::testP[/sheetbutton] it doesn't work Kurt Said New Formatting Option :  [sheetbutton]ButtonCaption::Character::AbilityMacro[/sheetbutton] . This works similarly to [button], but takes three parameters instead of two and is used for easily creating buttons that refer to macros on character sheets. The Character parameter can be a character ID, a token ID that represents a character, or a character name . ScriptCards will try to find a match and generate the button. I think that it works with the ID but not with the character name. Am I wrong somewhere? Thanks  There is a  bug in the code to find characters by name. I'm working on it right now and will post and update shortly.
Sounds awesome Kurt. Ok here is my base weapon macro. Features: Card formatting, Variables: Base weapon damage dice, Magic weapon, type of damage, Check token for npc_ac or AC, Check to see which Mod is better Str or Dex and Normal, Advantage, Disadvantage. Setup this way so I can make changes for other weapon type easily. Then removes the Damage HP from the target. Final step is to check the health of the target and if dead print it to the card with XP value of the target and add a X to the token. Ty to all the help. Working on Sneak attack sub routine for rogues. !scriptcard {{ --#title|Weapon --#leftsub|Melee Attack --#rightsub|Range --#sourceToken|@{selected|token_id} --#targetToken|@{target|token_id} --#emoteText|@{selected|token_name} attacks @{target|token_name} --#titleFontColor|#FFFFFF --#titleCardBackground|#932729 --#evenRowBackground|#B6AB91 --#evenRowFontColor|#000000 --#oddRowBackground|#CEC7B6 --#oddRowFontColor|#000000 --#emoteBackground|#FFFFFF --#tableBorderRadius|8px --:|What is the Base Weapons Damage express 1dx --=BaseWeaponDamage|1d8 --:|Magic change settings here --=Magic|0 --:|Damage Type Slashing, Bludgeoning, Piercing --=DamageType|Slashing --:|Get Targets AC --=TargetAC|@{target|npc_ac} --?[$TargetAC.Total] -gt 0|DoneWithAC --=TargetAC|@{target|ac} --:DoneWithAC| --?[*S:strength_mod] -gt [*S:dexterity_mod]|>SetMod;strength|>SetMod;dexterity --:|Advantage, Disadvantage, Normal --&RollType|?{Advantage or Disadvantage?|Normal,1d20|Advantage,2d20kh1|Disadvantage,2d20kl1} --=AttackRoll|[&RollType] [BASE] + [&FinesseMod] [MOD] + [*S:pb] [PROF] + [$Magic] [Magic] --+Attack|@{selected|token_name} rolls [$AttackRoll] vs AC [$TargetAC]. --?[$AttackRoll.Base] -eq 20|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| --:Hit| --=Damage| [$BaseWeaponDamage] + [&FinesseMod] [MOD] + [$Magic] [Magic] --+Hit!|The attack hit @{target|token_name} for [$Damage] [$DamageType.RollText]. --@alter|_target|@{target|token_id} _bar|1 _amount|-[$Damage] --^Healthcheck| --:Crit| --=Damage|[$BaseWeaponDamage]+ [&FinesseMod] [MOD] + [$BaseWeaponDamage] [CRIT] --+Critical Hit!|The attack hit @{target|token_name} for [$Damage] [$DamageType.RollText]. --@alter|_target|@{target|token_id} _bar|1 _amount|-[$Damage] --:Healthcheck| --=targethp|@{target|hp}-[$Damage] --?[$targethp] -lt 1|Dead --^Final| --:Dead| --+Status:|[b]@{target|token_name} is Dead and worth @{target|npcd_XP}[/b] --@token-mod|_ids @{Target|character_id} _set statusmarkers|dead --:SetMod|which mod to use --&FinesseMod|[*S:[%1%]_mod] --<| --:Final| --X| }} Any comments or suggestion are welcome.  Craven
Kurt J. said: There is a  bug in the code to find characters by name. I'm working on it right now and will post and update shortly. What speed! Thanks a lot, I thought I was coding something wrong, I'm a bit new to repeating sections. Thanks for your answer
1618866072

Edited 1618866246
Kurt J.
Pro
API Scripter
ScriptCards version 1.1.19e now available Up on the GIST . This version addresses two bugs: Sheetbutton syntax now properly finds a character by name instead of just returning the first character it finds. Repeating sections that are typed as pure numeric values (as opposed to numbers stored in strings) were causing Rfind to crash the sandbox. I have added some checks to prevent this. Please let me know if this interferes with existing scripts. I was able to update my pull request to OneClick prior to the merge, so as of now this is the version that should show up on OneClick tomorrow or Wednesday.
Super awesome! That's real time coding right there! Thanks Kurt for your investment. The Roll20 team should offer you a job :)
David M. said: Looks like your sourceToken line is missing a #  --#sourceToken|@{selected|token_id} Yep...That was it.  Thank you.
Thanks, Kurt!
Hi guys.... I've been banging my head against the wall but nothing came out ^^ I have a main card that is called by my PCs that whisper to themselves the 11 skills of the domain Technique as shown below : On the right side we can see if the current player has profenciency in a given skill (1st value before the "-") and if he has an item granting him some bonus (2nd value after the "-"). When I click on  the Technologie choice, it branches on a sub called Technologie . That sub randomizes 3 dices (yellow, Blue & red) on 3 distinct rollableTables and passes the values to a procedure called LibShaan_CompareJE that I stored in a dedicated library. below is the code of the main card : !scriptcard {{ +++Shaan_Proc+++ --#title|Technique --#reentrant|Technique --#evenRowBackground|#E8E89F --#oddRowBackground|#FBFBBE --#buttonfontsize|12 --#tableBorderRadius|6px --#sourceToken|@{selected|token_id} --#emotestate|hidden --#whisper|self --#titleCardBackground|#DCC21E --~dummy|array;pagetokens;myarray;@{selected|token_id} --~count|array;selectedtokens;TableauTokensSelected --/Total:|[&count] jetons sélectionnés ! --~testvar|array;getfirst;TableauTokensSelected --:loop| --=DéAme|[T#Ame] --=DéCorps|[T#Corps] --=DéEsprit|[T#Esprit] --=Bonus|?{Bonus|0} --?[*S:EngrenagesPJ_Bonus] -ninc "0" |EngN0|Eng0 --:Eng0| --#buttonbackground|#F9E986 --#buttonTextColor|#000000 --+|[l][rbutton]Engrenages 🎲::Engrenages[/rbutton][/l] [r][*[&testvar]:EngrenagesPJ_Bonus] - [*[&testvar]:EngrenagesPJ_Acquis][/r] --^T1| --:EngN0| --#buttonbackground|#DCC21E --#buttonTextColor|#FFFFFF --+|[l][rbutton]Engrenages 🎲::Engrenages[/rbutton][/l] [r][b][*[&testvar]:EngrenagesPJ_Bonus] - [*[&testvar]:EngrenagesPJ_Acquis][/b][/r] --:T1| --?[*[&testvar]:PilotagePJ_Bonus] -ninc "0" |PilN0|Pil0 --:Pil0| --#buttonbackground|#F9E986 --#buttonTextColor|#000000 --+|[l][rbutton]Pilotage 🎲::Pilotage[/rbutton][/l][r][*[&testvar]:PilotagePJ_Bonus] - [*[&testvar]:PilotagePJ_Acquis][/r] --^T2| --:PilN0| --#buttonbackground|#DCC21E --#buttonTextColor|#FFFFFF --+|[l][rbutton]Pilotage 🎲::Pilotage[/rbutton][/l][r][b][*[&testvar]:PilotagePJ_Bonus] - [*[&testvar]:PilotagePJ_Acquis][/b][/r] --:T2| --?[*[&testvar]:RecuperationPJ_Bonus] -ninc "0" |RecN0|Rec0 --:Rec0| --#buttonbackground|#F9E986 --#buttonTextColor|#000000 --+|[l][rbutton]Récupération 🎲::Recuperation[/rbutton][/l][r][*[&testvar]:RecuperationPJ_Bonus] - [*[&testvar]:RecuperationPJ_Acquis][/r] --^T3| --:RecN0| --#buttonbackground|#DCC21E --#buttonTextColor|#FFFFFF --+|[l][rbutton]Récupération 🎲::Recuperation[/rbutton][/l][r][b][*[&testvar]:RecuperationPJ_Bonus] - [*[&testvar]:RecuperationPJ_Acquis][/b][/r] --:T3| --?[*[&testvar]:SensPierrePJ_Bonus] -ninc "0" |SpiN0|Spi0 --:Spi0| --#buttonbackground|#F9E986 --#buttonTextColor|#000000 --+|[l][rbutton]Sens de la Pierre 🎲::SensPierre[/rbutton][/l][r][*[&testvar]:SensPierrePJ_Bonus] - [*[&testvar]:SensPierrePJ_Acquis][/r] --^T4| --:SpiN0| --#buttonbackground|#DCC21E --#buttonTextColor|#FFFFFF --+|[l][rbutton]Sens de la Pierre 🎲::SensPierre[/rbutton][/l][r][b][*[&testvar]:SensPierrePJ_Bonus] - [*[&testvar]:SensPierrePJ_Acquis][/b][/r] --:T4| --?[*[&testvar]:SensBoisPJ_Bonus] -ninc "0" |SboN0|Sbo0 --:Sbo0| --#buttonbackground|#F9E986 --#buttonTextColor|#000000 --+|[l][rbutton]Sens du Bois 🎲::SensBois[/rbutton][/l][r][*[&testvar]:SensBoisPJ_Bonus] - [*[&testvar]:SensBoisPJ_Acquis][/r] --^T5| --:SboN0| --#buttonbackground|#DCC21E --#buttonTextColor|#FFFFFF --+|[l][rbutton]Sens du Bois 🎲::SensBois[/rbutton][/l][r][b][*[&testvar]:SensBoisPJ_Bonus] - [*[&testvar]:SensBoisPJ_Acquis][/b][/r] --:T5| --?[*[&testvar]:SensCuirPJ_Bonus] -ninc "0" |ScuN0|Scu0 --:Scu0| --#buttonbackground|#FAAE1E --#buttonTextColor|#990000 --&Rouge|990000 --+|[l][rbutton]Sens du Cuir 🎲::SensCuir[/rbutton][/l][r][#[&Rouge]][*[&testvar]:SensCuirPJ_Bonus] - [*[&testvar]:SensCuirPJ_Acquis][/#][/r] --^T6| --:ScuN0| --#buttonbackground|#DCA51E --#buttonTextColor|#FFFFFF --&Rouge|990000 --+|[l][rbutton]Sens du Cuir 🎲::SensCuir[/rbutton][/l][r][b][#[&Rouge]][*[&testvar]:SensCuirPJ_Bonus] - [*[&testvar]:SensCuirPJ_Acquis][/#][/b][/r] --:T6| --?[*[&testvar]:SensMetalPJ_Bonus] -ninc "0" |SmeN0|Sme0 --:Sme0| --#buttonbackground|#F9E986 --#buttonTextColor|#000000 --+|[l][rbutton]Sens du Métal 🎲::SensMetal[/rbutton][/l][r][*[&testvar]:SensMetalPJ_Bonus] - [*[&testvar]:SensMetalPJ_Acquis][/r] --^T7| --:SmeN0| --#buttonbackground|#DCC21E --#buttonTextColor|#FFFFFF --+|[l][rbutton]Sens du Métal 🎲::SensMetal[/rbutton][/l][r][b][*[&testvar]:SensMetalPJ_Bonus] - [*[&testvar]:SensMetalPJ_Acquis][/b][/r] --:T7| --?[*[&testvar]:SensTissuPJ_Bonus] -ninc "0" |StiN0|Sti0 --:Sti0| --#buttonbackground|#F9E986 --#buttonTextColor|#000000 --+|[l][rbutton]Sens du Tissu 🎲::SensTissu[/rbutton][/l][r][*[&testvar]:SensTissuPJ_Bonus] - [*[&testvar]:SensTissuPJ_Acquis][/r] --^T8| --:StiN0| --#buttonbackground|#DCC21E --#buttonTextColor|#FFFFFF --+|[l][rbutton]Sens du Tissu 🎲::SensTissu[/rbutton][/l][r][b][*[&testvar]:SensTissuPJ_Bonus] - [*[&testvar]:SensTissuPJ_Acquis][/b][/r] --:T8| --?[*[&testvar]:SensVerrePJ_Bonus] -ninc "0" |SveN0|Sve0 --:Sve0| --#buttonbackground|#F9E986 --#buttonTextColor|#000000 --+|[l][rbutton]Sens du Verre 🎲::SensVerre[/rbutton][/l][r][*[&testvar]:SensVerrePJ_Bonus] - [*[&testvar]:SensVerrePJ_Acquis][/r] --^T9| --:SveN0| --#buttonbackground|#DCC21E --#buttonTextColor|#FFFFFF --+|[l][rbutton]Sens du Verre 🎲::SensVerre[/rbutton][/l][r][b][*[&testvar]:SensVerrePJ_Bonus] - [*[&testvar]:SensVerrePJ_Acquis][/b][/r] --:T9| --?[*[&testvar]:TechnologiePJ_Bonus] -ninc "0" |TecN0|Tec0 --:Tec0| --#buttonbackground|#F9E986 --#buttonTextColor|#000000 --+|[l][rbutton]Technologie 🎲::Technologie[/rbutton][/l][r][*[&testvar]:TechnologiePJ_Bonus] - [*[&testvar]:TechnologiePJ_Acquis][/r] --^T10| --:TecN0| --#buttonbackground|#DCC21E --#buttonTextColor|#FFFFFF --+|[l][rbutton]Technologie 🎲::Technologie[/rbutton][/l][r][b][*[&testvar]:TechnologiePJ_Bonus] - [*[&testvar]:TechnologiePJ_Acquis][/b][/r] --:T10| --?[*[&testvar]:AutreTechniquePJ_Bonus] -ninc ""|AteN0|Ate0 --:Ate0| --#buttonbackground|#F9E986 --#buttonTextColor|#000000 --+|[l][rbutton]Autre Technique 🎲::AutreTechnique[/rbutton][/l][r][*[&testvar]:AutreTechniquePJ_Bonus] - [*[&testvar]:AutreTechniquePJ_Acquis][/r] --^Fin| --:AteN0| --#buttonbackground|#DCC21E --#buttonTextColor|#FFFFFF --+|[l][rbutton]Autre Technique 🎲::AutreTechnique[/rbutton][/l][r][b][*[&testvar]:AutreTechniquePJ_Bonus] - [*[&testvar]:AutreTechniquePJ_Acquis][/b][/r] --~testvar|array;getnext;TableauTokensSelected --?[&testvar] -ne ArrayError|loop --:Fin| --X| --:Engrenages| -->LibShaan_CompareJE|[$DéEsprit.tableEntryValue];[$DéAme.tableEntryValue];[$DéCorps.tableEntryValue];[*[&testvar]:technique_base];Engrenages;Technique;[*[&testvar]:fooEncMalusPJ];[$Bonus];[*[&testvar]:token_id] --X| --:Pilotage| -->LibShaan_CompareJE|[$DéEsprit.tableEntryValue];[$DéAme.tableEntryValue];[$DéCorps.tableEntryValue];[*[&testvar]:technique_base];Pilotage;Technique;[*[&testvar]:fooEncMalusPJ];[$Bonus];[*[&testvar]:token_id] --X| --:Recuperation| -->LibShaan_CompareJE|[$DéEsprit.tableEntryValue];[$DéAme.tableEntryValue];[$DéCorps.tableEntryValue];[*[&testvar]:technique_base];Recuperation;Technique;[*[&testvar]:fooEncMalusPJ];[$Bonus];[*[&testvar]:token_id] --X| --:SensPierre| -->LibShaan_CompareJE|[$DéEsprit.tableEntryValue];[$DéAme.tableEntryValue];[$DéCorps.tableEntryValue];[*[&testvar]:technique_base];SensPierre;Technique;[*[&testvar]:fooEncMalusPJ];[$Bonus];[*[&testvar]:token_id] --X| --:SensBois| -->LibShaan_CompareJE|[$DéEsprit.tableEntryValue];[$DéAme.tableEntryValue];[$DéCorps.tableEntryValue];[*[&testvar]:technique_base];SensBois;Technique;[*[&testvar]:fooEncMalusPJ];[$Bonus];[*[&testvar]:token_id] --X| --:SensCuir| -->LibShaan_CompareJE|[$DéEsprit.tableEntryValue];[$DéAme.tableEntryValue];[$DéCorps.tableEntryValue];[*[&testvar]:technique_base];SensCuir;Technique;[*[&testvar]:fooEncMalusPJ];[$Bonus];[*[&testvar]:token_id] --X| --:SensMetal| -->LibShaan_CompareJE|[$DéEsprit.tableEntryValue];[$DéAme.tableEntryValue];[$DéCorps.tableEntryValue];[*[&testvar]:technique_base];SensMetal;Technique;[*[&testvar]:fooEncMalusPJ];[$Bonus];[*[&testvar]:token_id] --X| --:SensTissu| -->LibShaan_CompareJE|[$DéEsprit.tableEntryValue];[$DéAme.tableEntryValue];[$DéCorps.tableEntryValue];[*[&testvar]:technique_base];SensTissu;Technique;[*[&testvar]:fooEncMalusPJ];[$Bonus];[*[&testvar]:token_id] --X| --:SensVerre| -->LibShaan_CompareJE|[$DéEsprit.tableEntryValue];[$DéAme.tableEntryValue];[$DéCorps.tableEntryValue];[*[&testvar]:technique_base];SensVerre;Technique;[*[&testvar]:fooEncMalusPJ];[$Bonus];[*[&testvar]:token_id] --X| --:Technologie| -->LibShaan_CompareJE|[$DéEsprit.tableEntryValue];[$DéAme.tableEntryValue];[$DéCorps.tableEntryValue];[*[&testvar]:technique_base];Technologie;Technique;[*[&testvar]:fooEncMalusPJ];[$Bonus];[*[&testvar]:token_id] --X| --:AutreTechnique| -->LibShaan_CompareJE|[$DéEsprit.tableEntryValue];[$DéAme.tableEntryValue];[$DéCorps.tableEntryValue];[*[&testvar]:technique_base];AutreTechnique;Technique;[*[&testvar]:fooEncMalusPJ][$Bonus];[*[&testvar]:token_id] --X| }} So when i hit The Technologie button here's what I get : By pure luck every thing seems fine but in fact as my Technique level is equal to 6 (which is <10), I should be going through the NOMAIT (NoMastery) instructions loop and i should'nt be offerd the last option (blue & red dice added). But even worse, when I choose to click on the best option (yellow+blue for a total of 6 which is perfectly <= technique) here's what I get : It only took the Yellow dice value and added Spec & Acquis for a total of 4 ! Here's my stored procedure below : --:LibShaan_CompareJE|DéEsprit;DéAme;DéCorps;target;spec;domaine;enc;bonus;tokenid   --#evenRowBackground|#abceed   --#oddRowBackground|#eeeeee   --#sourceToken|@{selected|token_id}   --#emoteText|[*S:character_name] utilise [%5%]   --&Rouge|990000   --&Vert|007700      --=E|[%1%]   --=A|[%2%]   --=C|[%3%]   --=EA|[%1%]+[%2%]   --=EC|[%1%]+[%3%]   --=AC|[%2%]+[%3%]    --=EAC|[%1%]+[%2%]+[%3%]   --=BonusSpec|[*S:[%5%]PJ_Bonus]   --=BonusAcquis|[*S:[%5%]PJ_Acquis]      --?[%6%] -inc Arts|JEArts   --?[%6%] -inc Shaan|JEShaan   --?[%6%] -inc Magie|JEMagie   --?[%6%] -inc Rituels|JERituels   --?[%6%] -inc Survie|JESurvie   --?[%6%] -inc Combat|JECombat   --?[%6%] -inc Necrose|JENecrose   --?[%6%] -inc Technique|JETechnique   --?[%6%] -inc Savoir|JESavoir   --?[%6%] -inc Social|JESocial   --:JEArts|     --#title|[%5%] ([%6%]: [*S:art_base])   --^JEsubs|   --:JEShaan|     --#title|[%5%] ([%6%]: [*S:shaan_base])   --^JEsubs|   --:JEMagie|     --#title|[%5%] ([%6%]: [*S:magie_base])   --^JEsubs|   --:JERituels|     --#title|[%5%] ([%6%]: [*S:rituel_base])   --^JEsubs|   --:JESurvie|     --#title|[%5%] ([%6%]: [*S:survie_base])   --^JEsubs|   --:JECombat|     --#title|[%5%] ([%6%]: [*S:combat_base])   --^JEsubs|   --:JENecrose|     --#title|[%5%] ([%6%]: [*S:necrose_base])   --^JEsubs|   --:JETechnique|     --#title|[%5%] ([%6%]: [*S:technique_base])     --^JEsubs|     --:JESavoir|     --#title|[%5%] ([%6%]: [*S:savoir_base])     --^JEsubs|   --:JESocial|     --#title|[%5%] ([%6%]: [*S:social_base])     --^JEsubs|   --:JEsubs|     --#leftsub|Spécialisation: [*S:[%5%]PJ_Bonus]     --#rightsub|Acquis: [*S:[%5%]PJ_Acquis]     --^JES0|      --:JES0|symbiose ou pas    --+|[img][$DéEsprit.tableEntryImgURL][/img] - [img width=40 height=40][$DéAme.tableEntryImgURL][/img]- [img width=40 height=40][$DéCorps.tableEntryImgURL][/img]    --?[%1%] -eq [%2%] -and [%2%] -eq [%3%]|JES1|JEB1   --:JES1|Symbiose de 10 ou pas        --?[%1%] -eq 10|JESymb10|JESymb   --:JESymb10|Symbiose de 10       --+|[c][#[&Rouge]][b]~~~Symbiose de 10 - Echec critique ! !~~~[/b][/#][/c]       --=HitScore|[$BonusSpec][Spécialisation] + [$BonusAcquis][Acquis] -10   --+Score final|[$HitScore]   --^JEEnd|Jumps to JEEnd   --:JESymb|si pas symbiose de 10 quel type de Symbiose (parfaite ou normale)?       --?[%1%] -le [%4%]|JESymbp|JESymbn    --:JESymbp|Symbiose parfaite ou Réussite critique        --+|[c][#[&Vert]][b]~~~Symbiose parfaite!~~~[/b][/#][/c]       --=HitScore|[$E][Jet] + [$BonusSpec][Spécialisation] + [$BonusAcquis][Acquis] +10   --+Score final|[$HitScore]   --^JEEnd|Jumps to JEEnd    --:JESymbn|Symbiose  ou Belle Réussite        --+|[c][#[&Vert]][b]~~~Symbiose !~~~[/b][/#][/c]       --=HitScore|[$BonusSpec][Spécialisation] + [$BonusAcquis][Acquis] +10   --+Score final|[$HitScore]   --^JEEnd|Jumps to JEEnd    --:JEB1|maitrise ou non        --?[%4%] -le 10|JENOMAIT|JEMAIT    --:JEMAIT| boucle Maitrise --?[%1%] -le [%4%]|E|NE --:E|   --#buttonbackground|#DADAD7   --#buttonTextColor|#000000   --+|[l][rbutton][b]Garder dé d'Action[/b] [img width=20 height=20][$DéEsprit.tableEntryImgURL][/img]::UESPRIT[/rbutton][/l]   --?[%2%] -le [%4%]|E_A|E_NA   --:E_A|    --#buttonbackground|#DADAD7    --#buttonTextColor|#000000    --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéAme.tableEntryImgURL][/img]::PRAME[/rbutton][/l]    --?[$EA] -le [%4%]|E_A_EA|E_A_NEA    --:E_A_EA| --#buttonbackground|#DADAD7     --#buttonTextColor|#000000 --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéEsprit.tableEntryImgURL][/img] + [img width=20 height=20][$DéAme.tableEntryImgURL][/img]::PCAME[/rbutton][/l]     --?[%3%] -le [%4%]|E_A_EA_C|E_A_EA_NC     --:E_A_EA_C|      --#buttonbackground|#DADAD7      --#buttonTextColor|#000000 --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]::PRCORPS[/rbutton][/l]    --?[$EC] -le [%4%]|E_A_EA_C_EC|E_A_EA_C_NEC      --:E_A_EA_C_EC|   --#buttonbackground|#DADAD7       --#buttonTextColor|#000000   --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéEsprit.tableEntryImgURL][/img] + [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]::PCCORPS[/rbutton][/l]     --?[$AC] -le [%4%]|E_A_EA_C_EC_AC|E_A_EA_C_EC_NAC   --:E_A_EA_C_EC_AC|    --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéAme.tableEntryImgURL][/img] + [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]::PRAMECORPS[/rbutton][/l]     --?[$EAC] -le [%4%]|E_A_EA_C_EC_AC_EAC|E_A_EA_C_EC_AC_EAC    --:E_A_EA_C_EC_AC_EAC|     --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéEsprit.tableEntryImgURL][/img] + [img width=20 height=20][$DéAme.tableEntryImgURL][/img] + [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]::PCAMECORPS[/rbutton][/l]     --:E_A_EA_C_EC_AC_NEAC|     --^JEEnd|   --:E_A_EA_C_EC_NAC|    --^JEEnd|      --:E_A_EA_C_NEC|   --^JEEnd| --:E_A_EA_NC| --^JEEnd|    --:E_A_NEA|    --?[%3%] -le [%4%]|E_A_NEA_C|E_A_NEA_NC     --:E_A_NEA_C| --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]::PRCORPS[/rbutton][/l]      --?[$EC] -le [%4%]|E_A_NEA_C_EC|E_A_NEA_C_NEC     --:E_A_NEA_NC| --^JEEnd| --:E_A_NEA_C_EC| --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéEsprit.tableEntryImgURL][/img] + [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]::PCCORPS[/rbutton][/l]     --:E_A_NEA_C_NEC| --^JEEnd|   --:E_NA|    --?[%3%] -le [%4%]|E_NA_C|E_NA_NC     --:E_NA_C| --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]::PRCORPS[/rbutton][/l]      --?[$EC] -le [%4%]|E_NA_C_EC|E_NA_C_NEC --:E_NA_NC| --^JEEnd|      --:E_NA_C_EC| --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéEsprit.tableEntryImgURL][/img] + [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]::PCCORPS[/rbutton][/l]      --:E_NA_C_NEC|   --^JEEnd| --:NE| --?[%1%] -eq 10|NE_10|NE_N10 --:NE_10| --+|[l][b]Echec - Puiser dé d'action[/b][/l][r][rbutton]👎::PE[/rbutton][/r]   --?[%2%] -le [%4%]|NE_10_A|NE_10_NA   --:NE_10_A|   --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéAme.tableEntryImgURL][/img]::PRAME[/rbutton][/l]    --?[%3%] -le [%4%]|NE_10_A_C|NE_10_A_NC    --:NE_10_A_C|    --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]::PRCORPS[/rbutton][/l]     --?[%2%]+[%3%] -le [%4%]|NE_10_A_C_AC|NE_10_A_C_NAC     --:NE_10_A_C_AC|     --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéAme.tableEntryImgURL][/img] + [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]::PRAMECORPS[/rbutton][/l]     --:NE_10_A_C_NAC|    --:NE_10_A_NC|   --:NE_10_NA| --:NE_10_NA_C| --:NE_10_NA_NC| --^PE| --:NE_N10| --?[%2%] -le [%4%]|NE_N10_A|NE_N10_NA --:NE_N10_A|   --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéAme.tableEntryImgURL][/img]::PRAME[/rbutton][/l]   --?[%3%] -le [%4%]|NE_N10_A_C|NE_N10_A_NC   --:NE_N10_A_C|   --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]::PRCORPS[/rbutton][/l]    --?[%2%]+[%3%] -le [%4%]|NE_N10_A_C_AC|NE_N10_A_C_NAC    --:NE_N10_A_C_AC|    --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéAme.tableEntryImgURL][/img] + [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]::PRAMECORPS[/rbutton][/l]    --:NE_N10_A_C_NAC|   --:NE_N10_A_NC| --:NE_N10_NA| --:NE_N10_NA_C| --:NE_N10_NA_NC| --^JEEchec|    --:JENOMAIT|  boucle normale   --?[%1%] -le [%4%]|2E|2NE --:2E|   --+|[l][rbutton][b]Garder dé d'Action[/b] [img width=20 height=20][$DéEsprit.tableEntryImgURL][/img]::UESPRIT[/rbutton][/l]   --?[%2%] -le [%4%]|2E_A|2E_NA   --:2E_A|    --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéAme.tableEntryImgURL][/img]::PRAME[/rbutton][/l]    --?[$EA] -le [%4%]|2E_A_EA|2E_A_NEA    --:2E_A_EA|     --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéEsprit.tableEntryImgURL][/img] + [img width=20 height=20][$DéAme.tableEntryImgURL][/img]::PCAME[/rbutton][/l]     --?[%3%] -le [%4%]|2E_A_EA_C|2E_A_EA_NC     --:2E_A_EA_C|      --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]::PRCORPS[/rbutton][/l]      --?[$EC] -le [%4%]|2E_A_EA_C_EC|2E_A_EA_C_NEC      --:2E_A_C_EA_EC|   --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéEsprit.tableEntryImgURL][/img] + [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]::PCCORPS[/rbutton][/l]   --?[$EAC] -le [%4%]|2E_A_EA_C_EC_EAC|2E_A_EA_C_EC_NEAC    --:2E_A_EA_C_EC_EAC|    --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéAme.tableEntryImgURL][/img] + [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]::PRAMECORPS[/rbutton][/l]    --:2E_A_EA_C_EC_NEAC| --^JEEnd|      --:2E_A_EA_C_NEC|   --^JEEnd| --:2E_A_EA_NC| --^JEEnd|    --:2E_A_NEA|    --?[%3%] -le [%4%]|2E_A_NEA_C|2E_A_NEA_NC     --:2E_A_NEA_C|      --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]::PRCORPS[/rbutton][/l] --?[$EC] -le [%4%]|2E_A_NEA_C_EC|2E_A_NEA_C_NEC       --:2E_A_NEA_C_EC|    --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéAme.tableEntryImgURL][/img] + [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]::PRAMECORPS[/rbutton][/l]       --:2E_A_NEA_C_NEC|    --^JEEnd|     --:2E_A_NEA_NC| --^JEEnd| --:2E_NA| --?[%3%] -le [%4%]|2E_NA_C|2E_NA_NC --:2E_NA_C| --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]::PRCORPS[/rbutton][/l] --?[$EC] -le [%4%]|2E_NA_C_EC|2E_NA_C_NEC --:2E_NA_C_EC|   --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéEsprit.tableEntryImgURL][/img] + [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]::PCCORPS[/rbutton][/l] --:2E_NA_C_NEC| --^JEEnd| --:2E_NA_NC| --^JEEnd| --:2NE| --?[%1%] -eq 10|2NE_10|2NE_N10 --:2NE_10| --+|[l][rbutton][b]Echec - Puiser [/b][img width=20 height=20][$DéEsprit.tableEntryImgURL][/img]::PE[/rbutton][/l]   --?[%2%] -le [%4%]|2NE_10_A|2NE_10_NA   --:2NE_10_A|   --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéAme.tableEntryImgURL][/img]::PRAME[/rbutton][/l]    --?[%3%] -le [%4%]|2NE_10_A_C|2NE_10_A_NC    --:2NE_10_A_C|    --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]::PRCORPS[/rbutton][/l]     --?[$AC] -le [%4%]|2NE_10_A_C_AC|2NE_10_A_C_NAC     --:2NE_10_A_C_AC|     --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéAme.tableEntryImgURL][/img] + [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]::PRAMECORPS[/rbutton][/l]     --:2NE_10_A_C_NAC| --^JEEnd|    --:2NE_10_A_NC|     --^JEEnd|   --:2NE_10_NA|   --?[%3%] -le [%4%]|2NE_10_NA_C|2NE_10_NA_NC    --:2NE_10_NA_C|     --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]::PRCORPS[/rbutton][/l] --^JEEnd|    --:2NE_10_NA_NC|     --^JEPE| --:2NE_N10| --?[%2%] -le [%4%]|2NE_N10_A|2NE_N10_NA --:2NE_N10_A| --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéAme.tableEntryImgURL][/img]::PRAME[/rbutton][/l]   --?[%3%] -le [%4%]|2NE_N10_A_C|2NE_N10_A_NC   --:2NE_N10_A_C|   --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]::PRCORPS[/rbutton][/l]    --?[$AC] -le [%4%]|2NE_N10_A_C_AC|2NE_N10_A_C_NAC    --:2NE_N10_A_C_AC|    --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéAme.tableEntryImgURL][/img] + [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]::PRAMECORPS[/rbutton][/l]    --:2NE_N10_A_C_NAC|     --^JEEnd|   --:2NE_N10_A_NC|   --^JEEnd| --:2NE_N10_NA|   --?[%3%] -le [%4%]|2NE_N10_NA_C|2NE_N10_NA_NC    --:2NE_N10_NA_C|    --+|[l][rbutton][b]Remplacer par [/b] [img width=20 height=20][$DéCorps.tableEntryImgURL][/img]::PRCORPS[/rbutton][/l] --^JEEnd|    --:2NE_N10_NA_NC|     --^JEEchec|    --:JEEnd|    --X|      --:JEUESPRIT| ou choix de conserver le dé d'esprit       --=HitScore|[$E][Jet] + [$BonusSpec][Spécialisation] + [$BonusAcquis][Acquis]+ [%8%] [BONUS] + [%7%] [ENC]   --+Score final|[$HitScore]   --X|   --:JEPRAME| ou choix de puiser en Ame       --=HitScore|[$A][Jet] + [$BonusSpec][Spécialisation] + [$BonusAcquis][Acquis]+ [%8%] [BONUS] + [%7%] [ENC]   -->Puiser|[%9%];2;1   --+Score final|[$HitScore]   --X|   --:JEPCAME| ou choix de compléter avec Ame       --=HitScore|[$EA][Jet] + [$BonusSpec][Spécialisation] + [$BonusAcquis][Acquis]+ [%8%] [BONUS] + [%7%] [ENC]   -->Puiser|[%9%];2;1   --+Score final|[$HitScore]   --X|   --:JEPRCORPS| ou choix de puiser en Corps       --=HitScore|[$C][Jet] + [$BonusSpec][Spécialisation] + [$BonusAcquis][Acquis]+ [%8%] [BONUS] + [%7%] [ENC]   -->Puiser|[%9%];3;1   --+Score final|[$HitScore]   --X|   --:JEPCCORPS| ou choix de compléter avec Corps       --=HitScore|[$EC][Jet] + [$BonusSpec][Spécialisation] + [$BonusAcquis][Acquis]+ [%8%] [BONUS] + [%7%] [ENC]   -->Puiser|[%9%];3;1   --+Score final|[$HitScore]   --X|   --:JEPRAMECORPS| ou choix de remplacer par Ame + Corps       --=HitScore|[$AC][Jet] + [$BonusSpec][Spécialisation] + [$BonusAcquis][Acquis]+ [%8%] [BONUS] + [%7%] [ENC]   -->Puiser|[%9%];2;1   -->Puiser|[%9%];3;1   --+Score final|[$HitScore]   --X|   --:JEPCAMECORPS| ou choix de compléter par Ame + Corps       --=HitScore|[$EAC][Jet] + [$BonusSpec][Spécialisation] + [$BonusAcquis][Acquis]+ [%8%] [BONUS] + [%7%] [ENC]   -->Puiser|[%9%];2;1   -->Puiser|[%9%];3;1   --+Score final|[$HitScore]   --X|   --:JEPE| ou échec et Fumble sur dé Action       -->Puiser|[%9%];1;-1   --+|[c][#[&Rouge]][b]~~~Fumble!~~~[/b][/#][/c]   --X|      --:JEEchec|       --+|[c][#[&Rouge]][b]~~~Echec!~~~[/b][/#][/c]   --X|      --:Puiser|Parameters are tokenid;bar#;amount --@token-mod|_ignore-selected _ids [%1%] _set bar[%2%]_value|-[%3%]   --<|    Any Help will be greatly appreciated !   
1618878902

Edited 1618878916
Ok, I have been looking at this until my eyes are near revolting out of my head, and I need someone to point out the silly, ridiculous mistake I am making.  I have this code:  --:UseDefend|Character ID, Defend Value, Damage Done --&TargetID|[%1%] --=DefendValue|[%2%] --=DamageDone|[%3%] --?[%3%] -ge [%2%]|>DefendUsed|>DefendLeft --<| --:DefendUsed| --@setattr|_silent _charid [&TargetID] _defend_value|0 --<| --:DefendLeft| --@modbattr|_silent _charid [&TargetID] _defend_value|-[$DamageDone] --<| When I debug, something weird is happening to the [&TargetID] variable.  "Line Counter: 30, Tag:>UseDefend, Content:-MWHG0P_IZgppzuZccl0;1;6" "Line Counter: 179, Tag:&TargetID, Content:-MWHG0P_IZgppzuZccl0" "Line Counter: 180, Tag:=DefendValue, Content:1" "Line Counter: 181, Tag:=DamageDone, Content:6" "Line Counter: 182, Tag:?6 -ge 1, Content:>DefendUsed|>DefendLeft" "Condition 6 -ge 1 evaluation result: true" "Line Counter: 185, Tag:@setattr, Content:_silent _charid [<span style=\"color: rgb( 64 , 64 , 64 )\">&</span>TargetID<span style=\"color: rgb( 64 , 64 , 64 )\">]</span> _defend_value|0" "Line Counter: 186, Tag:<, Content:" "Line Counter: 183, Tag:<, Content:" "Line Counter: 31, Tag:X, Content:" The target ID in the first bolded section seems to be passed just fine into the gosub, but then when further it tries to use it in the second bolded section, it seems to have some weird HTML in it? Shouldn't it be just putting  -MWHG0P_IZgppzuZccl0  in place of [&TargetID]?
And I did not mentioned the fact that the embeded call to puiser (tokenMod) to lower the proper bar by 1 according to the choice made DOES NOT seem to work.
Erik M. said: Ok, I have been looking at this until my eyes are near revolting out of my head, and I need someone to point out the silly, ridiculous mistake I am making.  I have this code:  --:UseDefend|Character ID, Defend Value, Damage Done --&TargetID|[%1%] --=DefendValue|[%2%] --=DamageDone|[%3%] --?[%3%] -ge [%2%]|>DefendUsed|>DefendLeft --<| --:DefendUsed| --@setattr|_silent _charid [&TargetID] _defend_value|0 --<| --:DefendLeft| --@modbattr|_silent _charid [&TargetID] _defend_value|-[$DamageDone] --<| When I debug, something weird is happening to the [&TargetID] variable.  "Line Counter: 30, Tag:>UseDefend, Content:-MWHG0P_IZgppzuZccl0;1;6" "Line Counter: 179, Tag:&TargetID, Content:-MWHG0P_IZgppzuZccl0" "Line Counter: 180, Tag:=DefendValue, Content:1" "Line Counter: 181, Tag:=DamageDone, Content:6" "Line Counter: 182, Tag:?6 -ge 1, Content:>DefendUsed|>DefendLeft" "Condition 6 -ge 1 evaluation result: true" "Line Counter: 185, Tag:@setattr, Content:_silent _charid [<span style=\"color: rgb( 64 , 64 , 64 )\">&</span>TargetID<span style=\"color: rgb( 64 , 64 , 64 )\">]</span> _defend_value|0" "Line Counter: 186, Tag:<, Content:" "Line Counter: 183, Tag:<, Content:" "Line Counter: 31, Tag:X, Content:" The target ID in the first bolded section seems to be passed just fine into the gosub, but then when further it tries to use it in the second bolded section, it seems to have some weird HTML in it? Shouldn't it be just putting  -MWHG0P_IZgppzuZccl0  in place of [&TargetID]? What if you replace the following line  --@setattr|_silent _charid [&TargetID] _defend_value|0 by --@setattr|_charid [*&TargetID:t_id] _defend_value|0 _silent ?
1618881494
Kurt J.
Pro
API Scripter
Erik M. said: Ok, I have been looking at this until my eyes are near revolting out of my head, and I need someone to point out the silly, ridiculous mistake I am making.  I have this code:  --:UseDefend|Character ID, Defend Value, Damage Done --&TargetID|[%1%] --=DefendValue|[%2%] --=DamageDone|[%3%] --?[%3%] -ge [%2%]|>DefendUsed|>DefendLeft --<| --:DefendUsed| --@setattr|_silent _charid [&TargetID] _defend_value|0 --<| --:DefendLeft| --@modbattr|_silent _charid [&TargetID] _defend_value|-[$DamageDone] --<| When I debug, something weird is happening to the [&TargetID] variable.  "Line Counter: 30, Tag:>UseDefend, Content:-MWHG0P_IZgppzuZccl0;1;6" "Line Counter: 179, Tag:&TargetID, Content:-MWHG0P_IZgppzuZccl0" "Line Counter: 180, Tag:=DefendValue, Content:1" "Line Counter: 181, Tag:=DamageDone, Content:6" "Line Counter: 182, Tag:?6 -ge 1, Content:>DefendUsed|>DefendLeft" "Condition 6 -ge 1 evaluation result: true" "Line Counter: 185, Tag:@setattr, Content:_silent _charid [<span style=\"color: rgb( 64 , 64 , 64 )\">&</span>TargetID<span style=\"color: rgb( 64 , 64 , 64 )\">]</span> _defend_value|0" "Line Counter: 186, Tag:<, Content:" "Line Counter: 183, Tag:<, Content:" "Line Counter: 31, Tag:X, Content:" The target ID in the first bolded section seems to be passed just fine into the gosub, but then when further it tries to use it in the second bolded section, it seems to have some weird HTML in it? Shouldn't it be just putting  -MWHG0P_IZgppzuZccl0  in place of [&TargetID]? It is because the target ID contains semicolons, which is the separator for parameters when calling subroutines. I apparently overlooked that a semicolon was a valid character to be contained in an ID, so I'll need to  consider how I can deal with that. The frustrating part is that you probably will only see this being a problem on that particular token/character because the semicolon shouldn't show up frequently. In the mean time, you can circumvent the problem by setting the &targetID variable before calling the subroutine, as it will still be valid. 
Yay, found something rare! Should go buy a lotto ticket then.  But your advice worked. The --@modbattr| _silent _charid [*[&TargetID]:character_id] _defend_value|-[$DamageDone] worked fine with the ID nested in there. 
1618884880
David M.
Pro
API Scripter
Woombak, normally I'm up for a challenge, but wow. That's over 200 lines of code with reentrant buttons, custom repeating attributes, and hefty translation work.  So, I would instead suggest one (or more) of the following: 1) add a --#debug|1 statement at the beginning of your code. This will write a bunch of lines in the api console log detailing variable values, etc. as the code is parsed and being run. Sift through the lines to see if certain values are what you expect or if certain functions are operating correctly. 2) add "caveman debugging" to your card in isolated places that you think might be relevant. Temporary print statements to display the values of certain variables or to check if a function is entered, for example: --+MyVar|[$MyVar] --+EnteredSomeFunction|[%1%] [%2] --+JustReenteredCode|CheckingSomeExpectedValue 3) It may help to temporarily put your function library into your main card. Not sure how function libraries interact with --#debug.  If you start to narrow it down to something more specific that you could point us toward, that could help. I think it's just kind of a lot at this point.
When I run the following macro, cut and pasted from the website, the results are displayed in the chat box just fine, but I get "ScriptCards Error: Label Lib5E_CheckDamageModifiers is not defined on line 4" "ScriptCards Error: Label Lib5E_CheckDamageModifiers is not defined on line 7" "ScriptCards Error: Label Lib5E_CheckDamageModifiers is not defined on line 10" "ScriptCards Error: Label Lib5E_CheckDamageModifiers is not defined on line 13" in the API Output Console. Results are the same in versions 1.1.19c & e. I'm using D&D 5E by Rol20      I have a handout named "ScriptCards Library 5E Tools" that has "--:Lib5E_CheckDamageModifiers|damageVariableName;damageType" When I cut  and pasted both code and handout, I went through notepad first, as you suggested.       The output, as far as I can tell, seems ok, but, as I said the API Output Console disagrees. Should I care?  !script {{ --whisper|gm     --#title|@{target|token_name}     --#leftsub|Dmg Mods vs Fire, Cold, Poison, Acid     -->Lib5E_CheckDamageModifiers|ResistType;fire     --=DamageRoll|2d10 [&ResistType]     --+Test:|[$DamageRoll] fire damage     -->Lib5E_CheckDamageModifiers|ResistType;cold     --=DamageRoll|2d10 [&ResistType]     --+Test:|[$DamageRoll] cold damage     -->Lib5E_CheckDamageModifiers|ResistType;poison     --=DamageRoll|2d10 [&ResistType]     --+Test:|[$DamageRoll] poison damage     -->Lib5E_CheckDamageModifiers|ResistType;acid     --=DamageRoll|2d10 [&ResistType]     --+Test:|[$DamageRoll] acid damage     --X| }}
1618932904

Edited 1618933525
sebastien g. said: Hello, Any idea why this script stops working (it was ok 3 weeks ago) : !scriptcard {{ --#title|Healing Potion --#leftsub|@{selected|token_name} -->FindPotionType|?{What type of potion?|Healing Potion|Greater Healing Potion|Superior Healing Potion|Supreme Healing Potion} --?[$PotionCount] -le 0|NoPotion --=PotionsLeft|[$PotionCount] - 1 --=HealingAmount|[&DieRoll] --+|You gulp a [&PotionType] and are healed for [$HealingAmount] HP! --@setattr|_charid @{selected|character_id} _[&AttributeRef]|[$PotionsLeft] _silent --X| --:NoPotion| --+|You don't have any [&PotionType]s left. --X| --:FindPotionType| --Rfirst|@{selected|character_id};repeating_resource --:ResourceLoop| --?"[*R:resource_left_name]" -eq "?{What type of potion?}"|>SetPotionInfo;?{What type of potion?};[*R>resource_left];[*R:resource_left] --?"[*R:resource_right_name]" -eq "?{What type of potion?}"|>SetPotionInfo;?{What type of potion?};[*R>resource_right];[*R:resource_right] --Rnext| --?"[*R:resource_left_name]" -ne "NoRepeatingAttributeLoaded"|ResourceLoop --<| --:SetPotionInfo|Params are Text Name;Attribute Reference;Attribute value --&PotionType|[%1%] --PotionType|[&PotionType] --&AttributeRef|[%2%] --=PotionCount|[%3%] --?"[&PotionType]" -eq "Healing Potion"|>SetDiceRoll;2d4 + 2 --?"[&PotionType]" -eq "Greater Healing Potion"|>SetDiceRoll;4d4 + 4 --?"[&PotionType]" -eq "Superior Healing Potion"|>SetDiceRoll;8d4 + 8 --?"[&PotionType]" -eq "Supreme Healing Potion"|>SetDiceRoll;10d4 + 20 --<| --:SetDiceRoll|Param is die roll type --&DieRoll|[%1%] --<| }} It doesn't seem to roll anything : More investigation : The script above works in another game and not in this one....I've redone the ressources, everything. I don't have a clue about what's happening......... When I import (Transmogrifier) a character from the game where the script works, it works in this game ! 
David M. said: Woombak, normally I'm up for a challenge, but wow. That's over 200 lines of code with reentrant buttons, custom repeating attributes, and hefty translation work.  So, I would instead suggest one (or more) of the following: 1) add a --#debug|1 statement at the beginning of your code. This will write a bunch of lines in the api console log detailing variable values, etc. as the code is parsed and being run. Sift through the lines to see if certain values are what you expect or if certain functions are operating correctly. 2) add "caveman debugging" to your card in isolated places that you think might be relevant. Temporary print statements to display the values of certain variables or to check if a function is entered, for example: --+MyVar|[$MyVar] --+EnteredSomeFunction|[%1%] [%2] --+JustReenteredCode|CheckingSomeExpectedValue 3) It may help to temporarily put your function library into your main card. Not sure how function libraries interact with --#debug.  If you start to narrow it down to something more specific that you could point us toward, that could help. I think it's just kind of a lot at this point. Thanks David ! The fact is that I managed to get it to work following your precious advices.... Instead of calling the dice manipulation procedure (that was in my library) I've put it back at the bottom of my script. I had many logic issues and many more typos..... it's half a victory though, as I would have liked to succeed the way I initially planed to! It's a shame 'cause I had completely commented out my code & translated it so that you wouldn't need to perfect your french (private teasing ^^) Thanks again mate !
1618937126
David M.
Pro
API Scripter
Great, glad you got it working!
Hello, I run a script with a loop on a reapeating section. The script run correctly but the console into the API say : "ScriptCards conditional error: Condition contains an invalid clause joiner. Only -and and -or are supported. Assume results are incorrect. Lisa Dunham -eq NoRepeatingAttributeLoaded" Not really a problem, the script run but i'm curious :) My script : !script {{ --/|PARAMETRES +++SR6+++ --&gt;Template_standard|standard --&gt;Entete_carte|contact_liste --&gt;Bas_carte|standard --#whisper|self --/|CARTES --+|[&amp;image_entete] --+|[&amp;espace] --Rfirst|@{selected|character_id};repeating_contacts &nbsp; &nbsp; &nbsp;--+|[&amp;espace] &nbsp; &nbsp; &nbsp;--+|[t align=center width=90%][tr][td][c][sheetbutton][*R:name]::[*R:name]::testP[/sheetbutton] [[img width=25]<a href="https://i.imgur.com/rOPGPAO.png[/img]](#" rel="nofollow">https://i.imgur.com/rOPGPAO.png[/img]](#</a>" class="showtip" title="Loyauté) [*R:loyalty] [[img width=25]<a href="https://i.imgur.com/zPNk7XR.png[/img]](#" rel="nofollow">https://i.imgur.com/zPNk7XR.png[/img]](#</a>" class="showtip" title="Réseau) [*R:connection][/c][/td][/tr][/t] &nbsp; &nbsp; &nbsp;--+|[t align=center width=100%][tr][td][c][*R:notes][/c][/td][/tr][/t] &nbsp; &nbsp; &nbsp;--+|[&amp;espace] --:Recherche_contacts| &nbsp; &nbsp; &nbsp;--Rnext| &nbsp; &nbsp; &nbsp;--?[*R:name] -eq NoRepeatingAttributeLoaded|FIN_Recherche_contacts &nbsp; &nbsp; &nbsp;--+|[t align=center width=90%][tr][td][c][sheetbutton][*R:name]::[*R:name]::testP[/sheetbutton] [[img width=25]<a href="https://i.imgur.com/rOPGPAO.png[/img]](#" rel="nofollow">https://i.imgur.com/rOPGPAO.png[/img]](#</a>" class="showtip" title="Loyauté) [*R:loyalty] [[img width=25]<a href="https://i.imgur.com/zPNk7XR.png[/img]](#" rel="nofollow">https://i.imgur.com/zPNk7XR.png[/img]](#</a>" class="showtip" title="Réseau) [*R:connection][/c][/td][/tr][/t] &nbsp; &nbsp; &nbsp;--+|[t align=center width=95%][tr][td][c][*R:notes][/c][/td][/tr][/t] &nbsp; &nbsp; &nbsp;--+|[&amp;espace] &nbsp; &nbsp; &nbsp; --&gt;Recherche_contacts| --:FIN_Recherche_contacts| --+|[&amp;image_bas] }}