Hopefully simple question about /varcalc

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

loadingpleasewait
a snow griffon
a snow griffon
Posts: 332
Joined: Sat Sep 14, 2002 8:46 am

Hopefully simple question about /varcalc

Post by loadingpleasewait » Thu Oct 09, 2003 10:22 am

Ok, what I have is an event triggerd by the word Experience! to then display precisely how much experience was just gained. However, it doesnt work for some reason.

Code: Select all

Sub Main
   /varset startexp $char(exp)
   /varset startaaxp $char(aa,exp)
I have that set at the begining of the macro, throughout the macro, I have /doevents, the events are fireing, thats not the problem. The problem is here.

Code: Select all

Sub Event_exp
   /varset currentxp $char(exp)
   /varcalc xpgain @currentxp-@startexp
   /varset currentaa $char(aa,exp)
   /varcalc aagain @currentaa-@startaaxp
      /echo "You've gained @xpgain% xp and @currentaa% aaxp."
   /varset startexp $char(exp)
   /varset startaaxp $char(aa,exp)
/return
as you can see, basically it takes the exp you just gained, and then subtracts the experience you started with from that and displays this gain to you.
I currently have 100%exp goin towards aaxp. When the event fires, it displays somthing to the effect of...

[Wed Oct 08 20:53:32 2003] [MacroQuest] "You've gained 0.00% xp and 45.45% aaxp."
[Wed Oct 08 20:56:40 2003] [MacroQuest] "You've gained 0.00% xp and 46.36% aaxp."
[Wed Oct 08 20:57:35 2003] [MacroQuest] "You've gained 0.00% xp and 46.67% aaxp."
[Wed Oct 08 20:58:21 2003] [MacroQuest] "You've gained 0.00% xp and 46.97% aaxp."
[Wed Oct 08 20:59:08 2003] [MacroQuest] "You've gained 0.00% xp and 47.58% aaxp."
[Wed Oct 08 21:00:47 2003] [MacroQuest] "You've gained 0.00% xp and 47.88% aaxp."
[Wed Oct 08 21:01:51 2003] [MacroQuest] "You've gained 0.00% xp and 48.18% aaxp."
[Wed Oct 08 21:02:22 2003] [MacroQuest] "You've gained 0.00% xp and 48.48% aaxp."
[Wed Oct 08 21:03:19 2003] [MacroQuest] "You've gained 0.00% xp and 49.09% aaxp."
[Wed Oct 08 21:04:14 2003] [MacroQuest] "You've gained 0.00% xp and 49.39% aaxp."
[Wed Oct 08 21:04:58 2003] [MacroQuest] "You've gained 0.00% xp and 49.70% aaxp."
[Wed Oct 08 21:06:03 2003] [MacroQuest] "You've gained 0.00% xp and 50.00% aaxp."
[Wed Oct 08 21:06:59 2003] [MacroQuest] "You've gained 0.00% xp and 50.30% aaxp."
[Wed Oct 08 21:07:42 2003] [MacroQuest] "You've gained 0.00% xp and 50.91% aaxp."

BTW, Wow.. that actually looks decent.. kill per minute = ) was a good group last night.. The group later was a higher level group in LDoN, so exp was better, but it was after I dinged an AA so the percentages were like 1% 2% 3% etc.. almost made it look like it was working, which it wasnt..

BUT, the 0%xp looks correct, but the AAXP is displaying the current exp and not the exp gain..

Please Help...

Thanks..
LOADING PLEASE WAIT...

Jabber
a lesser mummy
a lesser mummy
Posts: 32
Joined: Sat Aug 23, 2003 2:45 pm

Post by Jabber » Thu Oct 09, 2003 10:35 am

Hmmm

Code: Select all

/echo "You've gained @xpgain% xp and @currentaa% aaxp." 
shouldn't this be:

Code: Select all

/echo "You've gained @xpgain% xp and [color=red]@aagain[/color] aaxp." 

MacroFiend
a grimling bloodguard
a grimling bloodguard
Posts: 662
Joined: Mon Jul 28, 2003 2:47 am

Post by MacroFiend » Thu Oct 09, 2003 10:38 am

If you look at your code, you /echo is displaying the @currentaa variable (which is what you are describing)

Code: Select all

Sub Event_exp 
   /varset currentxp $char(exp) 
   /varcalc xpgain @currentxp-@startexp 
   /varset currentaa $char(aa,exp) 
   /varcalc aagain @currentaa-@startaaxp 
      /echo "You've gained @xpgain% xp and [color=red]@aagain[/color]% aaxp." 
   /varset startexp $char(exp) 
   /varset startaaxp $char(aa,exp) 
/return

loadingpleasewait
a snow griffon
a snow griffon
Posts: 332
Joined: Sat Sep 14, 2002 8:46 am

Post by loadingpleasewait » Thu Oct 09, 2003 10:57 am

LMAO!! I'm such a dumbass.. demmit man.. thanks.. :D
LOADING PLEASE WAIT...

MacroFiend
a grimling bloodguard
a grimling bloodguard
Posts: 662
Joined: Mon Jul 28, 2003 2:47 am

Post by MacroFiend » Thu Oct 09, 2003 11:18 am

We all make mistakes. Yours showed you the wrong info ... mine tend to crash EQ

rogue
decaying skeleton
decaying skeleton
Posts: 5
Joined: Wed Aug 27, 2003 1:33 pm

Post by rogue » Fri Oct 10, 2003 4:30 pm

When I try to use this I get an error message saying bad variable in /var function from the /varset startexp $char(exp) ?