# casts with current mana. Help!

Forum for posting custom UIs, portions of UIs, and HUD stuff using MQ's enhancements.

Moderator: MacroQuest Developers

brianman
a ghoul
a ghoul
Posts: 114
Joined: Mon Jun 07, 2004 7:46 am

# casts with current mana. Help!

Post by brianman » Tue Aug 30, 2005 7:15 am

I'm trying to add # of casts with current mana to each spell slot using MQ2HUD, but I seem to get errors all the time, inspired from the MQ enabled Sars UI (can be found by searching for Sars) found on these boards.

Doesn't work because the String object is apparently removed.

Code: Select all

ManaCast9	= 3,5,805,255,255,255,${If[${String[${Me.Gem[9]}].NotEqual["NULL"]},${Math.Calc[${Me.CurrentMana}/${Me.Gem[9].Mana}].Int},]}
These doesn't work, it seems like it returns true and executes the division anyway, and then when the spell slot is empty is it tries to divide by zeo.

Code: Select all

ManaCast9	= 3,5,805,255,255,255,${If[${Me.Gem[9].NotEqual["NULL"]},${Math.Calc[${Me.CurrentMana}/${Me.Gem[9].Mana}].Int},]}

ManaCast9	= 3,5,805,255,255,255,${If[${Me.Gem[9].ID.NotEqual["NULL"]},${Math.Calc[${Me.CurrentMana}/${Me.Gem[9].Mana}].Int},]}

ManaCast9	= 3,5,805,255,255,255,${If[${Me.Gem[9].ID["NULL"]},${Math.Calc[${Me.CurrentMana}/${Me.Gem[9].Mana}].Int},]}

Can anyone tell me what I'm doing wrong?


Here's my complete MQ2HUD.ini file for any that would like to use.
The setup is arranged for a Sars UI @ 1600x1200. Lot of the parts have been gleaned from other HUD examples on these boards.

Code: Select all

[MyHUD]
;Misc info
Time		= 3,50,927,255,255,255,${Time.Time24}
Loc		= 3,150,927,255,255,255,${Me.Y}, ${Me.X}, ${Me.Z}
Speed		= 3,10,927,255,255,255,${Int[${Me.Speed}]}
HPRegen		= 3,25,895,255,255,0,${Int[${Math.Calc[(${Me.MaxHPs}-${Me.CurrentHPs})/(${Me.HPRegen}|1)/10]}]}m ${Int[${Math.Calc[(${Me.MaxHPs}-${Me.CurrentHPs})/(${Me.HPRegen}|1)%10*6]}]}s (${Me.HPRegen})
ManaRegen	= 3,25,912,255,255,0,${Int[${Math.Calc[(${Me.MaxMana}-${Me.CurrentMana})/(${Me.ManaRegen}|1)/10]}]}m ${Int[${Math.Calc[(${Me.MaxMana}-${Me.CurrentMana})/(${Me.ManaRegen}|1)%10*6]}]}s (${Me.ManaRegen})
Casting		= 3,290,875,255,255,255,${If[${Me.Casting.ID}>0,${Me.Casting},]}

;Target info
TargetLevel	= 3,478,840,255,255,255,${Target.Level}
TargetClass	= 3,450,840,255,234,8,${Target.Class.ShortName}
TargetDistance	= 3,400,840,16,255,255,${Target.Distance}
TargetHeading	= 3,370,856,255,255,255,${Target.HeadingTo}
TargetSpeed	= 3,500,840,255,255,255,${Target.Speed}

