simple XPtrack

Moderator: MacroQuest Developers

hiipii
a ghoul
a ghoul
Posts: 93
Joined: Sat Jun 19, 2004 5:01 pm

simple XPtrack

Post by hiipii » Mon Mar 13, 2006 8:07 pm

Keeps track of your xp gained and echos xp gained and average xp per kill on each exp gain.

update: lax's suggestion

Code: Select all

function main()
{
	AddTrigger XPGain "You gain@*@"
	declare XP float script ${Me.PctExp}
	declare AAXP float script ${Me.PctAAExp}
	declare Kills int script 0
	declare startXP float script ${Me.PctExp}
	declare startAAXP float script ${Me.PctAAExp}
	
	echo XPTracker Started XP: ${Me.PctExp} AA: ${Me.PctAAExp}
	
	while "1"
		waitframe
		
}




atom XPGain(string line)
{
	Kills:Inc
	XP:Set[${Me.PctExp}]
	AAXP:Set[${Me.PctAAExp}]
	
	popup Now at ${Me.PctExp}xp!
	echo You have gained ${Math.Calc[${XP}-${startXP}]}%XP, ${Math.Calc[${AAXP}-${startAAXP}]}%AAXP your averages are ${Math.Calc[(${XP}-${startXP})/${Kills}]}XP and ${Math.Calc[(${AAXP}-${startAAXP})/${Kills}]}AAXP per kill with ${Kills} kills
}
Last edited by hiipii on Tue Mar 14, 2006 10:57 pm, edited 1 time in total.

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Mon Mar 13, 2006 9:01 pm

Highly recommend changing the loop. It's going to try to ExecuteQueued dozens of times past the number it actually has to, each frame.

Do this instead

Code: Select all

   while 1
   {
       while ${QueuedCommands}
           ExecuteQueued
      waitframe
   } 
This will execute all queued commands every frame, without the dozens of extra tries :)

Alternatively, you could change the word "function" in "function XPGain" to "atom" -- as in "atom XPGain" -- and then your loop could just be this

Code: Select all

While 1
  waitframe
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

4xxx
orc pawn
orc pawn
Posts: 11
Joined: Wed Jun 21, 2006 7:54 pm

Post by 4xxx » Mon Aug 28, 2006 1:01 am

This script incorrectly calculates the xp gained. On first kill it says you've gained 0 xp.
aka Wingnut on irc

User avatar
aChallenged1
a grimling bloodguard
a grimling bloodguard
Posts: 1804
Joined: Mon Jun 28, 2004 10:12 pm

Post by aChallenged1 » Mon Aug 28, 2006 3:35 am

So fix it.

I have for myself.
Fuck writing MQ2 macros. Go with IS scripts; IS Rules!

4xxx
orc pawn
orc pawn
Posts: 11
Joined: Wed Jun 21, 2006 7:54 pm

Post by 4xxx » Mon Aug 28, 2006 3:36 am

aChallenged1 wrote:So fix it.

I have for myself.
I would have if I knew how. I don't see the problem in the code.
aka Wingnut on irc

User avatar
aChallenged1
a grimling bloodguard
a grimling bloodguard
Posts: 1804
Joined: Mon Jun 28, 2004 10:12 pm

Post by aChallenged1 » Mon Aug 28, 2006 6:07 am

Crap, just realized you're wingnut. LOL, sorry man. Thought you were some noob.
Fuck writing MQ2 macros. Go with IS scripts; IS Rules!

User avatar
aChallenged1
a grimling bloodguard
a grimling bloodguard
Posts: 1804
Joined: Mon Jun 28, 2004 10:12 pm

Post by aChallenged1 » Tue Aug 29, 2006 5:41 pm

