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
Jdunsworth
Newbie


Joined: 04 Jan 2006
Posts: 2

PostPosted: Wed Jan 04, 2006 7:28 am   

Yet another #MATH question
 
Well, I'm getting frustrated... I've looked at previous responses regarding adding two variables together with the #MATH funciton and it's just not going well...

Basically what I'm trying to do is that I have a trigger that takes a line from my score that gets several variables including HP, EP, Experience, and Average Stats... The experience is where I want to focus. The variable that experience is set for is @exp.

We have a help file in the mud that will show us the experience until next level and I have taken a button and put a prompt so that you can enter the amount of experience it takes to hit the next level and stores it as the variable @gnexp.

Here's the part that snags me... I am trying to get @gnexp to subtract against @exp to get a final number to update on the status bar with how much experience I have left until I level possibly with a third variable that takes the two variables and does the math.

I have tried to put it triggered as %d and store it in the pattern field as the variable then update it, tried updating in third variable, tried making new trigger to update, but still return's 0 or the #math command. I've tried doing the following in #gnexp variable:

#math nexp (@gnexp-@exp)

as well as different variations on that and other combinations in different files and still just not working and returning 0...

Can anyone point me in the right direction?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Jan 04, 2006 11:07 am   
 
Put this directly in your status line.
%eval(@gnexp-@exp)
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Jdunsworth
Newbie


Joined: 04 Jan 2006
Posts: 2

PostPosted: Thu Jan 05, 2006 4:43 am   
 
Doh, I absolutely knew it would be easy and I was looking in it too deep. Thanks for that :)
Reply with quote
Dodgester
Wanderer


Joined: 17 Nov 2005
Posts: 65

PostPosted: Sun Jan 08, 2006 5:14 am   
 
Interesting cause it's worked for me without the %eval function. However, looks like you have a logical error caused by a typo in your example. Don't know if you just mistyped it in the forum or if it's actually mistyped in your code, but you have 'nexp' instead of 'gnexp' for the variable name that you are attempting to do the math on.

Dodgester
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