;Mana/spells
;ManaCast1	= 3,5,805,255,255,255,${If[${Me.Gem[1].ID.NotEqual["NULL"]},${Math.Calc[${Me.CurrentMana}/${Me.Gem[1].Mana}].Int},]}
;ManaCast2	= 3,5,581,255,255,255,${Math.Calc[${Me.CurrentMana}/${Me.Gem[2].Mana}].Int}
;ManaCast3	= 3,5,613,255,255,255,${Math.Calc[${Me.CurrentMana}/${Me.Gem[3].Mana}].Int}
;ManaCast4	= 3,5,645,255,255,255,${Math.Calc[${Me.CurrentMana}/${Me.Gem[4].Mana}].Int}
;ManaCast5	= 3,5,677,255,255,255,${Math.Calc[${Me.CurrentMana}/${Me.Gem[5].Mana}].Int}
;ManaCast6	= 3,5,709,255,255,255,${Math.Calc[${Me.CurrentMana}/${Me.Gem[6].Mana}].Int}
;ManaCast7	= 3,5,741,255,255,255,${Math.Calc[${Me.CurrentMana}/${Me.Gem[7].Mana}].Int}
;ManaCast8	= 3,5,773,255,255,255,${Math.Calc[${Me.CurrentMana}/${Me.Gem[8].Mana}].Int}
;ManaCast9	= 3,5,805,255,255,255,${If[${Me.Gem[9].ID.NotEqual["NULL"]},${Math.Calc[${Me.CurrentMana}/${Me.Gem[9].Mana}].Int},]}


;Buffs
Buff1		= 3,1450,6,255,0,0,${If[${Me.Buff[1].Duration.TimeHMS.NotEqual["NULL"]},${Me.Buff[1].Duration.TimeHMS},]}
Buff2		= 3,1450,35,255,0,0,${If[${Me.Buff[2].Duration.TimeHMS.NotEqual["NULL"]},${Me.Buff[2].Duration.TimeHMS},]}
Buff3		= 3,1450,64,255,0,0,${If[${Me.Buff[3].Duration.TimeHMS.NotEqual["NULL"]},${Me.Buff[3].Duration.TimeHMS},]}
Buff4		= 3,1450,93,255,0,0,${If[${Me.Buff[4].Duration.TimeHMS.NotEqual["NULL"]},${Me.Buff[4].Duration.TimeHMS},]}
Buff5		= 3,1450,122,255,0,0,${If[${Me.Buff[5].Duration.TimeHMS.NotEqual["NULL"]},${Me.Buff[5].Duration.TimeHMS},]}
Buff6		= 3,1450,151,255,0,0,${If[${Me.Buff[6].Duration.TimeHMS.NotEqual["NULL"]},${Me.Buff[6].Duration.TimeHMS},]}
Buff7		= 3,1450,180,255,0,0,${If[${Me.Buff[7].Duration.TimeHMS.NotEqual["NULL"]},${Me.Buff[7].Duration.TimeHMS},]}
Buff8		= 3,1450,209,255,0,0,${If[${Me.Buff[8].Duration.TimeHMS.NotEqual["NULL"]},${Me.Buff[8].Duration.TimeHMS},]}
Buff9		= 3,1450,238,255,0,0,${If[${Me.Buff[9].Duration.TimeHMS.NotEqual["NULL"]},${Me.Buff[9].Duration.TimeHMS},]}
Buff10		= 3,1450,267,255,0,0,${If[${Me.Buff[10].Duration.TimeHMS.NotEqual["NULL"]},${Me.Buff[10].Duration.TimeHMS},]}
Buff11		= 3,1450,296,255,0,0,${If[${Me.Buff[11].Duration.TimeHMS.NotEqual["NULL"]},${Me.Buff[11].Duration.TimeHMS},]}
Buff12		= 3,1450,325,255,0,0,${If[${Me.Buff[12].Duration.TimeHMS.NotEqual["NULL"]},${Me.Buff[12].Duration.TimeHMS},]}
Buff13		= 3,1450,354,255,0,0,${If[${Me.Buff[13].Duration.TimeHMS.NotEqual["NULL"]},${Me.Buff[13].Duration.TimeHMS},]}
Buff14		= 3,1450,383,255,0,0,${If[${Me.Buff[14].Duration.TimeHMS.NotEqual["NULL"]},${Me.Buff[14].Duration.TimeHMS},]}
Buff15		= 3,1450,412,255,0,0,${If[${Me.Buff[15].Duration.TimeHMS.NotEqual["NULL"]},${Me.Buff[15].Duration.TimeHMS},]}
Buff16		= 3,1450,441,255,0,0,${If[${Me.Buff[16].Duration.TimeHMS.NotEqual["NULL"]},${Me.Buff[16].Duration.TimeHMS},]}
Buff17		= 3,1450,470,255,0,0,${If[${Me.Buff[17].Duration.TimeHMS.NotEqual["NULL"]},${Me.Buff[17].Duration.TimeHMS},]}
Buff18		= 3,1450,499,255,0,0,${If[${Me.Buff[18].Duration.TimeHMS.NotEqual["NULL"]},${Me.Buff[18].Duration.TimeHMS},]}
Buff19		= 3,1450,528,255,0,0,${If[${Me.Buff[19].Duration.TimeHMS.NotEqual["NULL"]},${Me.Buff[19].Duration.TimeHMS},]}
Buff20		= 3,1450,557,255,0,0,${If[${Me.Buff[20].Duration.TimeHMS.NotEqual["NULL"]},${Me.Buff[20].Duration.TimeHMS},]}
Buff21		= 3,1450,586,255,0,0,${If[${Me.Buff[21].Duration.TimeHMS.NotEqual["NULL"]},${Me.Buff[21].Duration.TimeHMS},]}
Buff22		= 3,1450,615,255,0,0,${If[${Me.Buff[22].Duration.TimeHMS.NotEqual["NULL"]},${Me.Buff[22].Duration.TimeHMS},]}
Buff23		= 3,1450,644,255,0,0,${If[${Me.Buff[23].Duration.TimeHMS.NotEqual["NULL"]},${Me.Buff[23].Duration.TimeHMS},]}
Buff24		= 3,1450,673,255,0,0,${If[${Me.Buff[24].Duration.TimeHMS.NotEqual["NULL"]},${Me.Buff[24].Duration.TimeHMS},]}
Buff25		= 3,1450,702,255,0,0,${If[${Me.Buff[25].Duration.TimeHMS.NotEqual["NULL"]},${Me.Buff[25].Duration.TimeHMS},]}

