Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Y3KPanic
Novice


Joined: 21 Apr 2004
Posts: 34

PostPosted: 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.
Reply with quote
Serentus
Apprentice


Joined: 28 Sep 2001
Posts: 103
Location: USA

PostPosted: 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," ")}
Reply with quote
Y3KPanic
Novice


Joined: 21 Apr 2004
Posts: 34

PostPosted: 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?
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: 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
Reply with quote
Y3KPanic
Novice


Joined: 21 Apr 2004
Posts: 34

PostPosted: Mon May 10, 2004 11:10 pm   
 
Ohhh. Thanks a lot. It works perfectly =).
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net