XPTracker.mac problem(s)

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

Moderator: MacroQuest Developers

Fabolous1
a ghoul
a ghoul
Posts: 134
Joined: Sun Jun 27, 2004 12:44 am

XPTracker.mac problem(s)

Post by Fabolous1 » Mon Aug 16, 2004 8:28 pm

Code: Select all

||-- XPTracker.mac 
|-- by Kambic 
|-- Version 1.0.1 
|-- August 10th, 2004 
|---------------------------------------------------- 
|-- Macro will track the immediate experience gained after each gain, as well as keep a running total 

#event SoloExp "You gain experience#*#" 
#event GroupExp "You gain party experience#*#" 
#event RaidExp "You gained raid experience#*#" 
#event GroupLeaderExp "You gain group leadership experience#*#" 
#event RaidLeaderExp "You gain raid leadership experience#*#" 
#event LeveUp "#*#Welcome to Level#*#" 
#event LevelDown "#*#You have LOST#*#" 



Sub Main 
   /echo Beginning XPTracker... 

   /declare StandardSoloOldExp float outer 
   /declare StandardSoloNewExp float outer 
   /declare StandardSoloGainedExp float outer 
   /declare TotalStandardSoloGainedExp float outer 

   /declare StandardGroupOldExp float outer 
   /declare StandardGroupNewExp float outer 
   /declare StandardGroupGainedExp float outer 
   /declare TotalStandardGroupGainedExp float outer 

   /declare StandardRaidOldExp float outer 
   /declare StandardRaidNewExp float outer 
   /declare StandardRaidGainedExp float outer 
   /declare TotalStandardRaidGainedExp float outer 

   /declare TotalStandardAbsoluteGainedExp float outer 

   /declare AAOldExp float outer 
   /declare AANewExp float outer 
   /declare AAGainedExp float outer 
   /declare TotalAAGainedExp float outer 

   /declare GroupLeaderOldExp float outer 
   /declare GroupLeaderNewExp float outer 
   /declare GroupLeaderGainedExp float outer 
   /declare TotalGroupLeaderGainedExp float outer 

   /declare RaidLeaderOldExp float outer 
   /declare RaidLeaderNewExp float outer 
   /declare RaidLeaderGainedExp float outer 
   /declare TotalRaidLeaderGainedExp float outer 

   /varset StandardSoloOldExp ${Me.PctExp} 
   /varset StandardSoloNewExp 0 
   /varset StandardSoloGainedExp 0 

   /varset StandardGroupOldExp ${Me.PctExp} 
   /varset StandardGroupNewExp 0 
   /varset StandardGroupGainedExp 0 

   /varset StandardRaidOldExp ${Me.PctExp} 
   /varset StandardRaidNewExp 0 
   /varset StandardRaidGainedExp 0 

   /varset TotalStandardAbsoluteGainedExp 0 

   /varset AAOldExp ${Me.PctAAExp} 
   /varset AANewExp 0 
   /varset AAGainedExp 0 

   /varset GroupLeaderOldExp ${Me.PctGroupLeaderExp} 
   /varset GroupLeaderNewExp 0 
   /varset GroupLeaderGainedExp 0 

   /varset RaidLeaderOldExp ${Me.PctGroupLeaderExp} 
   /varset RaidLeaderNewExp 0 
   /varset RaidLeaderGainedExp 0 

:loopy 
/doevents 
/goto :loopy 

/return 



Sub CheckAAChange 
   /varset AANewExp ${Me.PctAAExp} 
   /if (${AANewExp}!=${AAOldExp}) { 
      /call CalculateAAExpChange 
      /echo AA Gained: ${AAGainedExp} || AA Total: ${TotalAAGainedExp} 
   } 
/return 
      


Sub CalculateStandardSoloExpChange 
   /varset StandardSoloNewExp ${Me.PctExp} 
   /varcalc StandardSoloGainedExp (${StandardSoloNewExp}-${StandardSoloOldExp}) 
   /varcalc TotalStandardSoloGainedExp (${TotalStandardSoloGainedExp}+${StandardSoloGainedExp}) 
   /varset StandardSoloOldExp ${Me.PctExp} 
   /call CheckAAChange 
/return 



Sub CalculateStandardGroupExpChange 
   /varset StandardGroupNewExp ${Me.PctExp} 
   /varcalc StandardGroupGainedExp (${StandardGroupNewExp}-${StandardGroupOldExp}) 
   /varcalc TotalStandardGroupGainedExp (${TotalStandardGroupGainedExp}+${StandardGroupGainedExp}) 
   /varset StandardGroupOldExp ${Me.PctExp} 
   /call CheckAAChange 
