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 .
×

ScriptCard Help

1769228786

Edited 1769228873
I'm trying to write a Script card script to use with the new Send to Chat functionality to check if the characters passive perception noticed anything, but the comparison is not working.  No matter what I put in, it always counts as a Failure.  I want it to whisper only me (GM) when it fails and the player when success. Trying to replace the It'sATrap API :) !scriptcard {{   --#title|Passive Perception Check   --#leftsub|Awareness   --#rightsub|Hidden Check   --=Passive|@{selected|passive_wisdom}   --=DC|?{Perception DC|10}   --?[$Passive.Total] -ge [$DC.Total]|&Result;SUCCESS|&Result;FAILURE   --#section|Outcome   --?"[&Result]" eq "SUCCESS"|--#whisper|@{selected|token_name}|   --?"[&Result]" eq "FAILURE"|--#whisper|gm   --+|Passive Perception: **[$Passive]**   --+|DC: **[$DC]**   --+|Result: **[&Result]** }}
1769244873

Edited 1769275600
Hi Darryn, I have structured it slightly differently.  Your roll queries are now set as variables with --& since it makes sense to me that they are fixed values and we can get rid of the ?{query} stuff. Queries are fine but those are processed ahead of your scriptcard by Roll20, this can be desired behaviour but I like to avoid it if I can.  I also set up branches for the different outcomes.  Tested with a full dummy account, looks good. Edited  - didn't set sourceToken - what a muppet! !scriptcard {{ --#title|Passive Perception Check --#sourceToken|@{selected|token_id} --#leftsub|Awareness --#rightsub|Hidden Check --&Passive|@{selected|passive_wisdom} --&DC|20 --?[&Passive] -ge [&DC]|SUCCESS|FAILURE --X| --:SUCCESS| --#whisper|@{selected|token_name} --+|Your spidey senses tingle, there's something about this bookcase that warrants further investigation... -->END| --:FAILURE| --#whisper|gm --+|[*S:t-name] has all the spatial awareness of a prune today -->END| --:END| --x| }}