|
Edwub Wanderer
Joined: 21 Nov 2002 Posts: 85 Location: USA
|
Posted: 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 |
|
|
|
fattony Apprentice
Joined: 27 Dec 2001 Posts: 105 Location: USA
|
Posted: 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 |
|
|
|
Edwub Wanderer
Joined: 21 Nov 2002 Posts: 85 Location: USA
|
Posted: 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 |
|
|
|
Edwub Wanderer
Joined: 21 Nov 2002 Posts: 85 Location: USA
|
Posted: 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 |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: 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 |
|
|
|
|
|