/return 



Sub CalculateStandardRaidExpChange 
   /varset StandardRaidNewExp ${Me.PctExp} 
   /varcalc StandardRaidGainedExp (${StandardRaidNewExp}-${StandardRaidOldExp}) 
   /varcalc TotalStandardRaidGainedExp (${TotalStandardRaidGainedExp}+${StandardRaidGainedExp}) 
   /varset StandardRaidOldExp ${Me.PctExp} 
   /call CheckAAChange 
/return 



Sub CalculateAAExpChange 
   /varcalc AAGainedExp (${AANewExp}-${AAOldExp}) 
   /varcalc TotalAAGainedExp (${TotalAAGainedExp}+${AAGainedExp}) 
   /varset AAOldExp ${Me.PctAAExp} 
/return 



Sub CalculateGroupLeaderExpChange 
   /varset GroupLeaderNewExp ${Me.PctGroupLeaderExp} 
   /varcalc GroupLeaderGainedExp (${GroupLeaderNewExp}-${GroupLeaderOldExp}) 
   /varcalc TotalGroupLeaderGainedExp (${TotalGroupLeaderGainedExp}+${GroupLeaderGainedExp}) 
   /varset GroupLeaderOldExp ${Me.PctGroupLeaderExp} 
/return 



Sub CalculateRaidLeaderExpChange 
   /varset RaidLeaderNewExp ${Me.PctRaidLeaderExp} 
   /varcalc RaidLeaderGainedExp (${RaidLeaderNewExp}-${RaidLeaderOldExp}) 
   /varcalc TotalRaidLeaderGainedExp (${TotalRaidLeaderGainedExp}+${RaidLeaderGainedExp}) 
   /varset RaidLeaderOldExp ${Me.PctRaidLeaderExp} 
/return 



Sub AddSoloGroupRaidStandardExp 
   /varcalc TotalStandardAbsoluteGainedExp 
(${TotalStandardSoloGainedExp}+${TotalStandardGroupGainedExp}+${TotalStandardRaidGainedExp}) 
/return 



Sub Event_SoloExp 
   /call CalculateStandardSoloExpChange 
   /call AddSoloGroupRaidStandardExp 
   /echo XP Gained: ${StandardSoloGainedExp} || XP Total: ${TotalStandardAbsoluteGainedExp} 
   /echo *********************************** 
/return 



Sub Event_GroupExp 
   /call CalculateStandardGroupExpChange 
   /call AddSoloGroupRaidStandardExp 
   /echo XP Gained: ${StandardGroupGainedExp} || XP Total: ${TotalStandardAbsoluteGainedExp} 
   /echo *********************************** 
/return 



Sub Event_RaidExp 
   /call CalculateStandardRaidExpChange 
   /call AddSoloGroupRaidStandardExp 
   /echo XP Gained: ${StandardRaidGainedExp} || XP Total: ${TotalStandardAbsoluteGainedExp} 
   /echo *********************************** 
/return 



Sub Event_GroupLeaderExp 
   /call CalculateGroupLeaderExpChange 
   /echo GL Gained: ${GroupLeaderGainedExp} || GL Total: ${TotalGroupLeaderGainedExp} 
/return 



Sub Event_RaidLeaderExp 
   /call CalculateRaidLeaderExpChange 
   /echo RL Gained: ${RaidLeaderGainedExp} || RL Total: ${TotalRaidLeaderGainedExp} 
/return 



Sub Event_LevelUp 
   /varset TotalStandardGainedExp (${TotalStandardGainedExp}+100) 
/return 



Sub Event_LevelDown 
   /varset TotalStandardGainedExp (${TotalStandardGainedExp}-100) 
/return 
This macro work's fine for me. Well the experience gain part..... But whenever I gain exp (atleast group exp) it will do

Code: Select all

   /echo XP Gained: ${StandardGroupGainedExp} || XP Total: ${TotalStandardAbsoluteGainedExp} 
   /echo *********************************** 
However, XP Total doesnt work and when I gain exp I also get all these errors above the 2 echo's, it says ERROR: /varcalc something formulae
or something, sorry ill repost the error in a while, i just went ld..... I've been trying to fix it for a while and I can't figure out how. Can someone please post the fixed code...

Thanks!

Fabolous1
a ghoul
a ghoul
Posts: 134
Joined: Sun Jun 27, 2004 12:44 am

Post by Fabolous1 » Mon Aug 16, 2004 9:25 pm

Got the error:
Usge: /varcalc varname> <formula>
DoCommand - Couldn't parse
'(${TotalStandardSoloGainedExp}+${TotalStandardGroupGainedExp}+${TotalStandardRaidGainedExp})

