Calculating time till next level.. Need Help

Need help with a macro you are writing? Ask here!

Moderator: MacroQuest Developers

Neolesh
a hill giant
a hill giant
Posts: 231
Joined: Mon Aug 23, 2004 11:15 am

Calculating time till next level.. Need Help

Post by Neolesh » Fri Sep 17, 2004 6:10 pm

My purpose is to measure total exp gained since the macro has started. Calculate how much exp I get per minute, then /echo 100 - current exp divided by exp per minute to give esimated time to next level.

This is what I have..

In Sub Main

Code: Select all

   /declare StartExp            float  outer
   /declare ExpPerMin           float  outer
   /declare TotalExp            float  outer

   /varset StartExp ${Me.PctExp}
and in the part of the macro that repeats about once every 3 minutes

Code: Select all

   /varcalc TotalExp ${float${Me.PctExp}-${StartExp}}
   /varcalc ExpPerMin ${float${TotalExp}/${${Macro.RunTime}/60}}

  /if (${TotalExp}>0) {
   /echo Approximate time to Next level is ${Math.Calc[${float${100-${Me.PctExp}}/${AvgExpMin}}]}
  } else {
   /echo Approximate time to Next level is not yet known!
  }
For some reason TotalExp never goes above 0.00. There may be mistakes in the rest of the code also, but right now I'm stuck on TotalExp never moving.

Airvz
Custom Builder
Custom Builder
Posts: 128
Joined: Tue Nov 18, 2003 3:36 pm

Post by Airvz » Fri Sep 17, 2004 7:59 pm


Neolesh
a hill giant
a hill giant
Posts: 231
Joined: Mon Aug 23, 2004 11:15 am

Post by Neolesh » Fri Sep 17, 2004 8:12 pm

I'm sorry but that doesn't help at all with what I am doing.

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Fri Sep 17, 2004 8:26 pm

It does help.

Don't cast. Ever.

Neolesh
a hill giant
a hill giant
Posts: 231
Joined: Mon Aug 23, 2004 11:15 am

Post by Neolesh » Fri Sep 17, 2004 9:11 pm

No it doesn't. heh

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Fri Sep 17, 2004 9:47 pm

Well, what sort of answer are you looking for?

Neolesh
a hill giant
a hill giant
Posts: 231
Joined: Mon Aug 23, 2004 11:15 am

Post by Neolesh » Fri Sep 17, 2004 9:54 pm

Ok, the purpose of the other macro is to measure exp gained. The macro I am trying to write is specifically measuring the aproximate time it will take you to get to the your next level by measuring your avg exp per minute, then looking at how far you have left to go.

My formulas for measuring this works algebraically, but I can't get it into proper MQ2 code.

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Fri Sep 17, 2004 10:00 pm

Hmm.

"For some reason TotalExp never goes above 0.00. There may be mistakes in the rest of the code also, but right now I'm stuck on TotalExp never moving."

I wonder where I could find the code for total experience gained?

Neolesh
a hill giant
a hill giant
Posts: 231
Joined: Mon Aug 23, 2004 11:15 am

Post by Neolesh » Fri Sep 17, 2004 10:24 pm

In the description that macro says it keeps a running total over time but it does not.

What it does do is keep a running total of time. I use that code already in my macro. All it does is tell you how much exp you gained that kill, how much aa exp you gained that kill how much total exp you have, how much total aa exp you have and how long the macro has been running at that time.

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Fri Sep 17, 2004 11:44 pm

Neolesh wrote:In the description that macro says it keeps a running total over time but it does not.

What it does do is keep a running total of time. I use that code already in my macro. All it does is tell you how much exp you gained that kill, how much aa exp you gained that kill how much total exp you have, how much total aa exp you have and how long the macro has been running at that time.
1. How does that macro calculate the experience delta? Here's a hint: it does not matter if it's per kill, per day, or per macro.

2. How is that different from the way you are doing it?

3. /echo ${float${Me.PctExp}-${StartExp}} returns?

4. What type is ${Me.PctExp}?

If these hints aren't enough, I suggest abandon you macro.

Neolesh
a hill giant
a hill giant
Posts: 231
Joined: Mon Aug 23, 2004 11:15 am

Post by Neolesh » Sat Sep 18, 2004 12:46 am

It matters if it's per day per kill or per macro because I need a decent sample size of exp to measure it when each kill gives a very very (sometimes not measurable) amount of exp. The longer it records exp the more accurate it's estimation will be. With the specific kills I am doing my exp bar will move 0.00 then 0.00 then 0.30 then 0.00 0.00 0.31 and so on.. I need a running total. Not a each kill total like that other macro provides.

Jesus I told you that macro was not what I needed. If you don't want to really help me out here then just leave my thread alone. Please.

User avatar
Cr4zyb4rd
Plugins Czar
Posts: 1449
Joined: Tue Jul 20, 2004 11:46 am

Post by Cr4zyb4rd » Sat Sep 18, 2004 12:56 am

It matters if it's per day per kill or per macro because I need a decent sample size of exp to measure it when each kill gives a very very (sometimes not measurable) amount of exp.
Sometimes not measurable? Zero isn't a measurement?
Thanks for explaining to us all what estimation means...but IIRC you were the one with the questions.
Jesus I told you that macro was not what I needed. If you don't want to really help me out here then just leave my thread alone. Please.
He tried very hard to help you. It seems that what you want goes beyond mere assistance, as more than ample information is provided in DKAA's comments and the readme, let alone the other sundry xp tracking macros and plugins you could look at. I have to agree that if you can't work with what's been given you'd best abandon your project.

Neolesh
a hill giant
a hill giant
Posts: 231
Joined: Mon Aug 23, 2004 11:15 am

Post by Neolesh » Sat Sep 18, 2004 1:00 am

Ok how about this.. All I need to know is why

Code: Select all

   /varcalc TotalExp ${float${Me.PctExp}-${StartExp}}
Results in the variable TotalExp equalling 0.00 no matter what. It doesn't make sense because StartExp stays the same always. I can /echo it anytime during the macro and it isn't changing but for some reason Me.PctExp Minus StartExp = Zero, and I think it has something to do with the formating that I don't understand yet.

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Sat Sep 18, 2004 1:24 am

Cause you're an idiot, that's why:

Code: Select all

 /varset TotalExp ${Math.Calc[${Me.PctExp}-${StartExp}]} 
Does that look familiar? Here's the other macro:

Code: Select all

/varset Exper ${Math.Calc[${Me.PctExp}-${Exper}]} 
UNDERSTAND NOW?

Neolesh
a hill giant
a hill giant
Posts: 231
Joined: Mon Aug 23, 2004 11:15 am

Post by Neolesh » Sat Sep 18, 2004 1:33 am

But I am doing a /varcalc.. so it's still a little fuzzy. I'm not doing a /varset