|
Mr. Kristopher Newbie
Joined: 14 Aug 2003 Posts: 5 Location: USA
|
Posted: Fri Jan 27, 2006 2:49 pm
Trigger problem with brackets and spaces |
I'm trying to extract the numbers from the following prompt:
Hp: 1662(1662) Gp: 253(253) Xp: 56048
I don't, however, want to extract anything when the prompt looks like this (my combat monitor):
Hp: 1435 (1662) Gp: 230 (253) Xp: 46013
First number is current hp, second is max hp, third is current gp, forth is max gp, and fifth is total xp.
The problems I'm running into are ( and ) characters because they're right next to the numbers, and also the two spaces in between the max hp and "gp:" (also appearing between max gp and "xp:")
What I have tried so far is something that looks like:
Hp: %d(%d)*Gp: %d(%d)* Xp: %d
It does trigger, but the info stored into %1 is only the last digit of the current hp. (I didn't check the remaining variables because the first one was wrong and I didn't see the point.)
I also tried this but it doesn't trigger at all:
Hp: %d~(%d~)*Gp: %d~(%d~)* Xp: %d
Any idea what I'm doing wrong? |
|
|
|
Pseudo Wanderer
Joined: 25 Oct 2005 Posts: 99
|
Posted: Fri Jan 27, 2006 4:11 pm |
Here's my suggestion:
Code: |
#REGEX {Hp:\s(\d*)\((\d*)\)\sGp:\s(\d*)\((\d*)\)\sXp:\s(\d*)} {#SHOW HP=%1/%2 GP=%3/%4 XP=%5} "" {nocr|prompt} |
or
Code: |
#ACTION {Hp: (%d)~((%d)~) Gp: (%d)~((%d)~) Xp: (%d)} {#SHOW HP=%1/%2 GP=%3/%4 XP=%5} "" {nocr|prompt} |
|
|
|
|
Mr. Kristopher Newbie
Joined: 14 Aug 2003 Posts: 5 Location: USA
|
Posted: Sat Jan 28, 2006 2:00 pm |
Thank you, it worked perfectly! I think my problem was that I didn't include the extra brackets needed for the variables (whoops!).
|
|
|
|
|
|