XPTracker.mac@155 (AddSoloGroupRaidStandardExp):
(${TotalStandardSoloGainedExp}+${TotalStandardGroupGainedExp}+${TotalStandardRaidGainedExp})
XPTracker.mac@171 (Event_GroupExp): /call
AddSoloGroupRaidStandardExp
XPTracker.mac@79 (Main): :loopy
If I typed this right

No_Idea_At_All
a lesser mummy
a lesser mummy
Posts: 49
Joined: Sat Aug 07, 2004 11:28 pm

Post by No_Idea_At_All » Mon Aug 16, 2004 10:40 pm

I had this problem too. It is not in the macro just the fact that the forum has split 1 line over 2 so when copying and pasting you need to just remove the CR.

Code: Select all

AddSoloGroupRaidStandardExp
is the procedure it is only 1 line of code.

Fabolous1
a ghoul
a ghoul
Posts: 134
Joined: Sun Jun 27, 2004 12:44 am

Post by Fabolous1 » Mon Aug 16, 2004 10:52 pm

umm.... wha? lol :?: :?: :?

Fabolous1
a ghoul
a ghoul
Posts: 134
Joined: Sun Jun 27, 2004 12:44 am

Post by Fabolous1 » Mon Aug 16, 2004 10:54 pm

can you please post the code, fixed? Im a little dumb lol

User avatar
Night Hawk
a grimling bloodguard
a grimling bloodguard
Posts: 590
Joined: Fri Aug 13, 2004 4:56 pm

Post by Night Hawk » Mon Aug 16, 2004 11:09 pm

As he stated:

" had this problem too. It is not in the macro just the fact that the forum has split 1 line over 2 so when copying and pasting "

look in the macro in the editor you use and see if any lines have been pushed down to the next line.

EDIT --

it's right here:

Code: Select all

Sub AddSoloGroupRaidStandardExp 
   /varcalc TotalStandardAbsoluteGainedExp 
(${TotalStandardSoloGainedExp}+${TotalStandardGroupGainedExp}+${TotalStandardRaidGainedExp}) 
/return
That /varset shoud al be on one line, NOT two. When posting on the forums, it gets auto-pushed down to the next line as too not take too much horizontal space.

Fabolous1
a ghoul
a ghoul
Posts: 134
Joined: Sun Jun 27, 2004 12:44 am

Post by Fabolous1 » Mon Aug 16, 2004 11:22 pm

Mine was already like that, still not fixed..

User avatar
Night Hawk
a grimling bloodguard
a grimling bloodguard
Posts: 590
Joined: Fri Aug 13, 2004 4:56 pm

Post by Night Hawk » Mon Aug 16, 2004 11:26 pm

Did you put a space between the name and the first opening parenthasis?

Fabolous1
a ghoul
a ghoul
Posts: 134
Joined: Sun Jun 27, 2004 12:44 am

Post by Fabolous1 » Mon Aug 16, 2004 11:27 pm

Yes
Sub AddSoloGroupRaidStandardExp
/varcalc TotalStandardAbsoluteGainedExp (${TotalStandardSoloGainedExp}+${TotalStandardGroupGainedExp}+${TotalStandardRaidGainedExp})
/return

Fabolous1
a ghoul
a ghoul
Posts: 134
Joined: Sun Jun 27, 2004 12:44 am

Post by Fabolous1 » Mon Aug 16, 2004 11:39 pm

omg ive been messing with it and somehow i got it working, thanks tho guys!

mercdev
a lesser mummy
a lesser mummy
Posts: 52
Joined: Thu Jul 29, 2004 7:22 pm

Post by mercdev » Thu Aug 19, 2004 3:37 am

Code: Select all

#event LeveUp "#*#Welcome to Level#*#"
should be

Code: Select all

#event LevelUp "#*#Welcome to Level#*#"

User avatar
Fuergrissa
a grimling bloodguard
a grimling bloodguard
Posts: 607
Joined: Mon Dec 08, 2003 3:46 pm
Location: UK

Post by Fuergrissa » Thu Aug 19, 2004 4:01 am

mercdev wrote:

Code: Select all

#event LeveUp "#*#Welcome to Level#*#"
should be

Code: Select all

#event LevelUp "#*#Welcome to Level#*#"
Now im pissed :)

Whenever people post code for help alot of the time the events are screwed because of spelling/Capitalization or no /doevents, i Allways scan events first, i have been using this mac for about 2 months and i never noticed that typo.
Time for new glasses i think.

Good Job MercDev
[quote]"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."[/quote]