|
shaun.murray Magician
Joined: 23 Jul 2005 Posts: 334 Location: Chicago
|
Posted: Sat Jul 23, 2005 2:37 pm
#math and/or %eval not working... =**[ |
I'm trying to get a running percentage of current experience. An when I have cap'd my exp, it says 100%. Here is the prompt I that I'm triggering off of:
[Lag: 0] [Align: 994] [ 548642848 ] [Reply: ]
[H:11347/12478] [M:100/100] [S:2266/3736] [E:4038/5400]
548642848 being my current exp. Here is the trigger pattern:
^~[Lag: (%d)~] ~[Align: (%d)] ~[ (%d) ]
And then the equation that I'm trying to get to work:
#VARIABLE exppercent %eval( (%3\1000000000)*100)
Its not returning anything NEAR a close percentage. Let alone working half the time. I've tried everything, and I'm out of ideas. Maybe its too early in the morning, I don't know... LoL! But yeah. I'd love to see something that returned a percentage, with a few decimal places after it. Like 15.846 % would be awsome. But I'd settle for a rounded 16 % if at least....
Any help would be much appreciated! ^^ Oh... This is my first post on this forum, but I've been a zMud owner for a 'lil over a year! Wouldn't have any other client! Go zuggsoft!!!!! |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Sat Jul 23, 2005 3:26 pm |
#VARIABLE exppercent %format("&0.2n", %eval( (%3/1000000000.0)*100))
Breaking it down from the inside out:
1000000000.0 //Use a Floating point number .0 forces float
%3/1000000000 //Use Correct division \ returns the Modulus
%format("&0.2n", //Format the String to 2 decimal places |
|
|
|
shaun.murray Magician
Joined: 23 Jul 2005 Posts: 334 Location: Chicago
|
Posted: Sat Jul 23, 2005 3:32 pm |
Oh yea! That sooo works! Thank you thank you thank you! I'll hafta re-read the %format section, seems that will play a major role in alot of sub/math/ect things that I plan on doing... LoL! ^^ But yeah, thankx again! Works like a champ now!
|
|
|
|
shaun.murray Magician
Joined: 23 Jul 2005 Posts: 334 Location: Chicago
|
Posted: Sat Jul 23, 2005 4:25 pm |
Aiight... You seem to really know what your talking about. So I pose another problem. I'm having issues with zoning in on a number during combat. Here's the line:
You land [ 11 of 11 ] attacks on a wandering minotaur: RUPTURING (417) damage!
I'm trying to get the 417 and no matter wht I try, I can't seem to single that number. I can get the 11's , the wandering minotaur's and the RUPTURING just fine. Basically, I'm going to be substituting that line to include a total damage done ( 4587 ) at the beginning of the line.
Any help again is mucho appreciated!!! =D |
|
|
|
budala Newbie
Joined: 23 Jul 2005 Posts: 3 Location: Sweden
|
Posted: Sat Jul 23, 2005 4:29 pm |
#TRIGGER {You land ~[(%d) of (%d)~] attacks on a wandering minotaur~: RUPTURING ~((%d)~) damage!} {#SUB {Whatever and %3! Booyah!}}
Something like that? |
|
|
|
shaun.murray Magician
Joined: 23 Jul 2005 Posts: 334 Location: Chicago
|
Posted: Sat Jul 23, 2005 4:44 pm |
You land ~[(%d) of (%d)~] attacks on a (*)~: (*) ~((%d)~) damage!
Would that work instead? The two changes I made, I need to be open to anything, because thats the mobs name, and the damage. Would the last %d become %5 then? |
|
|
|
budala Newbie
Joined: 23 Jul 2005 Posts: 3 Location: Sweden
|
Posted: Sat Jul 23, 2005 5:48 pm |
Aye.. That would work. And the last would be %5.
EDIT: Did you test if it worked? I just wrote that off the top of my head. |
|
|
|
shaun.murray Magician
Joined: 23 Jul 2005 Posts: 334 Location: Chicago
|
Posted: Sat Jul 23, 2005 6:27 pm |
Yea. I tried it. Still not working. I'm gonna continue to play around with it. I'll post results as I get 'em! ^^
|
|
|
|
Aselarin Beginner
Joined: 23 Jul 2005 Posts: 26
|
Posted: Sat Jul 23, 2005 6:28 pm |
sorry
|
|
Last edited by Aselarin on Sat Jul 23, 2005 7:12 pm; edited 1 time in total |
|
|
|
shaun.murray Magician
Joined: 23 Jul 2005 Posts: 334 Location: Chicago
|
Posted: Sat Jul 23, 2005 6:53 pm |
nexela wrote: |
#VARIABLE exppercent %format("&0.2n", %eval( (%3/1000000000.0)*100))
Breaking it down from the inside out:
1000000000.0 //Use a Floating point number .0 forces float
%3/1000000000 //Use Correct division \ returns the Modulus
%format("&0.2n", //Format the String to 2 decimal places |
How about this then?
#VARIABLE scriptpercent %format( "&0.2n", %eval( (@line / @line_max) * 100))
Thats coming back as 0.00% @line is the current line that the script is on, and @line_max is total lines. Theoretically that should work. What am I missing?
Aselarin-Plz start a new thread, an not hijack this one.... |
|
|
|
shaun.murray Magician
Joined: 23 Jul 2005 Posts: 334 Location: Chicago
|
Posted: Sat Jul 23, 2005 6:57 pm |
budala wrote: |
Aye.. That would work. And the last would be %5.
EDIT: Did you test if it worked? I just wrote that off the top of my head. |
^You land ~[ (%d) of (%d) ~] attacks on a (*)~: (*) ~((%d)~) damage!
That worked! The problem was that there needed to be spaces next to the brackets. =D Now... I gotta figure out how to work this #sub... ^^ |
|
|
|
|
|