|
Y3KPanic Novice
Joined: 21 Apr 2004 Posts: 34
|
Posted: Mon May 10, 2004 4:56 am
Checking For Individual Characters in a Parameter |
Because the prompt of my MUD shows whether I have balance and equilibrium, I'm trying to detect it and transfer the information to a string list to be displayed on a status bar window for an easier read. My prompt looks like this:
1000h, 1000m ex-
where the presence of e means I have equilibrium and the presence of x means I have balance. I was thinking of adding onto my prompt trigger for a pattern that looks like:
^(%d)h, (%d)m(*)-
and somehow checking if %3 contains e, x, both, or none, and then %additem or %delitem "balance" or "equilibrium" from my string list accordingly.
Might anyone have an idea on how to do this? Any help would be appreciated. |
|
|
|
Serentus Apprentice
Joined: 28 Sep 2001 Posts: 103 Location: USA
|
Posted: Mon May 10, 2004 5:08 am |
Untested, but should be close.
#TRIGGER {^(%d)h, (%d)m(*)-} {#IF %pos("e",%3) {#ADDITEM statuslist Equilibrium} {#DELITEM statuslist Equilibrium};#IF %pos("x",%3) {#ADDITEM statuslist Balance} {#DELITEM statuslist Balance}} {prompt|nocr}
#STATUS {%expandlist(@statuslist," ")} |
|
|
|
Y3KPanic Novice
Joined: 21 Apr 2004 Posts: 34
|
Posted: Mon May 10, 2004 10:53 pm |
Thank you, it worked very well. However, the trigger is a bit slow...it doesn't seem to update until there's a line after the prompt. Because as soon as I enter a command or there's output from the MUD, a new prompt pops up, ready for another command or more output, and thus it shows my status right after the last command or output. The trigger doesn't read this new prompt until I enter a command on this prompt line or the MUD outputs something onto this prompt line. Is there anyway to fix that?
|
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Mon May 10, 2004 11:06 pm |
In the settings editor click the trigger then trigger options tab then Make sure PROMPT is checked and Newline is unchecked
|
|
|
|
Y3KPanic Novice
Joined: 21 Apr 2004 Posts: 34
|
Posted: Mon May 10, 2004 11:10 pm |
Ohhh. Thanks a lot. It works perfectly =).
|
|
|
|
|
|