|
Ralph1971 Wanderer
Joined: 01 Mar 2008 Posts: 64
|
Posted: Thu Feb 24, 2011 6:45 pm
prompt |
using the prompt in the settings screen, or the #setprompt command, I want to capture the following prompt:
<1298/1298hp 392/293m 697/697mv 5,012,948gp 918 blah blah>
so far, this works..
curhp
maxhp
curmana
maxmana
curmov
maxmov
problem is, the gold.. it only captures the 5. is there a way using the setprompt or preferences/session/prompt to capture the full gold? after that is my align I want to capture to. I can use a trigger to capture it, but would rather use the built in functions of cmud (and zmud on my other putey). Also, I really don't need the cur/maxmov captured, can I not capture that, but still capture the rest (w/out the trigger) |
|
|
|
Fizgar Magician
Joined: 07 Feb 2002 Posts: 333 Location: Central Virginia
|
Posted: Thu Feb 24, 2011 8:47 pm |
#setprompt only seems to work with prompts that don't have any specially formatted numbers. When CMUD gets to the gold amount in your prompt the commas are throwing it off. Someone else may have some sort of undocumented workaround. If not, you will need to create your own trigger, to capture exactly what you want if you can't get the gold amount to be displayed without commas.
|
|
_________________ Windows Vista Home Premium SP2 32-bit
AMD Athlon Dual Core 4400+ 2.31 GHz
3 GB RAM
CMUD 3.34 |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Thu Feb 24, 2011 10:37 pm |
Use %n instead of %d for the gold number. %n matches numbers with delimiters.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Ralph1971 Wanderer
Joined: 01 Mar 2008 Posts: 64
|
Posted: Thu Feb 24, 2011 11:18 pm |
Yeah, I have a trigger to capture the prompt, I'm not talking a prompt trigger:
<1617/1617hp 906/906m 640/640mv 6,838,064gp 1000 H A [949wt] New Darkhaven
#tri {~<(%d)/(%d)hp (%d)/(%d)m (%d)/(%d)mv (%n)gp (%d)} {curhp=%1;maxhp=%2;curmana=%3;maxmana=%4;curmov=%5;maxmov=%6;gold=%7;align=%8}
I was hoping to be able to use the #setprompt.. buuuut.. the trigger works just as well..
thanks for the feedback, folks :) |
|
_________________ Win7-home - Cmud 3.33a
WinXP-pro - Zmud 7.21 |
|
|
|
Ithilion Wanderer
Joined: 02 Sep 2005 Posts: 85
|
Posted: Thu Feb 24, 2011 11:31 pm |
To answer your question, no, you would need a trigger because #setprompt doesn't work in this case, because it stops at the delimiters
Use () when you want to capture, and no () when you don't, if you're making a trigger..
i.e.
Code: |
%d/%dhp (%d)/(%d)m etc etc |
would trigger the hp, but not capture it, because of no parentheses, while the mana would be, because of parentheses. |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Thu Feb 24, 2011 11:46 pm |
MattLofton wrote: |
Use %n instead of %d for the gold number. %n matches numbers with delimiters. |
If I recall correctly, %f is the new way of catching numbers. It was mentioned and introduced a few versions back, I think, though my reference of time may be off. Regardless, %n still works as normal. |
|
|
|
Fizgar Magician
Joined: 07 Feb 2002 Posts: 333 Location: Central Virginia
|
Posted: Fri Feb 25, 2011 12:31 am |
It would be nice to have %f added to the pattern matching help file. Not sure how I missed it's addition. With the ability to strip commas and return a floating point number, this is a great feature. I will be rewriting several scripts tonight using it to simplify trigger patterns and what goes on in the script.
|
|
_________________ Windows Vista Home Premium SP2 32-bit
AMD Athlon Dual Core 4400+ 2.31 GHz
3 GB RAM
CMUD 3.34 |
|
|
|
|
|