• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

Question - HUD If statements - literally parsed

Joined
Jan 14, 2016
RedCents
1,418¢
I am trying to display something in my HUD in a different color depending on the result of an If test.

However the If is being dealt with literally. Is there a way to flag code as do not parse? Or maybe the opposite, Do Parse?

Rich (BB code):
MeInvis=3,6,650,300,${If[${Me.Invis},000,255]},${If[${Me.Invis},255,000]},000, ${Me}

The code example displays 000,000, MyName. I want it to recognize the output of the If statement as runnable code. Make sense?

I believe there are times when you want standard macro code parsed literally, and others not literally, but I can't find how to tell MQ2Code (or main) to switch between the two. I even forget what this is called but iirc there was a way to parse, and not parse, in C++. is there an escape character?

I hope my request is clear.

Thx in advance!
 
the MQ2HUD is a little different to work with. Its been a long while since I set mine up but

Rich (BB code):
Macro1=3,110,111,0,250,0,${If[${Macro.Name.NotEqual["NULL"]},${Macro.Name},]}
This shows the name of the macro only if one is running, otherwise it displays nothing.

Rich (BB code):
GMInd3=3,30,89,255,0,0,${If[${Spawn[gm].ID},GM In Zone!,]} 
GMInd4=3,30,89,0,250,0,${If[${Spawn[gm].ID},,None In Zone]}
Top line will show a red "GM In ZONE!" otherwise is blank.
Bottom line will show a green "None in zone" otherwise is blank.
Both lines are set to appear in the same place but only one shows at a time.

So I imagine if you try making one line for invis and making it X color and text. Then make a second line for when you are not invis, with different color and text, that would be what you are driving at?

so something like
Rich (BB code):
MeInvis1=3,6,650,300,000,255,${Me.Invis},${Me}
MeInvis2=3,6,650,300,255,000,${Me.Invis},,${Me}

Insomnia kicking in so sorry if I sound a little off =P

Just to toss this out there, sometimes it is hard to read the text on some backgrounds, as this is not displaying in any sort of window but directly on top of what ever graphics the game is displaying. You can how ever sort of cheat with that

Rich (BB code):
Time1=3,10,42,255,255,255,TIME:
Time2=3,40,42,0,255,0,${Time.Time12}
TimeBG=3,8,41,000,000,000,||||||||||||||||||||||||||||||||||||||||
TimeBG2=3,9,42,000,000,000,||||||||||||||||||||||||||||||||||||||||
TimeBG3=3,8,38,000,000,000,=============
TimeBG4=3,8,46,000,000,000,=============
you can put black (or what ever color) pipe symbols there as a background. Obviously the pipe symbols would have spaces... about 1 pixel wise. So you make a second line of pip symbols... 1 pixel over. Pressto! black background to display your green game time, with some snazzy equal signs for good measure!
 
Here are couple more examples to look at:
Checks distance to target and my class, changes color and message depending on the distance. Basically answers the question is the target in range for vigorous shriken AA or Guardian Blade, throwing weapon, for monk or if warrior throw/bow range.
Rich (BB code):
Monk1=3,575,160,0,255,0,${If[(${Me.Class.Name.Equal[Monk]}&&${Target.ID}&&${Target.Distance}<175),Throw Shurikun or Blade,]}
Monk2=3,575,160,255,255,0,${If[(${Me.Class.Name.Equal[Monk]}&&${Target.ID}&&${Target.Distance}>175&&${Target.Distance}<250),Throw Blade only,]}
Monk3=3,575,160,255,0,0,${If[(${Me.Class.Name.Equal[Monk]}&&${Target.ID}&&${Target.Distance}>250),Wait for it,]}

