|
AtmaWeapon Newbie
Joined: 07 Apr 2003 Posts: 9 Location: USA
|
Posted: Mon Apr 07, 2003 4:45 am
Help with trigger |
I'm trying to make a trigger that captures some information from the MUD and makes a button that shows my energy and changes colors when the energy is too low. The MUD's text is:
<Lifeforce (93) Armor (0) Energy (99)>
When outside of battle and:
<Lifeforce (93) Armor (0) Energy (99) Focus (12)>
When in battle. Battle is my problem. I am using the trigger pattern:
^<Lifeforce ~(&hp~) * Energy ~(&ener~)>
It matches the non-combat data fine. But it would seem I have to use an entirely different trigger to handle the combat line. If I use:
^<Lifeforce ~(&hp~) * Energy ~(&ener~)*>
Or any other trigger with a * in it, it gets difficult to match even the non-combat lines. Any suggestions? |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Mon Apr 07, 2003 7:52 am |
Since you know these will be numbers, use the digits wildcard %d (or numbers %n). As you have it, your second wildcard (&ener) would pick up "99) Focus (12" since it isn't limited to digits or numbers.
#TR {Lifeforce ~(&%dhp~) * Energy ~(&%dener~)}
LightBulb
Advanced Member |
|
|
|
AtmaWeapon Newbie
Joined: 07 Apr 2003 Posts: 9 Location: USA
|
Posted: Mon Apr 07, 2003 8:02 am |
But what do I do when the energy gets greater than 1,000 and I have to deal with the comma? There are less than and greater than signs at the beginning and end of the prompt, too, they are giving me trouble. It looks like
<Lifeforce (93) Armor (0) Energy (99) Focus (12)>
In battle. I've been trying to use ranges, but I guess I just don't know what I'm doing. :( |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Mon Apr 07, 2003 2:23 pm |
%n matches numbers with commas too, and when you store what it matched in a variable, the commas are not there.
To deal with the <'s and >'s, just put a ~ before them in the pattern.
Kjata |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Mon Apr 07, 2003 3:20 pm |
The easiest way to deal with the < and >, since they are the ENDS of the prompt, is to just leave them out of the pattern. If you actually need or want them in the pattern, you use a ~ before them as Kjata said. They can also be matched by the wildcards ?, *, %x, and %p.
Since this trigger is intended for use with your prompt, you may need to enable the Trigger on Prompt option. You can do this easily from the editor, it's on the Options tab.
LightBulb
Advanced Member
Edited to add second paragraph |
|
|
|
Feanor Novice
Joined: 12 Mar 2003 Posts: 37
|
Posted: Mon Apr 07, 2003 8:04 pm |
Just as a footnote here you might check out the CPPI Graphic plugin for zMUD. It makes really nice health/mana/fatigue/whatever bars that change color at user defined percentages and displays text and numeric info as well. You can get it from either the Zuggsoft home page or the zMUD download page, I can't remember which.
|
|
|
|
|
|