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
Simucal
Beginner


Joined: 26 Sep 2005
Posts: 13

PostPosted: Tue Sep 27, 2005 12:01 am   

Tricky Trigger problem *Solved*
 
I have a trigger for my prompt in a mud a play, and I have been having trouble getting it to exactly work how I want.

Here is an example of my prompt while not fighting:
[HP:196 SP:170 XL:910659 $:1244][100 98 100 100 100 100]:

However! The last 6 sets of numbers on my prompt are my soldiers HP's. While im fighting, whichever of my soldiers that is tanking has a set of ( ) around his HP. Something like

[HP:196 SP:170 XL:910659 $:1244][100 (98) 100 100 100 100]:

The original trigger I had was:
~[HP:(%d) SP:(%d) XL:(%n) ~$:(%d)~]~[(*%d*) (*%d*) (*%d*) (*%d*) (*%d*) (*%d*)~]:

This however stores value %6 as (98) and I only want the 98. How can I make my trigger so it will recognize my prompt while not fighting, and while a soldier is tanking.. and store the soldiers HP values without including the parentheses that are sometimes there.

If you would like a more detailed description of this, please let me know.


Last edited by Simucal on Tue Sep 27, 2005 4:31 pm; edited 2 times in total
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Tue Sep 27, 2005 1:37 am   
 
Simple solution would be ranges. Instead of using this:

(*%d*)

use this:

[~(~) ](%d)[~(~) ]

The stuff in square brackets tells zmud to match on any combination of any length of a continuous string of either parentheses and spaces. Further work will be needed if you also need to identify your tank, but I'm guessing that's all done via separate commands.
_________________
EDIT: I didn't like my old signature
Reply with quote
Simucal
Beginner


Joined: 26 Sep 2005
Posts: 13

PostPosted: Tue Sep 27, 2005 2:33 am   hmm
 
Ok, so I get what you are saying.. and I switched it to:

Code:
~[HP:(%d) SP:(%d) XL:(%n) ~$:(%d)~]~[[~(~) ](%d)[~(~) ][~(~) ](%d)[~(~) ][~(~) ](%d)[~(~) ][~(~) ](%d)[~(~) ][~(~) ](%d)[~(~) ][~(~) ](%d)[~(~) ]~]:


However, it is not recognizing the pattern of:
[HP:196 SP:170 XL:910659 $:1244][100 98 100 100 100 100]:

anymore

I also tried adding a space before the first number of soldier healths and the last, thinking that was mucking it up because it wouldnt be matching anything in its range on the first and last one.

[HP:196 SP:170 XL:910659 $:1244][ 100 98 100 100 100 100 ]:

This did not fix it however. My prompt is not triggering it anymore at all. Any ideas?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Tue Sep 27, 2005 7:35 am   
 
Use your original trigger and surround the storing of your soldiers with %eval. Alternately you could capture all the soldier values at once and store them in a single list by %replace("%5"," ","|") then whenever you pull out a soldier value with %item it would have the parenthesis stripped.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Simucal
Beginner


Joined: 26 Sep 2005
Posts: 13

PostPosted: Tue Sep 27, 2005 4:31 pm   
 
Thank you so much vijilante, i used your %eval suggestion while storing the variables. Thanks a lot
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