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
Edwub
Wanderer


Joined: 21 Nov 2002
Posts: 85
Location: USA

PostPosted: Thu Nov 21, 2002 4:05 am   

Need help with mathematics/var
 
Trying to utilize my zmud (version 6.16) to help me with some mathmatics, such as percentages.

I was able to make macro's for PK, as well as basic trigs, triggers that use if, spell triggers that depend on my position, yada yada.

but using mathematics/percentages is beyond my poor comprehension.

Simplest example is: "You finished 1064 random quests, failed 56 and abandoned 44 of them."
No matter how hard i try i cant create a successful set to give me a percentage, and thats the easist one i want.

If someone could help with this basic one, I think i could go on to higher levs.

Thank you ZMUD users for your time
Magical Majere

MagicalMajere@hotmail.com
Reply with quote
fattony
Apprentice


Joined: 27 Dec 2001
Posts: 105
Location: USA

PostPosted: Thu Nov 21, 2002 7:05 am   
 
Because 6.16 didn't have floating point vars, you'll need to do some extra math instead.

%eval(100 * 56)/ 1064

Try that.

Fat Tony
Reply with quote
Edwub
Wanderer


Joined: 21 Nov 2002
Posts: 85
Location: USA

PostPosted: Thu Nov 21, 2002 7:27 am   
 
Thanks for the post Tony, but i'm still having trouble with it..

I've got it like this:

You finished %1 random quests, failed %2 and abandoned %3 of them.

%eval( %1/(%1+%2+%3))

do i need to set it up to add all 3, set it as another var, like 'total'
then make it
%eval(%1/total)

Sorry for needing the extra help, thanks a lot though

Majere




Edwub the Mage
Reply with quote
Edwub
Wanderer


Joined: 21 Nov 2002
Posts: 85
Location: USA

PostPosted: Thu Nov 21, 2002 7:53 am   
 
Hehe, replying to my old topic.

I think i figured it out, but I know the form is horrible.

ZMUD wont do decimals, which made it difficult, but this is what i'm doing.

#VAR totalrqe %eval( %1+%2+%3)

#echo Random quest's total: @totalrqe

#var pumpedrqe %eval( %1*100)

#echo RQE Completion to closest Percent: %eval( @pumpedrqe/@totalrqe)

It presents all right to me, but its a shame I cant get it to decimal or closer.
Thanks again :)

Majere
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Nov 21, 2002 8:09 am   
 
Actually it should be like this:
Trigger pattern:
You finished (%d) random quests, failed (%d) and abandoned (%d) of them.

Trigger Value:
#ECHO Random quests total: %eval(%1 + %2 + %3)
#ECHO RQE Completion to closest Percent: %eval((%1 * 100)/(%1 + %2 + %3))

You can use variables, but they aren't needed.

LightBulb
Senior Member
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