A modified version that does not use an atom (it can't) but resets the data when you level for correct xp tracking after a ding; though it does track absolute total XP gains as kills (which includes quest exp).

Code: Select all

;XPTracker
; modified from the version by hiipii
; there are two reporting sectiosn, one is with AA and one without.
; the one with AA is remarked out in this post. Don't run it with both unremarked. Mind the fact that there are 2 lines that wrap and may not copy properly.

   variable float XP=${Me.PctExp}
   variable int TKills=0
   variable float AAXP=${Me.PctAAExp}
   variable int Kills=0
   variable float startXP=${Me.PctExp}
   variable float startAAXP=${Me.PctAAExp}
   variable int xpLevels=0
   variable int MyLevel=${Me.Level}

function main()
{
   AddTrigger XPGain "You gain@*@"
   AddTrigger XPGain "You have gained a level@P1@"
   
   echo XPTracker Started XP: ${Me.PctExp} AA: ${Me.PctAAExp}
   
   while "1"
   {
      wait 5
      ExecuteQueued
   }   
}

function XPGain(string line)
{
	if ${Me.Level}!=${MyLevel}
		{
		MyLevel:Inc
		startXP:Set[${Me.PctExp}]
		xpLevels:Inc
		echo you have leveled ${xpLevels} times
		Kills:Set[0]
		}
	
   Kills:Inc
   TKills:Inc
   XP:Set[${Me.PctExp}]
   AAXP:Set[${Me.PctAAExp}]
   
	popup Now at ${Me.PctExp}%xp!
;	echo You have gained ${Math.Calc[${XP}-${startXP}]}%XP, ${Math.Calc[${AAXP}-${startAAXP}]}%AAXP your averages are ${Math.Calc[(${XP}-${startXP})/${Kills}]}XP and ${Math.Calc[(${AAXP}-${startAAXP})/${Kills}]}AAXP per kill with ${Kills} kills
	echo Currently @ ${Me.PctExp}%xp!
	echo You have killed a total of ${TKills} mobs
	echo You have gained ${Math.Calc[${XP}-${startXP}]}%XP, your averages are ${Math.Calc[(${XP}-${startXP})/${Kills}]}XP per kill with ${Kills} kills
}

function atexit()
{
echo xptracker has exited
}
Fuck writing MQ2 macros. Go with IS scripts; IS Rules!

hendrix04
a lesser mummy
a lesser mummy
Posts: 38
Joined: Tue Jul 13, 2004 5:02 pm

Post by hendrix04 » Mon Sep 18, 2006 11:35 pm

i wrote my own exp tracker and it has the bug of not updating after first kill... (after that it is fine). Anyone know what is causing this?

User avatar
aChallenged1
a grimling bloodguard
a grimling bloodguard
Posts: 1804
Joined: Mon Jun 28, 2004 10:12 pm

Post by aChallenged1 » Tue Sep 19, 2006 5:20 am

Come on Hendrix, you know we don't read minds. Where's the code?
Fuck writing MQ2 macros. Go with IS scripts; IS Rules!

hendrix04
a lesser mummy
a lesser mummy
Posts: 38
Joined: Tue Jul 13, 2004 5:02 pm

Post by hendrix04 » Tue Sep 19, 2006 11:09 am

The same as every other exp tracker :) though this should take dinging into effect...

Code: Select all

variable float expgain
variable float lastexp
variable int mobcount

function main()
{
	addtrigger expgain "You gain party experience!!"
	lastexp:Set[${Me.PctExp}]
	expgain:Set[0.000000001]
	while 1
		waitframe
}

atom expgain()
{	
	mobcount:Inc
	echo ${lastexp}
	echo ${Me.PctExp}
	if ${lastexp} > ${Me.PctExp}
	{
		expgain:Inc[${Math.Calc[100 + ${Me.PctExp}-${lastexp}]}]
		echo "You Gained ${Math.Calc[100 + ${Me.PctExp} - ${lastexp}]} for that kill"
	}	
	else
	{
		expgain:Inc[${Math.Calc[${Me.PctExp} - ${lastexp}]}]
		echo "You Gained ${Math.Calc[${Me.PctExp}-${lastexp}]} for that kill"
	}
	
	echo "${Math.Calc[ ${expgain} / ${Math.Calc[${Script.RunningTime} / 3600000].Precision[8]}].Precision[4]} is your exp per hour. ${Math.Calc[${expgain} / ${mobcount}]} is your Exp/mob average..."
	lastexp:Set[${Me.PctExp}]
}

xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: simple XPtrack

Post by xyilla » Wed Jul 09, 2025 1:51 am


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: simple XPtrack

Post by xyilla » Wed Jul 09, 2025 1:52 am


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: simple XPtrack

Post by xyilla » Wed Jul 09, 2025 2:29 am


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: simple XPtrack

Post by xyilla » Wed Jul 09, 2025 2:30 am


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: simple XPtrack

Post by xyilla » Wed Jul 09, 2025 2:32 am