|
chaossdragon Apprentice
Joined: 09 Apr 2008 Posts: 168
|
Posted: Sat Feb 12, 2022 2:26 am
HUD trigger that may or may not include data initially |
The mud I play allows us to customize our hpbar based on the guild we are in...
out of combat
Code: |
HP: 1914/952 | SP: 378/336 | E:
C: 100.00% | F: 0.00% | D: 1
| -n- | 0% | 69.73% |
This is out of combat and upon first login after a reboot. the 1st line in-combat would show E: ##% for enemy hp status... out of combat it's just as you see above.
getting a single trigger to recognize either state with or without the ##% and able to capture the numerical value for a gauge...
3rd line has the blank space before the | which I have yet to toggle my defenses so they do not show 'yet' again as above any way to recognize either state? and atm my defenses would appear as "sD" while active.
in-combat
Code: |
HP: 1914/952 | SP: 378/336 | E: 76%
C: 100.00% | F: 0.00% | D: 1
sD | -n- | 0% | 69.73% |
I know it can be done with regex but I am trying to not mix and match zscript and regex too much... |
|
|
|
chaossdragon Apprentice
Joined: 09 Apr 2008 Posts: 168
|
Posted: Sat Feb 12, 2022 11:06 pm |
My solution so far... functional but just feels dirty lol.
Code: |
<trigger name="HUD_1" priority="330" id="33">
<pattern><![CDATA[^HP:%s&{HUD.HP}/&{HUD.MaxHP}%s|%sSP:%s&{HUD.SP}/&{HUD.MaxSP}%s|%sE:%s&{HUD.enemyStatus}$]]></pattern>
<value>//HUD.HP=%1
//HUD.MaxHP=%2
//HUD.SP=%3
//HUD.MaxSP=%4
//HUD.enemyStatus=%5
#GAG
//#SUB ""</value>
<trigger>
<pattern>^%sC:%s&{HUD.C}~%%s|%sF:%s&{HUD.F}~%%s|%sD:%s&{HUD.D}%s$</pattern>
<value>#GAG
//#SUB ""</value>
</trigger>
<trigger>
<pattern><![CDATA[^%s&{HUD.WIP}%s|%s~-&{HUD.Mode}~-%s|%s&{HUD.Charge}~%%s|%s&{HUD.GTN}$]]></pattern>
<value>#GAG
//#SUB ""</value>
</trigger>
</trigger>
|
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4715 Location: Pensacola, FL, USA
|
Posted: Fri Feb 18, 2022 12:25 pm |
There is a simple way to account for optional text in a given trigger pattern.
I tend to use this to account for the difference between first and third person perspectives, which is usually just some words are plural and others aren't.
#TR {%w launch{es|} an attack on} {do something}
It's all down to using an anonymous variable with a null member: {es|} |
|
_________________ Discord: Shalimarwildcat |
|
|
|
chaossdragon Apprentice
Joined: 09 Apr 2008 Posts: 168
|
Posted: Sat Feb 19, 2022 4:34 am |
so if I am following your here
There are three obvious exits: n, s, e
There is one obvious exit: w
would be ...
#TR {There {is|are} %w obvious exit{s|}: *} {do something} |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4715 Location: Pensacola, FL, USA
|
Posted: Wed Feb 23, 2022 5:13 pm |
Correct.
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
|
|