;Spawns
Spawn1		= 3,10,160,255,255,000,${If[${NearestSpawn[1,npc #].Name.NotEqual["NULL"]},${NearestSpawn[1,npc #].Level}:,]} ${If[${NearestSpawn[1,npc #].Name.NotEqual["NULL"]},${NearestSpawn[1,npc #].CleanName} (${NearestSpawn[1,npc #].Distance}),]}
Spawn2		= 3,10,170,255,255,000,${If[${NearestSpawn[2,npc #].Name.NotEqual["NULL"]},${NearestSpawn[2,npc #].Level}:,]} ${If[${NearestSpawn[2,npc #].Name.NotEqual["NULL"]},${NearestSpawn[2,npc #].CleanName} (${NearestSpawn[2,npc #].Distance}),]}
Spawn3		= 3,10,180,255,255,000,${If[${NearestSpawn[3,npc #].Name.NotEqual["NULL"]},${NearestSpawn[3,npc #].Level}:,]} ${If[${NearestSpawn[3,npc #].Name.NotEqual["NULL"]},${NearestSpawn[3,npc #].CleanName} (${NearestSpawn[3,npc #].Distance}),]}
Spawn4		= 3,10,190,255,255,000,${If[${NearestSpawn[4,npc #].Name.NotEqual["NULL"]},${NearestSpawn[4,npc #].Level}:,]} ${If[${NearestSpawn[4,npc #].Name.NotEqual["NULL"]},${NearestSpawn[4,npc #].CleanName} (${NearestSpawn[4,npc #].Distance}),]}

User avatar
gimp
a grimling bloodguard
a grimling bloodguard
Posts: 584
Joined: Fri Oct 29, 2004 9:28 am
Location: internet

Post by gimp » Tue Aug 30, 2005 7:58 am

Code: Select all

${If[${Me.Gem[1].ID},${Math.Calc[${Me.CurrentMana}/(${Me.Gem[1].Mana}+0.01)].Int},]}

brianman
a ghoul
a ghoul
Posts: 114
Joined: Mon Jun 07, 2004 7:46 am

Post by brianman » Tue Aug 30, 2005 5:23 pm

gimp wrote:

Code: Select all

${If[${Me.Gem[1].ID},${Math.Calc[${Me.CurrentMana}/(${Me.Gem[1].Mana}+0.01)].Int},]}
I think that qualifies as a "dirty hack" :)
It works, was hoping there was a more "correct" way of getting it to work. Using it now, thanks :)

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

Post by Night Hawk » Wed Aug 31, 2005 2:07 am

Has to do with divide by zero errors, in case your out of mana.

I think, as per posted by Lax, it was something like:

Code: Select all

${If[${Me.Gem[1].ID},${Math.Calc[${Me.CurrentMana}/${If[${Me.Gem[1].Mana},${Me.Gem[1].Mana},9999999999]}].Int},]}
Same result.

User avatar
gimp
a grimling bloodguard
a grimling bloodguard
Posts: 584
Joined: Fri Oct 29, 2004 9:28 am
Location: internet

Post by gimp » Wed Aug 31, 2005 2:34 am

brianman wrote:
gimp wrote:

Code: Select all

${If[${Me.Gem[1].ID},${Math.Calc[${Me.CurrentMana}/(${Me.Gem[1].Mana}+0.01)].Int},]}
I think that qualifies as a "dirty hack" :)
It works, was hoping there was a more "correct" way of getting it to work. Using it now, thanks :)
Dirty hack yes, see this thread why it is needed:
http://www.macroquest2.com/phpBB2/viewtopic.php?t=11858

User avatar
FreQuency
a hill giant
a hill giant
Posts: 215
Joined: Tue Sep 23, 2003 6:03 pm

Post by FreQuency » Wed Aug 31, 2005 8:02 am

brianman wrote:
gimp wrote:

Code: Select all

${If[${Me.Gem[1].ID},${Math.Calc[${Me.CurrentMana}/(${Me.Gem[1].Mana}+0.01)].Int},]}
I think that qualifies as a "dirty hack" :)
It works, was hoping there was a more "correct" way of getting it to work. Using it now, thanks :)
I believe thats code from my UI don't call it dirty =P
Frequency
[quote="Lax"] "And before you whine about how we treat our short bus users..."[/quote]
[quote="skyler"]"I come for the comradery, I stay for the positive atmosphere."[/quote]
[quote="dont_know_at_all"]"i rather you not get VIP so i won't feel bad about banning your ass when you keep asking stupid questions"[/quote]

User avatar
gimp
a grimling bloodguard
a grimling bloodguard
Posts: 584
Joined: Fri Oct 29, 2004 9:28 am
Location: internet

Post by gimp » Wed Aug 31, 2005 9:40 am

na i came up with it & it is used in krust, but i guess there is not many other ways of doing it :) i never even found a working download link to frequency or i would probably snag more stuff from you freq :)

A_Druid_00
Macro Maker Extraordinaire
Posts: 2378
Joined: Tue Jul 13, 2004 12:45 pm
Location: Rolling on the Lawn Farting

Post by A_Druid_00 » Wed Aug 31, 2005 9:48 am

You mean Frequency does UIs? I thought all he did was sit in IRC and try to get cyber from all teh chix.
[quote]<DigitalMocking> man, A_Druid_00 really does love those long ass if statements
<dont_know_at_all> i don't use his macro because i'm frightened of it[/quote]
[quote][12:45] <dont_know_at_all> never use a macro when you can really fuck up things with a plugin[/quote]

User avatar
FreQuency
a hill giant
a hill giant
Posts: 215
Joined: Tue Sep 23, 2003 6:03 pm

Post by FreQuency » Wed Aug 31, 2005 9:26 pm

A_Druid_00 wrote:You mean Frequency does UIs? I thought all he did was sit in IRC and try to get cyber from all teh chix.
not all teh chics jsut you druid
Frequency
[quote="Lax"] "And before you whine about how we treat our short bus users..."[/quote]
[quote="skyler"]"I come for the comradery, I stay for the positive atmosphere."[/quote]
[quote="dont_know_at_all"]"i rather you not get VIP so i won't feel bad about banning your ass when you keep asking stupid questions"[/quote]

brianman
a ghoul
a ghoul
Posts: 114
Joined: Mon Jun 07, 2004 7:46 am

Casting..

Post by brianman » Thu Sep 01, 2005 8:26 am

I've got this little one placed on top of my casting bar:

Code: Select all

Casting		= 3,290,874,255,255,0,${If[${Me.Casting.ID}>0,${Me.Casting} (${Me.Gem[1].MyCastTime}),]}
Very simple, shows what I'm casting and my modified casting time.

I was wondering.. I know there are timers in MQ2, tried doing a quick search in the manual and just find the entry under Reference Types..

I trying to make the previos shown line give the following output:

SpellBeingCast (MyCastTimeLeft/MyCastTimeTotal)

Basically I want the "MyCastTimeLeft" to simply be a countdown timer, which starts at the CastTimeTotal and then just counts down.. Is this even possible?

A_Druid_00
Macro Maker Extraordinaire
Posts: 2378
Joined: Tue Jul 13, 2004 12:45 pm
Location: Rolling on the Lawn Farting

Post by A_Druid_00 » Thu Sep 01, 2005 8:33 am

You'd have to add the timer into a macro, and then run that macro in the background. The HUD itself doesn't allow you to declare timers, and the recast time left isn't readily available as part of standard MQ. It's really not worth it hopnestly, but I know spell_routines sets a timer for each spell gem after each /call Cast. If you set up something like that, you can then use the ${SpellRecastTimer[X]} in your HUD.
[quote]<DigitalMocking> man, A_Druid_00 really does love those long ass if statements
<dont_know_at_all> i don't use his macro because i'm frightened of it[/quote]
[quote][12:45] <dont_know_at_all> never use a macro when you can really fuck up things with a plugin[/quote]

brianman
a ghoul
a ghoul
Posts: 114
Joined: Mon Jun 07, 2004 7:46 am

Post by brianman » Thu Sep 01, 2005 10:23 am

Ah, thanks a_druid_00 :)

brianman
a ghoul
a ghoul
Posts: 114
Joined: Mon Jun 07, 2004 7:46 am

Post by brianman » Tue Sep 06, 2005 9:01 am

Does this look correct?
I want to show each group members class and level (if available)..

Code: Select all

${If[${Group.Member[1].Class.ShortName.NotEqual["NULL"]},${Group.Member[1].Class.ShortName,UNK]}
${If[${Group.Member[2].Class.ShortName.NotEqual["NULL"]},${Group.Member[2].Class.ShortName,UNK]}
${If[${Group.Member[3].Class.ShortName.NotEqual["NULL"]},${Group.Member[3].Class.ShortName,UNK]}
${If[${Group.Member[4].Class.ShortName.NotEqual["NULL"]},${Group.Member[4].Class.ShortName,UNK]}
${If[${Group.Member[5].Class.ShortName.NotEqual["NULL"]},${Group.Member[5].Class.ShortName,UNK]}

${If[${Group.Member[1].Level.NotEqual["NULL"]},${Group.Member[1].Level,??]}
${If[${Group.Member[2].Level.NotEqual["NULL"]},${Group.Member[2].Level,??]}
${If[${Group.Member[3].Level.NotEqual["NULL"]},${Group.Member[3].Level,??]}
${If[${Group.Member[4].Level.NotEqual["NULL"]},${Group.Member[4].Level,??]}
${If[${Group.Member[5].Level.NotEqual["NULL"]},${Group.Member[5].Level,??]}
The "UNK" and "??" are there merely for debugging purposes.

User avatar
gimp
a grimling bloodguard
a grimling bloodguard
Posts: 584
Joined: Fri Oct 29, 2004 9:28 am
Location: internet

Post by gimp » Tue Sep 06, 2005 9:06 am

in krust ui group window i do something like this (not at home atm cant cut & paste):

Code: Select all

 
${If[${Group.Member[1].ID},${Group.Member[1].Class.ShortName},]} 
${If[${Group.Member[1].ID},${Group.Member[1].Level},]}  
if .ID is not set, spawn info dont exist (group member [1] is not in group, or not in zone). no point in showing UNK and ??? in all cases in my opinion

brianman
a ghoul
a ghoul
Posts: 114
Joined: Mon Jun 07, 2004 7:46 am

Post by brianman » Tue Sep 06, 2005 1:28 pm

gimp wrote:in krust ui group window i do something like this (not at home atm cant cut & paste):

Code: Select all

 
${If[${Group.Member[1].ID},${Group.Member[1].Class.ShortName},]} 
${If[${Group.Member[1].ID},${Group.Member[1].Level},]}  
if .ID is not set, spawn info dont exist (group member [1] is not in group, or not in zone). no point in showing UNK and ??? in all cases in my opinion
Thanks :)

The ?? and UNK are, as mentioned, only there for debugging purposes to see whether it checked true or false :)