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


Joined: 15 Sep 2005
Posts: 14
Location: USA-CA

PostPosted: Sun Jul 30, 2006 10:10 pm   

Comparing strings
 
Maybe strings is a bit misleading...

I want to compare my prompt which looks like this:

[493:493|360:378|137:355|807|0]

with the 807 being my exp to next level (TNL). Because the battle system on the MUD I play on awards exp based on attack, spell, etc, the experience gained varies each battle. Tracking kill experience is no problem, but these little gains are slighly more difficult.

What I am working on, but can't seem to get working, is compare my prompt to the previous prompt and calculate the difference between TNL. This would run continously, checking exp gained and/or lost due to death,flees,etc. For example:

Your hit damages a ghost
[493:493|360:378|137:355|807|0]
Your hit damages a ghost
[493:493|360:378|137:355|806|0]
Your hit damages a ghost
A ghost is dead
You are awarded 7 experience
[493:493|360:378|137:355|800|0]

My current trigger sees that I only won 7xp from the battle, but in reality I received 8xp. This is what I would like to track by comparing the prompts. So in the above example, prompt 2 compared to prompt 1 sees I gained 1xp, so I would add that difference to my counter variable. Comparing prompt 3 to prompt 2 yields a gain of 7xp.

Is this possible to continoulsy compare my prompt and track it's numerical changes? If somebody could help push in the right direction, that would me excellent and much appreciated
_________________
-BArtistics
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Jul 31, 2006 12:38 am   
 
I think you're thinking in too big of terms. Break up your prompt into numbers (matched by %d). As it pertains to TNL, store the old value in a variable:

#if (%7 != @TNL) {#NOOP experience awarded;#add EXPCounter %eval(@TNL - %7);TNL = %1} {#NOOP no change}
_________________
EDIT: I didn't like my old signature
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