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

wonky Lay on Hands stuff happening

1727992249

Edited 1727992324
Dink
Pro
I have a script for Lay on Hands that works, but there is a strange glitch.  It doesn't effect the resulting totals, but unsure why it exists. Here is the code: --c?{What function do you want to use?|Healing|Remove Condition}|Healing:>Heal|Remove Condition:>Remove| --x| --:Heal| --=Available|@{selected|class_resource} --=MaxAttempted|?{Number of points to Heal} --=Attempted|[$MaxAttempted] {MAX:[$Available.Raw]} --=hpMissing|[*T:t-bar1_max] - [*T:t-bar1_value] --=Used|[$Attempted] {MAX:[$hpMissing.Raw]} --=Remaining|[$Available] - [$Used] --+Lay on Hands Pool|[$Available] --+Healing Pts Used|[$Used] ([$MaxAttempted.Raw] pts. attempted) --+Lay on Hands Pool Remaining|[$Remaining] --@modattr|_charid [*S:character_id] _class_resource|-[$Used] --@token-mod| _ids @{target|Who is Healed|token_id} _set bar1_value|+?{Number of points to Heal}! --x| --:Remove| --=Available|@{selected|class_resource} --=MaxAttempted|?{Number of conditions to remove} --=Attempted|[$MaxAttempted]*5 {MAX:[$Available.Raw]} --=CRUsed|[$Attempted] --=Remaining|[$Available] - [$CRUsed] --+Lay on Hands Pool|[$Available] --+Points Used|[$CRUsed] ([$MaxAttempted.Raw] conditions removed) --+Lay on Hands Pool Remaining|[$Remaining] --@modattr|_charid [*S:character_id] _class_resource|-[$CRUsed] --x| What's happening is that regardless which "What function you want to use?" you choose,.. both popups for "How many?" come up.  Only the "function" you choose effects the results,.. (e.g. pts. applied and deducted from resource).  pick.. Heal?  it only applies HP to target, and removes what You input...  pick Remove Condition?  it only removes 5 pts. per number of conditions you input.  Even though it asks "Both" how many's... it seems to ignore any input into the wrong query.  So.. it works,.. just has that issue with "query'ing" for both functions, even though it ignores the unchosen one. I can't find why it's doing this.   BTW - it doesn't actually do anything when removing conditions,.. just deducts the correct amount of points from the casters resource.
Was this working before and now it’s stopped working correctly? If so, then It’s  possible this is related to  this bug  and other updates that are happening to the script sandbox.  If not then hopefully someone with Scriptcards expertise can weigh in. 
No'Sir Jarren.  I just built this Script today using some others as reference.  The script actually works,.. it's just that it has a "Query" popup for both Healing and Condition Removal no matter which function you choose initially.  Again,.. it seems to ignore any input into the "wrong" query popup, but I'm just wondering why it's asking for both in the first place...
1728001918
timmaugh
Pro
API Scripter
If you're referring to the two queries: ?{Number of points to Heal} ...and... ?{Number of conditions to remove} They are always going to run, because they are Roll20 queries that will resolve before ScriptCards gets the message. The only way to suppress a second query is if it is WITHIN another query and you actually pick a different option from the parent query (ie, nested queries). With ScriptCards, you can do reentrant buttons that give you another opportunity to pose/answer queries (and ScriptCards will pick up processing with the new information you input), but if you are working with a single message then ANY query that is exposed to the Roll20 parsers will be caught, prompted, and resolved. This is a matter of the order of operations . If you want to understand more about the order and how it works with scripts (or if you're just a visual learner), you can watch the first 2 parts of this video I put together that discusses what happens on the Roll20 backend (the video is about scripts and metascripts, and how messages interact with them, but before the message even gets that far it goes through Roll20 parsing, so the video starts by discussing what happens during this phase).
1728002743

Edited 1728002839
Dink
Pro
Thanx Muchly for the info timmaugh! I just thought it would just ignore the unchosen section of the Script.  Didn't realize it would even see the unchosen section.  Will definitely take a look at the video though...  always learning!! Either way,.. the Script works.  Is just the extra step that is ignored anyway. Thanx again!!
You could get around this by simply having the two queries have the same label - the multiplier is outside the query anyway, and if you have multiple queries with the same label, they all take the answer from the first, only prompting once. Just have both as ?{How many?} or whatever, and you'll get a single prompt.
Thanx Muchly Tuo!  That worked well.  Not asthetically as pleasing to me,.. but the player will prolly never even notice.