Page 1 of 3

Countexp.mac

Posted: Fri Jan 01, 2010 12:18 am
by Dregs
This is a complete macro version of the updated exp calculation code I threw together. As usual, if anyone noticed any problems with it, please let me know. It's hard to test some of the conditions in there due to the rarity that they occur.

Code: Select all

|Countexp.mac Version 1.0
|Written by Dregs
|Based on exp-calculating code from the rogue helper macro
|------------------------------------------------------------------------------
|Usage: Simply start the macro by typing /macro countexp
|------------------------------------------------------------------------------

#event GroupExp "#*#You gain party experience#*#"
#event SoloExp "#*#You gain experience#*#"

Sub Main
   /declare MobsKilled int outer 0
   /declare LDExp float outer ${Me.PctGroupLeaderExp} 
   /declare AAExp float outer ${Me.PctAAExp} 
   /declare Exp float outer ${Me.PctExp}
   /declare CurrentAA int outer ${Me.AAPointsTotal}
   /declare CurrentLevel int outer ${Me.Level}
   /declare CurrentLeaderPoints int outer ${Me.GroupLeaderPoints}
   /echo CountExp macro begun. Will count exp gained per mob killed.
   :Loop
   /doevents
   /goto :Loop
/return

Sub Event_GroupExp
   /varcalc MobsKilled (1+${MobsKilled})
   /if (${Me.Level}>${CurrentLevel} && ${Me.AAPointsTotal}>${CurrentAA} && ${Me.GroupLeaderPoints}>${CurrentLeaderPoints}) {
      /echo Kill number ${MobsKilled} yielded Group XP: REG (${Math.Calc[100+${Me.PctExp}-${Exp}]}%), AA (${Math.Calc[100+${Me.PctAAExp}-${AAExp}]}%), LDR (${Math.Calc[100+${Me.PctGroupLeaderExp}-${LDExp}]}%)
   }
   /if (${Me.Level}>${CurrentLevel} && ${Me.AAPointsTotal}>${CurrentAA} && ${Me.GroupLeaderPoints}==${CurrentLeaderPoints}) {
      /echo Kill number ${MobsKilled} yielded Group XP: REG (${Math.Calc[100+${Me.PctExp}-${Exp}]}%), AA (${Math.Calc[100+${Me.PctAAExp}-${AAExp}]}%), LDR (${Math.Calc[${Me.PctGroupLeaderExp}-${LDExp}]}%) 
   }
   /if (${Me.Level}>${CurrentLevel} && ${Me.AAPointsTotal}==${CurrentAA} && ${Me.GroupLeaderPoints}==${CurrentLeaderPoints}) {
      /echo Kill number ${MobsKilled} yielded Group XP: Reg (${Math.Calc[100+${Me.PctExp}-${Exp}]}%), AA (${Math.Calc[${Me.PctAAExp}-${AAExp}]}%), LDR (${Math.Calc[${Me.PctGroupLeaderExp}-${LDExp}]}%
   }
   /if (${Me.Level}>${CurrentLevel} && ${Me.AAPointsTotal}==${CurrentAA} && ${Me.GroupLeaderPoints}>${CurrentLeaderPoints}) {
      /echo Kill number ${MobsKilled} yielded Group XP: Reg (${Math.Calc[100+${Me.PctExp}-${Exp}]}%), AA (${Math.Calc[${Me.PctAAExp}-${AAExp}]}%), LDR (${Math.Calc[100+${Me.PctGroupLeaderExp}-${LDExp}]}%
   }
   /if (${Me.Level}==${CurrentLevel} && ${Me.AAPointsTotal}>${CurrentAA} && ${Me.GroupLeaderPoints}>${CurrentLeaderPoints}) {
      /echo Kill number ${MobsKilled} yielded Group XP: Reg (${Math.Calc[${Me.PctExp}-${Exp}]}%), AA (${Math.Calc[100+${Me.PctAAExp}-${AAExp}]}%), LDR (${Math.Calc[100+${Me.PctGroupLeaderExp}-${LDExp}]}%
   }
   /if (${Me.Level}==${CurrentLevel} && ${Me.AAPointsTotal}==${CurrentAA} && ${Me.GroupLeaderPoints}==${CurrentLeaderPoints}) {
      /echo Kill number ${MobsKilled} yielded Group XP: REG (${Math.Calc[${Me.PctExp}-${Exp}]}%), AA (${Math.Calc[${Me.PctAAExp}-${AAExp}]}%), LDR (${Math.Calc[${Me.PctGroupLeaderExp}-${LDExp}]}%) 
   }
   /if (${Me.Level}==${CurrentLevel} && ${Me.AAPointsTotal}==${CurrentAA} && ${Me.GroupLeaderPoints}>${CurrentLeaderPoints}) {
      /echo Kill number ${MobsKilled} yielded Group XP: Reg (${Math.Calc[${Me.PctExp}-${Exp}]}%), AA (${Math.Calc[${Me.PctAAExp}-${AAExp}]}%), LDR (${Math.Calc[100+${Me.PctGroupLeaderExp}-${LDExp}]}%
   }
   /if (${Me.Level}==${CurrentLevel} && ${Me.AAPointsTotal}>${CurrentAA} && ${Me.GroupLeaderPoints}==${CurrentLeaderPoints}) {
      /echo Kill number ${MobsKilled} yielded Group XP: Reg (${Math.Calc[${Me.PctExp}-${Exp}]}%), AA (${Math.Calc[100+${Me.PctAAExp}-${AAExp}]}%), LDR (${Math.Calc[${Me.PctGroupLeaderExp}-${LDExp}]}%
   }
   /varset CurrentAA ${Me.AAPointsTotal}
   /varset CurrentLevel ${Me.Level}
   /varset CurrentLeaderPoints ${Me.GroupLeaderPoints}
   /varset LDExp ${Me.PctGroupLeaderExp} 
   /varset AAExp ${Me.PctAAExp} 
   /varset Exp ${Me.PctExp}
/return

Sub Event_SoloExp
   /varcalc MobsKilled (1+${MobsKilled})
   /if (${Me.Level}>${CurrentLevel} && ${Me.AAPointsTotal}>${CurrentAA} && ${Me.GroupLeaderPoints}>${CurrentLeaderPoints}) {
      /echo Kill number ${MobsKilled} yielded Solo XP: REG (${Math.Calc[100+${Me.PctExp}-${Exp}]}%), AA (${Math.Calc[100+${Me.PctAAExp}-${AAExp}]}%), LDR (${Math.Calc[100+${Me.PctGroupLeaderExp}-${LDExp}]}%)
   }
   /if (${Me.Level}>${CurrentLevel} && ${Me.AAPointsTotal}>${CurrentAA} && ${Me.GroupLeaderPoints}==${CurrentLeaderPoints}) {
      /echo Kill number ${MobsKilled} yielded Solo XP: REG (${Math.Calc[100+${Me.PctExp}-${Exp}]}%), AA (${Math.Calc[100+${Me.PctAAExp}-${AAExp}]}%), LDR (${Math.Calc[${Me.PctGroupLeaderExp}-${LDExp}]}%) 
   }
   /if (${Me.Level}>${CurrentLevel} && ${Me.AAPointsTotal}==${CurrentAA} && ${Me.GroupLeaderPoints}==${CurrentLeaderPoints}) {
      /echo Kill number ${MobsKilled} yielded Solo XP: Reg (${Math.Calc[100+${Me.PctExp}-${Exp}]}%), AA (${Math.Calc[${Me.PctAAExp}-${AAExp}]}%), LDR (${Math.Calc[${Me.PctGroupLeaderExp}-${LDExp}]}%
   }
   /if (${Me.Level}>${CurrentLevel} && ${Me.AAPointsTotal}==${CurrentAA} && ${Me.GroupLeaderPoints}>${CurrentLeaderPoints}) {
      /echo Kill number ${MobsKilled} yielded Solo XP: Reg (${Math.Calc[100+${Me.PctExp}-${Exp}]}%), AA (${Math.Calc[${Me.PctAAExp}-${AAExp}]}%), LDR (${Math.Calc[100+${Me.PctGroupLeaderExp}-${LDExp}]}%
   }
   /if (${Me.Level}==${CurrentLevel} && ${Me.AAPointsTotal}>${CurrentAA} && ${Me.GroupLeaderPoints}>${CurrentLeaderPoints}) {
      /echo Kill number ${MobsKilled} yielded Solo XP: Reg (${Math.Calc[${Me.PctExp}-${Exp}]}%), AA (${Math.Calc[100+${Me.PctAAExp}-${AAExp}]}%), LDR (${Math.Calc[100+${Me.PctGroupLeaderExp}-${LDExp}]}%
   }
   /if (${Me.Level}==${CurrentLevel} && ${Me.AAPointsTotal}==${CurrentAA} && ${Me.GroupLeaderPoints}==${CurrentLeaderPoints}) {
      /echo Kill number ${MobsKilled} yielded Solo XP: REG (${Math.Calc[${Me.PctExp}-${Exp}]}%), AA (${Math.Calc[${Me.PctAAExp}-${AAExp}]}%), LDR (${Math.Calc[${Me.PctGroupLeaderExp}-${LDExp}]}%) 
   }
   /if (${Me.Level}==${CurrentLevel} && ${Me.AAPointsTotal}==${CurrentAA} && ${Me.GroupLeaderPoints}>${CurrentLeaderPoints}) {
      /echo Kill number ${MobsKilled} yielded Solo XP: Reg (${Math.Calc[${Me.PctExp}-${Exp}]}%), AA (${Math.Calc[${Me.PctAAExp}-${AAExp}]}%), LDR (${Math.Calc[100+${Me.PctGroupLeaderExp}-${LDExp}]}%
   }
   /if (${Me.Level}==${CurrentLevel} && ${Me.AAPointsTotal}>${CurrentAA} && ${Me.GroupLeaderPoints}==${CurrentLeaderPoints}) {
      /echo Kill number ${MobsKilled} yielded Solo XP: Reg (${Math.Calc[${Me.PctExp}-${Exp}]}%), AA (${Math.Calc[100+${Me.PctAAExp}-${AAExp}]}%), LDR (${Math.Calc[${Me.PctGroupLeaderExp}-${LDExp}]}%
   }
   /varset CurrentAA ${Me.AAPointsTotal}
   /varset CurrentLevel ${Me.Level}
   /varset CurrentLeaderPoints ${Me.GroupLeaderPoints}
   /varset LDExp ${Me.PctGroupLeaderExp} 
   /varset AAExp ${Me.PctAAExp} 
   /varset Exp ${Me.PctExp}
/return

Posted: Fri Jan 01, 2010 12:23 am
by Dregs
Here is version 2.0 which is basically just to show how to use the include file which I posted here:
http://macroquest2.com/phpBB2/viewtopic.php?t=16598

Code: Select all

|Countexp.mac Version 2.0
|Written by Dregs
|Based on exp-calculating code from the rogue helper macro
|------------------------------------------------------------------------------

#include CountExp.inc
Sub Main
   /declare MobsKilled int outer 0
   /declare LDExp float outer ${Me.PctGroupLeaderExp} 
   /declare AAExp float outer ${Me.PctAAExp} 
   /declare Exp float outer ${Me.PctExp}
   /declare CurrentAA int outer ${Me.AAPointsTotal}
   /declare CurrentLevel int outer ${Me.Level}
   /declare CurrentLeaderPoints int outer ${Me.GroupLeaderPoints}
   /echo Macro begun. Will start counting exp gained per kill.
   :Loop
   /doevents
   /goto :Loop
/return

Posted: Mon Jan 25, 2010 11:47 am
by Dregs
Here is version 3.0, which shows how to use CountExp.inc (version 2.0) which can be found at http://macroquest2.com/phpBB2/viewtopic ... 574#147574

Code: Select all

|Countexp.mac Version 3.0
|Written by Dregs
|------------------------------------------------------------------------------

#include CountExp.inc
Sub Main
   /call CreateCountExpVariables
   /echo Macro begun. Will start counting exp gained per kill.
   :Loop
   /doevents
   /goto :Loop
/return

Posted: Mon Jan 25, 2010 1:34 pm
by matadormix
Just for completenes sake, you may want to include "You gain raid experience" in that one (not that anyone raids for exp).

Posted: Wed Feb 03, 2010 8:01 am
by Dregs
I appreciate the advice. I must admit I didn't think of that one. Also, I considered maybe calculating leadership exp on its own, but then I realized that you can't get any leadership exp without another message as well... as far as I know. I'm working on a few other things right now, but I'm hoping at some point to post another version which will also work as a before/after for shrouded exp, but that's proving more difficult than I expected. My brain is not working so well for math these days. :P

Re: Countexp.mac

Posted: Tue Sep 16, 2025 3:37 am
by xyilla

Re: Countexp.mac

Posted: Tue Sep 16, 2025 3:38 am
by xyilla

Re: Countexp.mac

Posted: Tue Sep 16, 2025 3:39 am
by xyilla

Re: Countexp.mac

Posted: Tue Sep 16, 2025 4:16 am
by xyilla

Re: Countexp.mac

Posted: Tue Sep 16, 2025 4:17 am
by xyilla

Re: Countexp.mac

Posted: Tue Sep 16, 2025 4:19 am
by xyilla

Re: Countexp.mac

Posted: Tue Sep 16, 2025 4:20 am
by xyilla

Re: Countexp.mac

Posted: Tue Sep 16, 2025 4:21 am
by xyilla

Re: Countexp.mac

Posted: Tue Sep 16, 2025 4:22 am
by xyilla

Re: Countexp.mac

Posted: Tue Sep 16, 2025 4:23 am
by xyilla