Page 1 of 3

simple XPtrack

Posted: Mon Mar 13, 2006 8:07 pm
by hiipii
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
}

Posted: Mon Mar 13, 2006 9:01 pm
by Lax
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

Posted: Mon Aug 28, 2006 1:01 am
by 4xxx
This script incorrectly calculates the xp gained. On first kill it says you've gained 0 xp.

Posted: Mon Aug 28, 2006 3:35 am
by aChallenged1
So fix it.

I have for myself.

Posted: Mon Aug 28, 2006 3:36 am
by 4xxx
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.

Posted: Mon Aug 28, 2006 6:07 am
by aChallenged1
Crap, just realized you're wingnut. LOL, sorry man. Thought you were some noob.

Posted: Tue Aug 29, 2006 5:41 pm
by aChallenged1
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
}

Posted: Mon Sep 18, 2006 11:35 pm
by hendrix04
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?

Posted: Tue Sep 19, 2006 5:20 am
by aChallenged1
Come on Hendrix, you know we don't read minds. Where's the code?

Posted: Tue Sep 19, 2006 11:09 am
by hendrix04
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}]
}

Re: simple XPtrack

Posted: Wed Jul 09, 2025 1:51 am
by xyilla

Re: simple XPtrack

Posted: Wed Jul 09, 2025 1:52 am
by xyilla

Re: simple XPtrack

Posted: Wed Jul 09, 2025 2:29 am
by xyilla

Re: simple XPtrack

Posted: Wed Jul 09, 2025 2:30 am
by xyilla

Re: simple XPtrack

Posted: Wed Jul 09, 2025 2:32 am
by xyilla