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

Wow, I totally just read right over that one. Thanks, Colin!
I've cooked up a tiny scriptcard that lets you quickly add reminders to the turn order, placed right before or after the selected token's turn. !script {{   --#title|Set Reminder   --#hideCard|1   --#whisper|self   --#emoteState|hidden   --#debug|0   --#sourceToken|@{selected|token_id}       -->REMINDER_TURN_?{Remind when next turn...|Starts,START|Ends,END}|[*S:t-id];?{Name}  --X|      --:GET_CURRENT_INITIATIVE|token_id --~_CurrentInitiativeA|string;after;[%1%]","pr":";[*C:turnorder] --~_CurrentInitiative|string;before;";[&_CurrentInitiativeA] --<| --:REMINDER_TURN_START|token_id;name -->GET_CURRENT_INITIATIVE|[%1%] --=_StartofTurnInit|[&_CurrentInitiative] - 0.01 --~x|turnorder;addcustom;[%2%];[$_StartofTurnInit] --<| --:REMINDER_TURN_END|token_id;name -->GET_CURRENT_INITIATIVE|[%1%] --=_EndofTurnInit|[&_CurrentInitiative] + 0.01 --~x|turnorder;addcustom;[%2%];[$_EndofTurnInit] --<| }} On its own it's probably not particularly handy, but I think the functions can come in quite useful for larger macros involving things like 5e's "until start/end of your next turn" and "save ends" effects. Add them to the macro or library and you could do something like: -->REMINDER_TURN_END|[*T:t-id];WIS [*S:spell_save_dc] vs paralyzed It's not exactly automation, but it can certainly help with the stuff one tends to forget about in the heat of combat! You'd probably also want to add a call to an initiative management script (e.g. --@group-init|_sort) right afterwards. Note that this doesn't work well with any case where the same token has multiple initiative counts - it'll only take the top one.
1642551234
Kurt J.
Pro
API Scripter
Erik M. said: Hey Kurt,  I know there is an output line to send text that only the GM (--*)can see, but is it possible to have it the other way around? If I have a card that whispers to me as the GM, can I output a line that goes to the public chat? Thanks! Two possibilities... As Colin said, the --e link will echo an output line directly to chat. You could also remove the --#whisper setting and make the lines you want to see as GM --* lines and the lines you want public as --+ lines.
I'm using Kurt's enhanced magic missile code, with multiple targets. I can't seem to get any of the resistances to apply though. I did a test with a helmed horror, and MM did full damage against it, despite its immunity to force damage. Do I need to add something to activate the 5e library? Relevant portion of the code I'm using is as follows. Thanks. --:FireMissile|   --&ThisTarget|[&target[%1%]]   --?[&damageMode] -eq 1|=ThisMissile;1d4+1|=ThisMissile;[$OneMissileDamage]   --=MissileDamage|[$MissileDamage] + [$ThisMissile]   --+Missile|[$DisplayCount.Total] Hits [*[&ThisTarget]:character_name] for [$ThisMissile] [b]force[/b] damage   -->PlayEffects|@{selected|token_id};[&ThisTarget];none;burst-smoke;beam-magic   --=ResultantDamage|[$ThisMissile.Raw]   --?"[*[&tokenid]:npc_immunities]" -inc "[&damageType]"|Immune   --?"[*[&tokenid]:npc_resistances]" -inc "[&damageType]"|Resistant   --?"[*[&tokenid]:npc_vulnerabilities]" -inc "[&damageType]"|Vulnerable   --^DoneResist|   --:Immune|   --=ResultantDamage|0   --^DoneResist|   --:Resistant|   --=ResultantDamage|[$ThisMissile] \ 2   --^DoneResist|   --:Vulnerable|   --=ResultantDamage|[$ThisMissile] * 2   --^DoneResist|   --:DoneResist|   -->[&damageRoutine]|[&ThisTarget];[&hitPointsBar];-[$ResultantDamage.Raw]   --<|
1642614463

Edited 1642614488
While we are on the topic of the turnorder, I understand that the turnorder item can be set to automatically increment or decrement with each path " every time the custom item reaches the top of the Turn Tracker ."  Is there a way to do this with scriptcards?
I use the "ACT" API script for countdowns. !script {{ --#title|Add Counter to TurnOrder --#titleCardBackground|#932729 --#hideCard|1 --#whisper|self --#emoteState|1 --#oddRowBackground|#FFFFFF --#evenRowBackground|#FFFFFF --#debug|0 --@act| ?{Direction|Count Down,-1|Count Up,+1} ?{Starting Position|} _?{Name|} }}
Hi Kurt, I am trying to make a menu script to show my players all their options for standard, movement, and swift actions. (We play star wars saga edition) I make each ability macro in a separate char sheet and I can't seem to figure out how to call a macro from a sheet. !scriptcard{{  --#title|Standard Actions  --#leftsub|Action Name  --#rightsub| Ammo/Charges  --#whisper| self, gm  --+|[b][c]Lightsaber[/c][/b]  --+Lightsaber| [button]Swing::!
#SwingLightsaber[/button]  --+|[b][c]Force Powers[/c][/b]  --+Force Lightning Cantrip|[button]Infinite::!
%{@Roko Zain|FLC}[/button] }} In the above code, the swing lightsaber macro is in the collection tab and the FLC (force lightning cantrip) is in the player's char sheet. The lightsaber button works and calls the macro just fine, however when I run this, it says No ability was found for %{@Roko Zain|FLC}. Clicking on the button for Force Lightning then just prints @Roko Zain|FLC in text. But running %{@Roko Zain|FLC} in the chat works. Where am I going wrong here? Thanks!
For the latter, you should be able to use the [sheetbutton]Button::Character::Abilityname[/sheetbutton] format. It's not documented on the wiki. However, one thing I'm wondering about... Is it possible to have a regular reentry button call an ability, but only have it parsed after the button is clicked? Sheetbutton is useful, but sometimes you want to do another thing before or at the same time as the ability is triggered.
1642902817
Kurt J.
Pro
API Scripter
egm_melu said: For the latter, you should be able to use the [sheetbutton]Button::Character::Abilityname[/sheetbutton] format. It's not documented on the wiki. However, one thing I'm wondering about... Is it possible to have a regular reentry button call an ability, but only have it parsed after the button is clicked? Sheetbutton is useful, but sometimes you want to do another thing before or at the same time as the ability is triggered. Hmmm... It is in the wiki now :) can't believe I forgot to do that. As for the second part, it wouldn't be possible to actually run a sheet ability, since that in itself requires a user clicking on something. A reentrant button is just an api call (!sc-reentrant), It *might* be possible to have a variant of the [rbutton] syntax to include a #macro command to run before the !sc-reentrant, but there is no way to know if it will actually have taken effect by the time the reentrant code runs (and most likely it won't).
Awesome!! Thanks you guys!!
I'm having issues with macros and buttons in the scriptcard menus. It's inconsistent which I don't understand. I'm making menus for my players to minimize them having to open up their character sheets. I put in all of the different things I've tried to get the right button layout, but I'm coming up short. I've simplified it, mostly because I don't have most of the macros actually ready yet. !scriptcard {{ --#title|@{selected|character_name} Actions --#titleCardBackground|#EAC082 --#titleFontSize|20px --#bodyFontSize|16px --#buttonTextColor|#000000 --#buttonBackground|#00000000 --#buttonBorderColor|#00000000 --#buttonFontFace|Helvetica --#buttonFontSize|18px --#oddrowbackground|#82ACEA --#evenrowbackground|#B1CBF2 --+[c][u]Offense[/u][/c]| --+[button]Strike::~Macros|Fighter-Strike-1[/button]|[button] 2::~Macros::Fighter-Strike-1[/button][button] 3::~Macros::Fighter-Strike-1[/button][button] (Range)::~Macros::5-ft-Range[/button] --+[button]Strike::(~Macros|Fighter-Strike-1)[/button]|[button] 2::(~Macros|Fighter-Strike-1)[/button][button] 3::Macro[/button][button] (Range)::(~Macros|5-ft-Range)[/button] --+[sheetbutton]Strike::Macros::Fighter-Strike-1[/sheetbutton]|[sheetbutton]2::Macros::Fighter-Strike-1[/sheetbutton][sheetbutton]3::Macros::Fighter-Strike-1[/sheetbutton][sheetbutton](Range)::Macros::5-ft-Range)[/sheetbutton] --+[button]Strike::Stuff[/button]|[button]1::Stuff[/button][button]2::Stuff[/button] }} I don't know why the | shows up after Strike on row 2. Row 4 is what I want it to look like, but it doesn't have working macros attached to it. If I could get the pink boxes to go away from Row 3 I'd use that.
1643025595
Kurt J.
Pro
API Scripter
Zack B. said: I'm having issues with macros and buttons in the scriptcard menus. It's inconsistent which I don't understand. I'm making menus for my players to minimize them having to open up their character sheets. I put in all of the different things I've tried to get the right button layout, but I'm coming up short. I've simplified it, mostly because I don't have most of the macros actually ready yet. !scriptcard {{ --#title|@{selected|character_name} Actions --#titleCardBackground|#EAC082 --#titleFontSize|20px --#bodyFontSize|16px --#buttonTextColor|#000000 --#buttonBackground|#00000000 --#buttonBorderColor|#00000000 --#buttonFontFace|Helvetica --#buttonFontSize|18px --#oddrowbackground|#82ACEA --#evenrowbackground|#B1CBF2 --+[c][u]Offense[/u][/c]| --+[button]Strike::~Macros|Fighter-Strike-1[/button]|[button] 2::~Macros::Fighter-Strike-1[/button][button] 3::~Macros::Fighter-Strike-1[/button][button] (Range)::~Macros::5-ft-Range[/button] --+[button]Strike::(~Macros|Fighter-Strike-1)[/button]|[button] 2::(~Macros|Fighter-Strike-1)[/button][button] 3::Macro[/button][button] (Range)::(~Macros|5-ft-Range)[/button] --+[sheetbutton]Strike::Macros::Fighter-Strike-1[/sheetbutton]|[sheetbutton]2::Macros::Fighter-Strike-1[/sheetbutton][sheetbutton]3::Macros::Fighter-Strike-1[/sheetbutton][sheetbutton](Range)::Macros::5-ft-Range)[/sheetbutton] --+[button]Strike::Stuff[/button]|[button]1::Stuff[/button][button]2::Stuff[/button] }} I don't know why the | shows up after Strike on row 2. Row 4 is what I want it to look like, but it doesn't have working macros attached to it. If I could get the pink boxes to go away from Row 3 I'd use that. I did a little playing around, and have the following observations: When using an alpha channel specifier with button colors, it appears Roll20 overrides the color and displays the pink background. No idea why this would be happening, but I can set the color to anything without an alpha channel and get the right background color. If the alpha channel value is specified at all (even FF) the button shows in Roll20's default pink color. I even tried applying a transparent PNG file as the background image, but the pink color still overrides that. That might not be something I can fix. The reason for the extraneous | in the row is that when the command is split into tag/content (before any processing is being done) it is being split inside the button code, since it contains a |. My suggestion would be to change --+ to --+| and skip the tag completely. This is also the reason you aren't seeing the | with line 4 - there is no | inside the button code, so it gets split up properly.
I did a little playing around, and have the following observations: When using an alpha channel specifier with button colors, it appears Roll20 overrides the color and displays the pink background. No idea why this would be happening, but I can set the color to anything without an alpha channel and get the right background color. If the alpha channel value is specified at all (even FF) the button shows in Roll20's default pink color. I even tried applying a transparent PNG file as the background image, but the pink color still overrides that. That might not be something I can fi Is it possible to have even buttons and odd buttons have different backgrounds or is it all or nothing?
1643064795

Edited 1643066447
Kurt J.
Pro
API Scripter
Zack B. said: I did a little playing around, and have the following observations: When using an alpha channel specifier with button colors, it appears Roll20 overrides the color and displays the pink background. No idea why this would be happening, but I can set the color to anything without an alpha channel and get the right background color. If the alpha channel value is specified at all (even FF) the button shows in Roll20's default pink color. I even tried applying a transparent PNG file as the background image, but the pink color still overrides that. That might not be something I can fi Is it possible to have even buttons and odd buttons have different backgrounds or is it all or nothing? Buttons (and rbuttons and sheetbuttons) can have individual colors assigned, but you need to assign both the text and the background (text first, background second). After button, add a colon and the text color, a colon and the background color. This produces a white background button and a black background button on the same line: --+|[button:#000000:#ffffff]Black Button::dummy[/button] [button:#ffffff:#000000]White Button::dummy[/button]
I'm apparently too incompetent to figure this out on my own. I wanted to write a script card that will get each melee attack and spell listed in the Attacks and Spellcasting section of the 5E by Roll20 Character Sheet, and put each one into a drop down menu or separate buttons in chat window. On selection of a melee attack, the relevant information to determine whether attack hits and, if so, damage on hit (variables would be: weapon name, attack range,  character's proficiency with weapon, damage type, magic weapon bonus, base hit dice, critical hit threshold -- if different than 20, secondary damage type, secondary damage hit dice, critical hit dice) and load them into variables which I can then use to make the attack rolls, apply them to selected target's AC etc., and determine damage. I think I know what to do with the variables once I have the relevant information from the character sheet loaded into them, but I can't figure out how to do any of the other things I've listed in this post. Does anyone have any working code which does the things I'm looking for here? Any help would be greatly appreciated.
1643158309
Kurt J.
Pro
API Scripter
Dyesuhn said: I'm apparently too incompetent to figure this out on my own. I wanted to write a script card that will get each melee attack and spell listed in the Attacks and Spellcasting section of the 5E by Roll20 Character Sheet, and put each one into a drop down menu or separate buttons in chat window. On selection of a melee attack, the relevant information to determine whether attack hits and, if so, damage on hit (variables would be: weapon name, attack range,  character's proficiency with weapon, damage type, magic weapon bonus, base hit dice, critical hit threshold -- if different than 20, secondary damage type, secondary damage hit dice, critical hit dice) and load them into variables which I can then use to make the attack rolls, apply them to selected target's AC etc., and determine damage. I think I know what to do with the variables once I have the relevant information from the character sheet loaded into them, but I can't figure out how to do any of the other things I've listed in this post. Does anyone have any working code which does the things I'm looking for here? Any help would be greatly appreciated. This is one of my sample scripts that should get you most of the way there: ScriptCards/5e_Character_Action_Menu.txt at main · kjaegers/ScriptCards (github.com) Depending on the selected token when you activate it, the activating player gets a menu whispered to them with the available attacks and spells for that character (works for PCs and NPCs) from which they can activate abilities. It doesn't do absolutely everything listed above (it doesn't check for crit threshold, though I could fairly easily add that) and there are some improvements that could be made, especially with the latest ScriptCards in 1.5.5/1.5.6. Currently it doesn't actually apply damage, but I just haven't gotten around to implementing that yet.
@Kurt - I apologize if repetitive but I would like to revisit my question regarding whether the --~turnorder command can be set to automatically increment or decrement  every time an item reaches the top of the Turn Tracker .  @Will M. kindly mentioned the ACT script but I was wondering if there is a way to do this within the scriptcards command or, at least, without having to load another script for all of my games?
Kurt J. said: This is one of my sample scripts that should get you most of the way there: ScriptCards/5e_Character_Action_Menu.txt at main · kjaegers/ScriptCards (github.com) Depending on the selected token when you activate it, the activating player gets a menu whispered to them with the available attacks and spells for that character (works for PCs and NPCs) from which they can activate abilities. It doesn't do absolutely everything listed above (it doesn't check for crit threshold, though I could fairly easily add that) and there are some improvements that could be made, especially with the latest ScriptCards in 1.5.5/1.5.6. Currently it doesn't actually apply damage, but I just haven't gotten around to implementing that yet. Thanks Kurt. I'll have to play around with it more, but it looks like it gives me the key elements I was struggling with lately.
1643241734
Kurt J.
Pro
API Scripter
Michael C. said: @Kurt - I apologize if repetitive but I would like to revisit my question regarding whether the --~turnorder command can be set to automatically increment or decrement  every time an item reaches the top of the Turn Tracker .  @Will M. kindly mentioned the ACT script but I was wondering if there is a way to do this within the scriptcards command or, at least, without having to load another script for all of my games? In its current state, ScriptCards doesn't respond to any in-game events, so it will never know if something reaches the top of the turn tracker. I have been kicking around ideas for event response support in ScriptCards, but I don't have anything solid to work with at this point.
1643372588
Andreas J.
Forum Champion
Sheet Author
Translator
Kurt J. said: In its current state, ScriptCards doesn't respond to any in-game events, so it will never know if something reaches the top of the turn tracker. I have been kicking around ideas for event response support in ScriptCards, but I don't have anything solid to work with at this point. Script:Customizable Roll Listener is one existing API that is built to listen and react for certain chat events, so might be usable for some simple stuff. IIRC Scott made it a long while ago and even considered refactoring at some point, so probably not best idea to pillage it for code, but might give ideas on how you could approach it.
Is it possible for ScriptCards to interact with token tooltips?
@ Kurt J. and Andrea J.  Thanks for the ideas!  I guess I was confused by the turnorder community wiki.  It stated: " Optionally you can add a  Round Calculation  to custom items. These calculations are completed every time the custom item reaches the top of the Turn Tracker. This is particularly useful for setting up a "Round Count" object that increases by one every rotation, or setting depreciating buffs that decrease every round. "  I thought that this would be a simple matter for scriptcards to initiate since Kurt J. programmed an addcustom command to turnorder.  
1643580851
Kurt J.
Pro
API Scripter
Michael C. said: @ Kurt J. and Andrea J.  Thanks for the ideas!  I guess I was confused by the turnorder community wiki.  It stated: " Optionally you can add a  Round Calculation  to custom items. These calculations are completed every time the custom item reaches the top of the Turn Tracker. This is particularly useful for setting up a "Round Count" object that increases by one every rotation, or setting depreciating buffs that decrease every round. "  I thought that this would be a simple matter for scriptcards to initiate since Kurt J. programmed an addcustom command to turnorder.   Hmm... I'll do some experimenting. When I read the API documentation for turn order, it didn't seem there was anywhere to set the round calculation via the API, but maybe I'm missing something.
1643594606

Edited 1643594637
Hello, I am using this script but having some issues with it. 1.  First on my character sheet, I have 1+ more global modifiers assigned/checked for my weapons - however when I use execute the script it never uses these modifiers.  Looking at the script it seems that the script looks for modifiers but its not finding them - maybe? -->Find_Active_Global_Attack_Modifiers|[*S:character_id];PC_GAM Is there something else that needs set or setup I unaware of? Thanks Brad 
1643634741
Kurt J.
Pro
API Scripter
ScriptCards 1.5.8 and 5E Character Action Menu 1.7.5 I just pushed updates for ScriptCards (1.5.8) and the 5E Character Action Menu sample script (1.7.5). The biggest change in 1.5.8 is a modification to the way repeating sections are parsed when a repeating attribute contains another attribute reference. Prior to v 1.5.4, the code would attempt to recursively replace these references with actual values which was taking a long time and throwing console messages. In version 1.5.8, the @{ and } characters around the references are removed, returning the name of the referenced attribute. This allows you to then use that value when looking up a character attribute (ie, "@{strength_mod}" becomes "strength_mod") The 5E action menu uses this updated functionality to fix issues with the attack/damage rolls not including attribute bonuses. 1.7.5 also takes modified "critrange" values into account.
1643634813
Kurt J.
Pro
API Scripter
Bradley P. said: Hello, I am using this script but having some issues with it. 1.  First on my character sheet, I have 1+ more global modifiers assigned/checked for my weapons - however when I use execute the script it never uses these modifiers.  Looking at the script it seems that the script looks for modifiers but its not finding them - maybe? -->Find_Active_Global_Attack_Modifiers|[*S:character_id];PC_GAM Is there something else that needs set or setup I unaware of? Thanks Brad  I just released an update to both ScriptCards and to the Character Action Menu to address some issues. Can you do these updates and see if this resolves you issue? If not, can you post a screenshot of your active Global Attack Modifiers?
Kurt I just upgraded to the latest versions and it seems to be working.  I am working OT til Thursday and will try and get some more time on it when I can. Thanks
I tried them both but Character action menu gives me the following error,  SyntaxError: Unexpected token '{' ,and I'm not good enough to find where it appends and make the correction.
Frédéric D. said: I tried them both but Character action menu gives me the following error,  SyntaxError: Unexpected token '{' ,and I'm not good enough to find where it appends and make the correction. I think you are missing a curly bracket at the end of the script.
1643768251

Edited 1643770126
Kurt  I just did another round of tests with the new scripts.  I think there's another bug..... When I look at the output of the rolls it is off really bad.  First the 10d20 is way wrong for a to hit.  It seems that when the character sheet is set to Advantage/Disadvantage then I see the rolls below. ** EDIT **- I just noticed that in the api output window I am seeing a few errors! "SmartAoE v0.24 initialized." "-=>HealthColors v1.5.1 [Updated: April 6 2017]<=-" "-=> ScriptCards - 1.5.8 by Kurt Jaegers Ready <=- Meta Offset : 33238" "Roll20 Environment: Web" "--- Initialized It's A Trap! v3.13.1, using theme '5E-Generic' ---" "ScriptCards Error: Modify Token called without valid TokenID" "ScriptCards Error: Modify Token called without valid TokenID" "ScriptCards Error: Modify Token called without valid TokenID" "ScriptCards Error: Modify Token called without valid TokenID" "ScriptCards Error: Modify Token called without valid TokenID" "ScriptCards Error: Modify Token called without valid TokenID" Brad
1643770405

Edited 1643770453
Kurt J.
Pro
API Scripter
Bradley P. said: Kurt  I just did another round of tests with the new scripts.  I think there's another bug..... When I look at the output of the rolls it is off really bad.  First the 10d20 is way wrong for a to hit.  It seems that when the character sheet is set to Advantage/Disadvantage then I see the rolls below. ** EDIT **- I just noticed that in the api output window I am seeing a few errors! "SmartAoE v0.24 initialized." "-=>HealthColors v1.5.1 [Updated: April 6 2017]<=-" "-=> ScriptCards - 1.5.8 by Kurt Jaegers Ready <=- Meta Offset : 33238" "Roll20 Environment: Web" "--- Initialized It's A Trap! v3.13.1, using theme '5E-Generic' ---" "ScriptCards Error: Modify Token called without valid TokenID" "ScriptCards Error: Modify Token called without valid TokenID" "ScriptCards Error: Modify Token called without valid TokenID" "ScriptCards Error: Modify Token called without valid TokenID" "ScriptCards Error: Modify Token called without valid TokenID" "ScriptCards Error: Modify Token called without valid TokenID" Brad Oops. I was testing the critical code and left advantage rolling 10d20 instead of 2d20 :) I just uploaded a fix. I'll take a look at the modify errors.
1643861132

Edited 1643861204
Hey, Has anyone made any scriptCards for gambling games? Like Roulette, Slots, etc.? I'm trying to figure out how to do this, but it's been too long since I worked with these, and everything I thought I knew, went out the window. It's like starting from scratch again.
Kurt The new script is better but there still seems to be an issue with the first roll. Brad
1643940861
Kurt J.
Pro
API Scripter
Bradley P. said: Kurt The new script is better but there still seems to be an issue with the first roll. Brad What issue are you having? In the results line, the 2d20 came up with a 12 and a 17, and the 12 was dropped (hence the [x x] around it and the 17 kept.
1643940939
Kurt J.
Pro
API Scripter
Arthur B. said: Hey, Has anyone made any scriptCards for gambling games? Like Roulette, Slots, etc.? I'm trying to figure out how to do this, but it's been too long since I worked with these, and everything I thought I knew, went out the window. It's like starting from scratch again. I started putting one together for fun. I have 5 games done from this thread:  Community Forums: Gambling Roller of Macros | Roll20: Online virtual tabletop  and am working on a couple more and will put it up on the GitHub sometime this weekend.
Kurt J. said: Arthur B. said: Hey, Has anyone made any scriptCards for gambling games? Like Roulette, Slots, etc.? I'm trying to figure out how to do this, but it's been too long since I worked with these, and everything I thought I knew, went out the window. It's like starting from scratch again. I started putting one together for fun. I have 5 games done from this thread:  Community Forums: Gambling Roller of Macros | Roll20: Online virtual tabletop  and am working on a couple more and will put it up on the GitHub sometime this weekend. Sounds cool, will you let me know when you post it?
1643952296
Kurt J.
Pro
API Scripter
Sounds cool, will you let me know when you post it? I just uploaded it to the GitHub ( Casino Games ScriptCard Example ). It is very customizable (see the settings area at the top). This was inspired by Nick Olivo's video HERE , and based on the PowerCards macros created by Ziechael HERE . Thanks Arthur B for the suggestion. The script is completely system neutral. You can customize what the money is referred to as (ie, credits, gp, dollars, bucks, whatever). Payouts are all customizable as well, and some games support even further customization. Each game can be individually enabled/disabled in the settings section. When a player user the casino, all of the choices are whispered to the player (to cut down on game spam), but when they place their bet and play a game the results are shown in the normal chat for everyone to see. To keep it system neutral, there is no attempt to automatically modify money values on character sheets, so that will need to be tracked manually.
Kurt J. said: I just uploaded it to the GitHub ( Casino Games ScriptCard Example ). It is very customizable (see the settings area at the top). This was inspired by Nick Olivo's video HERE , and based on the PowerCards macros created by Ziechael HERE . Thanks Arthur B for the suggestion. Haha, this is exactly where I got the idea to try my hand at the scripts (Although I completely forgot everything on how to build these scripts).
1643986689

Edited 1643986824
@Arthur B/@Kurt J. - This is wonderful and timely as I have been asked to co-DM a Seven Sins game and the casino will be perfect for a "lust for money" scenario.  I have found a few issues in the Casino Games Scriptcard example.  Several of the dice rolls had a # sign after them (1d20#) which caused an error. The error cleared when I removed the # sign.  Also, prior to this change the slot machine would not give me anything but empty boxes: Hans tries their luck on the slot Machine   Slot Machine Hans The wheels spin...  -  -  Sorry! You lost 10 gold pieces. After I corrected the # issue, it changed to the below and I have not been able to get it to work ( Edit:  ignore repeated lost gp line - used as marker): Hans tries their luck on the slot Machine   Slot Machine Hans The wheels spin...  -  -  Sorry! You lost 0 gold pieces. You lost 0 gold pieces!
@Kurt J.  - I am not sure that this is the proper chat box for Find the Lady either. (i.e. Are the icons correct for the cards?): Hans watches closely as the dealer swaps the cards time and time again...   Find the Lady Wager: 0 ♦ Hans The dealers hands flash through a well practiced routine, with a deep breath you point to the card you believe to be "The Lady" 🃋 Sorry! 🃋 The lady eludes you. You lost 0 gold pieces.
1643989018

Edited 1643989352
Kurt I misunderstood the [x x] - I thought that that was bad not the dropped roll.  Thats good that its indicated that way so you know. I was looking at something and wondering if its possible.  I've started adding to character sheets abilities that fire off powerscript and scriptcard spells.  Is there a way that when the memorized spells are displayed that if the name of the spell exists then fire that script?  So looking at the spell Booming Blade - if Booming-Blade ability exists then execute that macro? If its that exact name does not exist then do the default behavior. Brad
1643997523
Kurt J.
Pro
API Scripter
Michael C. said: @Arthur B/@Kurt J. - This is wonderful and timely as I have been asked to co-DM a Seven Sins game and the casino will be perfect for a "lust for money" scenario.  I have found a few issues in the Casino Games Scriptcard example.  Several of the dice rolls had a # sign after them (1d20#) which caused an error. The error cleared when I removed the # sign.  Also, prior to this change the slot machine would not give me anything but empty boxes: Hans tries their luck on the slot Machine   Slot Machine Hans The wheels spin...  -  -  Sorry! You lost 10 gold pieces. After I corrected the # issue, it changed to the below and I have not been able to get it to work ( Edit:  ignore repeated lost gp line - used as marker): Hans tries their luck on the slot Machine   Slot Machine Hans The wheels spin...  -  -  Sorry! You lost 0 gold pieces. You lost 0 gold pieces! The # signs after the dice rolls are a new feature of the rewritten dice parser in v 1.5.4 and above. They prevent the roll from contributing to colonizing the result (normal, crit, or fumble). This allows things like bless to be active but not color the whole el as a crit if the d4 is a 4. Removing them should be fine, and let the script work with older version. I think only big low and in between display blighted rolls anyway. 
1643997979
Kurt J.
Pro
API Scripter
Bradley P. said: Kurt I misunderstood the [x x] - I thought that that was bad not the dropped roll.  Thats good that its indicated that way so you know. I was looking at something and wondering if its possible.  I've started adding to character sheets abilities that fire off powerscript and scriptcard spells.  Is there a way that when the memorized spells are displayed that if the name of the spell exists then fire that script?  So looking at the spell Booming Blade - if Booming-Blade ability exists then execute that macro? If its that exact name does not exist then do the default behavior. Brad This is the Spell Mule feature that is already in place in the script. In the settings area you can provide the name of a character that will be checked for matching macros for spell names.  Macros should be named exactly the same as the spell entry (case sensitive) except that spaces should be replaced with dashes.
Kurt J. said: Bradley P. said: Kurt I misunderstood the [x x] - I thought that that was bad not the dropped roll.  Thats good that its indicated that way so you know. I was looking at something and wondering if its possible.  I've started adding to character sheets abilities that fire off powerscript and scriptcard spells.  Is there a way that when the memorized spells are displayed that if the name of the spell exists then fire that script?  So looking at the spell Booming Blade - if Booming-Blade ability exists then execute that macro? If its that exact name does not exist then do the default behavior. Brad This is the Spell Mule feature that is already in place in the script. In the settings area you can provide the name of a character that will be checked for matching macros for spell names.  Macros should be named exactly the same as the spell entry (case sensitive) except that spaces should be replaced with dashes. I see that now and just got it working. Thanks!
1644017340
Kurt J.
Pro
API Scripter
I just pushed a minor update to the CasinoGames.Roll20 example that will detect if you have version 1.54+ of ScriptCards and use the new die roll # feature. If you don't have a version that supports that feature, the die rolling will fall back to normal. This really is only visible on the In Between game, as it will display red/green coloring for 1s and 20s using an older version. The red/green coloring on High Low was left in intentionally anyway :)
Is there a way to get Scriptcards to call an API from a spell description? For example, I have this setup for detect magic and when cast from the sheet it works as intended. For the duration, you sense the presence of magic within 30 feet of you. If you sense magic in this way, you can use your action to see a faint aura around any visible creature or object in the area that bears magic, and you learn its school of magic, if any. The spell can penetrate most barriers, but it is blocked by 1 foot of stone, 1 inch of common metal, a thin sheet of lead, or 3 feet of wood or dirt. For the duration, you sense the presence of magic within 30 feet of you. If you sense magic in this way, you can use your action to see a faint aura around any visible creature or object in the area that bears magic, and you learn its school of magic, if any. The spell can penetrate most barriers, but it is blocked by 1 foot of stone, 1 inch of common metal, a thin sheet of lead, or 3 feet of wood or dirt. }} !radar {{ --range|30ft --wavespacing|35 --wavedelay|50 --wavelife|200 --pinglife|4000 --wavetype|square --layers|gm, token, map --tokfilter|gmnotes: Magic#858585 --LoS|yes --title|Detect Magic --units|feet, 5e --graphOptions|grid, circle, reticle --output| graph, table, compact }} ! But when I call that spell from Scriptcards it just outputs it as text. I tried Detect Magic Testy McTesterface }} !scriptcard {{--@radar{{ _range|30ft _wavespacing|35 _wavedelay|50 _wavelife|200 _pinglife|4000 _wavetype|square _layers|gm, token, map _tokfilter|gmnotes: Magic#858585 _LoS|yes _title|Detect Magic _units|feet, 5e _graphOptions|grid, circle, reticle _output| graph, table, compact }} ! but no luck.
Kurt Last night was my game night and the Action Menu script failed to work as expected. It seems that when MOST of the players use the action menu, we see a message similar to  -Mv5JsC1KJlluXyJcqOy|Detect-Magic     Everything after the | is the spell that they were trying to use but the beginning is always the same!.  One other player and me seem to be able to use the action menu script with no problems.  All script macros are available to "All Players" so I am assuming that maybe the Spell-Mule is the problem but not sure want to do.  I rebooted the API sandbox while we were playing too but no go.   Has this been seen by others? Fix? Brad
1644237662
Kurt J.
Pro
API Scripter
Bradley P. said: Kurt Last night was my game night and the Action Menu script failed to work as expected. It seems that when MOST of the players use the action menu, we see a message similar to  -Mv5JsC1KJlluXyJcqOy|Detect-Magic     Everything after the | is the spell that they were trying to use but the beginning is always the same!.  One other player and me seem to be able to use the action menu script with no problems.  All script macros are available to "All Players" so I am assuming that maybe the Spell-Mule is the problem but not sure want to do.  I rebooted the API sandbox while we were playing too but no go.   Has this been seen by others? Fix? Brad Is the spell mule available to all players as well?
1644237909

Edited 1644237956
Kurt J.
Pro
API Scripter
Rory B. said: Is there a way to get Scriptcards to call an API from a spell description? For example, I have this setup for detect magic and when cast from the sheet it works as intended. For the duration, you sense the presence of magic within 30 feet of you. If you sense magic in this way, you can use your action to see a faint aura around any visible creature or object in the area that bears magic, and you learn its school of magic, if any. The spell can penetrate most barriers, but it is blocked by 1 foot of stone, 1 inch of common metal, a thin sheet of lead, or 3 feet of wood or dirt. For the duration, you sense the presence of magic within 30 feet of you. If you sense magic in this way, you can use your action to see a faint aura around any visible creature or object in the area that bears magic, and you learn its school of magic, if any. The spell can penetrate most barriers, but it is blocked by 1 foot of stone, 1 inch of common metal, a thin sheet of lead, or 3 feet of wood or dirt. }} !radar {{ --range|30ft --wavespacing|35 --wavedelay|50 --wavelife|200 --pinglife|4000 --wavetype|square --layers|gm, token, map --tokfilter|gmnotes: Magic#858585 --LoS|yes --title|Detect Magic --units|feet, 5e --graphOptions|grid, circle, reticle --output| graph, table, compact }} ! But when I call that spell from Scriptcards it just outputs it as text. I tried Detect Magic Testy McTesterface }} !scriptcard {{--@radar{{ _range|30ft _wavespacing|35 _wavedelay|50 _wavelife|200 _pinglife|4000 _wavetype|square _layers|gm, token, map _tokfilter|gmnotes: Magic#858585 _LoS|yes _title|Detect Magic _units|feet, 5e _graphOptions|grid, circle, reticle _output| graph, table, compact }} ! but no luck. Your call to --@ is missing its vertical bar (should be --@radar| followed by parameters) Also, you'll need to define string variables to use in place of the {{ and }}, as they would confuse the code as to what is part of the ScriptCard. Something like: --&oBrac|{ --&cBrac|} and then use them in the call: !scriptcard {{ --&oBrac|{ --&cBrac|} --@radar|[&oBrac][&oBrac] _range|30ft _wavespacing|35 _wavedelay|50 _wavelife|200 _pinglife|4000 _wavetype|square _layers|gm, token, map _tokfilter|gmnotes: Magic#858585 _LoS|yes _title|Detect Magic _units|feet, 5e _graphOptions|grid, circle, reticle _output| graph, table, compact [&cBrac][&cBrac] }}
@Kurt J. - I noticed a change needed on your (most excellent) casino script: Line 201: --?&AllowSpotBonus -eq 1|=Res;1d20 + [*S:[&SpotBonusAttribute]]|=Res;1d20 needs the brackets around &AllowSpotBonus.  (There are also some minor spelling errors that don't effect game play (e.g. "time" should be plural in 2 cases, etc.) and I leave up to designers to fix or not fix.) Also, I am currently working on the script to automatically test for sufficient money on hand to make the initial bet and to adjust a character's gp (DnD 5e) for wins and losses.  Thus, though I am sure there are better ways to approach this, I have added after the setting of the default bet:   --/|Test if default wager or change in wager exceeds player's cash on hand   --:WagerTest|      --=CashOnHand|[*S:gp]      --?[$CashOnHand.Raw] -ge [$Wager.Raw]|Remove Bet      --+|[#ffff00][b][c]You don't have enough money to play![/#][/b][/c]   --X| and...   --/|Remove bet from character's pool   --:Remove Bet|      --=GP|[*S:gp] - [$Wager.Raw]      --@setattr| _charid [*S:character_id] _gp|[$GP]  _silent above the following line...   --:DISPLAY_CASINO_MENU| Note that similar test and adjustment will need to be made after a change of wager.  Anyone working on the outcome of each game should note that (correctly) the winning variable [$Payout.Raw] effectively contains the return of the bet within the winnings while a losing wager [$Wager.Raw] contains only the bet.  In reality, the bet is forfeit when made and the payout is always a multiple of the bet in order for the winner to have a return greater than the initial bet.  A call procedure to a subroutine to adjust the character pool for winnings (no losing routine needed if the bet is deducted initially) will need to be made in each game and, for some of the games, in more than one location.  (Also still working on that.)