Warrior1=3,575,160,0,255,0,${If[(${Me.Class.Name.Equal[Warrior]}&&${Target.ID}&&${Target.Distance}<250),Throw Blade or Fire Bow,]}
Warrior2=3,575,160,255,255,0,${If[(${Me.Class.Name.Equal[Warrior]}&&${Target.ID}&&${Target.Distance}>250&&${Target.Distance}<350),Fire Bow only,]}
Warrior3=3,575,160,255,0,0,${If[(${Me.Class.Name.Equal[Warrior]}&&${Target.ID}&&${Target.Distance}>350),Wait for it,]}


This next one checks distance to the closest spawn and warns if I'm getting too close by changing color from green (safe), yellow (risky), red (danger)

Rich (BB code):
ClosestSpawn1=3,575,180,0,255,0,${If[(${Me.NearestSpawn[NPC].Distance}>100),Closest NPC  ${Me.NearestSpawn[NPC].Distance},]}
ClosestSpawn2=3,575,180,255,255,0,${If[(${Me.NearestSpawn[NPC].Distance}<100&&${Me.NearestSpawn[NPC].Distance}>35),Closest NPC  ${Me.NearestSpawn[NPC].Distance},]}
ClosestSpawn3=3,575,180,255,255,255,${If[(${Me.NearestSpawn[NPC].Distance}<35),Closest NPC  ${Me.NearestSpawn[NPC].Distance},]}

I know the placement of the brackets, parentheses and comma's is critical to making it work right. Not sure I could do it again, been long time since I set this up.
 
I saw one once more time remaining on the disc running, always ment to find that one again for when I am running tanks and tweaking response times
 
I've manage to get some pretty cool results; My group's names are in the leader's HUD and color coded to if they are within a range, invis, and in zone. I was just hoping to set the RGB values as the result of an IF statement to avoid having some 5 lines of HUD code going to the same pixel spot for each grp members (that's 30 lines). I also worry about creating lag with all these IF's since the HUD fires about every second.

I still think there is a way to have code parsed differently so that the output of said code can be then used as a literal (i.e. RGB code). I remember doing something similar in C/C++ decades ago but I forget what it's called and how to do it. I might have to call around to some of my old coder buddies...

Here is an example for the 5th grp member:
Rich (BB code):
Group5A=3,5,750,300,000,255,000, ${If[${Me.GroupLeader} && ${Group.Member[5].Name.NotEqual[NULL]} && ${Group.Member[5].Type.Equal[PC]} && !${Group.Member[5].Invis} && ${Group.Member[5].Spawn.Distance} < 130 && !${Group.Member[5].OtherZone},${Group.Member[5].Name},]}
Group5B=3,5,750,300,000,000,255, ${If[${Me.GroupLeader} && ${Group.Member[5].Name.NotEqual[NULL]} && ${Group.Member[5].Type.Equal[PC]} && ${Group.Member[5].Invis} && ${Group.Member[5].Spawn.Distance} < 130 && !${Group.Member[5].OtherZone},${Group.Member[5].Name},]}
Group5C=3,5,750,300,255,255,000, ${If[${Me.GroupLeader} && ${Group.Member[5].Name.NotEqual[NULL]} && ${Group.Member[5].Type.Equal[PC]} && ${Group.Member[5].Invis} && ${Group.Member[5].Spawn.Distance} >= 130 && !${Group.Member[5].OtherZone},${Group.Member[5].Name},]}
Group5D=3,5,750,300,255,000,000, ${If[${Me.GroupLeader} && ${Group.Member[5].Name.NotEqual[NULL]} && ${Group.Member[5].Type.Equal[PC]} && !${Group.Member[5].Invis} && ${Group.Member[5].Spawn.Distance} >= 130 && !${Group.Member[5].OtherZone},${Group.Member[5].Name},]}
Group5E=3,5,745,300,255,000,255, ${If[${Me.GroupLeader} && ${Group.Member[5].Name.NotEqual[NULL]} && ${Group.Member[5].OtherZone},*** ${Group.Member[5].Name},]}
 
Last edited:
Question - HUD If statements - literally parsed

Users who are viewing this thread

Back
Top
Cart