question about Character.Buff[]

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

Moderator: MacroQuest Developers

OldNecro
a ghoul
a ghoul
Posts: 136
Joined: Thu Dec 19, 2002 3:09 am

question about Character.Buff[]

Post by OldNecro » Thu Apr 22, 2004 7:54 am

The latest version of MQ2 (even with old parms enabled) broke my UI, so I have been trying to update it. I got everything working with the exception of my buff window. The problem is with this line:

${If["${Character.Buff[1].Name}"=="NULL","","${Character.Buff[1].Name} ${Character.Buff[1].Duration}"]}

Haven't been able to find much talk on the boards about the ${If[]} function, as most people are using /newif and don't need the inline If. It's probably just a syntax issue since I'm guessing as to what this line is supposed to look like, but any guidance would be appreciated.

-OldNecro
Saddam Hussein begins to use An Innocent Bystander as a living shield!
An Innocent Bystander ceases protecting Saddam Hussein's corpse.

jumpyfrog
Macro Author
Macro Author
Posts: 100
Joined: Thu Dec 11, 2003 5:42 am

Post by jumpyfrog » Thu Apr 22, 2004 8:57 am

${If["${Character.Buff[1].Name}"=="NULL","","${Character.Buff[1].Name} ${Character.Buff[1].Duration}"]}
should be

${If${Me.Buff[1].Name=="NULL","",${Me.Buff[1].Name} : ${Me.Buff[1].Duration.Time}]}

I think anyway, Im actually not sure if you even need the "" after the truth section of the if statement anymore, someone correct me on that though if need be.

I dont know if Im doing this wrong either, but I dont even use an IF statment. I just go right ahead and print out the buff name and duration remaining. Im not sure if the value returned is NULL and NULL is not printed as a string anymore because it is a true null value, which is my best guess. Cause in my buff window in the slots that have no buff in them I dont get "NULL" or "UNKNOWN" or anything. Just remains blank.
-Mark

Diazepam
a lesser mummy
a lesser mummy
Posts: 31
Joined: Thu Mar 11, 2004 6:26 pm

Post by Diazepam » Thu Apr 22, 2004 10:41 am

jumpyfrog wrote:
I dont know if Im doing this wrong either, but I dont even use an IF statment. I just go right ahead and print out the buff name and duration remaining. Im not sure if the value returned is NULL and NULL is not printed as a string anymore because it is a true null value, which is my best guess.
This is correct. To do what the OP wants to do, all you need is:

Code: Select all

${Me.Buff[1].Name} : ${Me.Buff[1].Duration.Time}
As Lax said, the old way was 100% ass. The new way is only 10% ass. :twisted:

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 » Thu Apr 22, 2004 11:57 am

Nah the NULL thing hasnt changed since the first beta of MQ2.

${Me.Buff[1].Name} : ${Me.Buff[1].Duration.Time}
will indeed show
NULL : NULL

for empty buffs.

MQ2Labels automatically ignores any label that resolves to just "NULL", but this has extra shit in it. To do this on one label, you want to use ${If}. Take my advice and do it on 2 separate labels, like my buff window is (find the first buff window in this forum, where the buff duration and bard song mod was introduced to the UI world).
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

Diazepam
a lesser mummy
a lesser mummy
Posts: 31
Joined: Thu Mar 11, 2004 6:26 pm

Post by Diazepam » Thu Apr 22, 2004 1:35 pm

Doh, my bad. I remembered being happy that I could get rid of all the If shit, but I have the name and duration on separate labels as well.

blamstick
orc pawn
orc pawn
Posts: 27
Joined: Sat Sep 06, 2003 6:50 pm

Post by blamstick » Thu Apr 22, 2004 3:19 pm

Quick fix is to just remove the colon between those - ${Me.Buff[1].Name} ${Me.Buff[1].Duration.Time} and it won't show the NULLs.

homburg
orc pawn
orc pawn
Posts: 20
Joined: Wed Apr 07, 2004 9:52 am

Post by homburg » Sat Apr 24, 2004 9:42 am

Hmm, I did this and it is still showing NULL's. No matter, really, as I'm just glad to works now.