• 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 - Odd 'Invis()' behavior

Joined
Nov 23, 2019
RedCents
1,410¢
Seems like this is a Lua thing and not MQ, but here's the observations.

Using ${Me.Invis} and ${Me.Invis[]} seem to work as usual for macros. For example, if I have standard invis all of the following report TRUE. When I drop invis they all return FALSE.
${Me.Invis}, ${Me.Invis[0]}, ${Me.Invis[1]}, ${Me.Invis[ANY]}, ${Me.Invis[NORMAL]}

Using the Lua form ('mq.TLO.Me.Invis()') I get slightly different behavior. Using the following code:
Code:
print(mq.TLO.Me.Invis())
print(mq.TLO.Me.Invis(0)) 
print(mq.TLO.Me.Invis(1))
print(mq.TLO.Me.Invis(2))

I get the following results when invised:
Code:
true
TRUE
TRUE
FALSE

And the following when not invised:
Code:
false
FALSE
FALSE
FALSE

The result values are seemingly correct and as expected except for the case. But when I use the result in a Lua script, the 'true' and 'false' results work as expected, but the uppercase values don't seem to equate. The following code will not work to detect normal invis:
Code:
local invis = mq.TLO.Me.Invis(1)
if invis then

What am I doing wrong (just dipping toe into Lua)?
 
Seems like this is a Lua thing and not MQ, but here's the observations.

Using ${Me.Invis} and ${Me.Invis[]} seem to work as usual for macros. For example, if I have standard invis all of the following report TRUE. When I drop invis they all return FALSE.
${Me.Invis}, ${Me.Invis[0]}, ${Me.Invis[1]}, ${Me.Invis[ANY]}, ${Me.Invis[NORMAL]}

Using the Lua form ('mq.TLO.Me.Invis()') I get slightly different behavior. Using the following code:
Code:
print(mq.TLO.Me.Invis())
print(mq.TLO.Me.Invis(0))
print(mq.TLO.Me.Invis(1))
print(mq.TLO.Me.Invis(2))

I get the following results when invised:
Code:
true
TRUE
TRUE
FALSE

And the following when not invised:
Code:
false
FALSE
FALSE
FALSE

The result values are seemingly correct and as expected except for the case. But when I use the result in a Lua script, the 'true' and 'false' results work as expected, but the uppercase values don't seem to equate. The following code will not work to detect normal invis:
Code:
local invis = mq.TLO.Me.Invis(1)
if invis then

What am I doing wrong (just dipping toe into Lua)?
You need na extra set of () at the end after (1) or (2) to convert the user data TRUE to a Lua true (or false). .Invis() did that but the others didn't because they had an argument passed in, so need the extra () to evaluate.

You could test things out with this to see or print type(something)
 
Last edited:
You need na extra set of () at the end after (1) or (2) to convert the user data TRUE to a lua true (or false). .Invis() did that but the others didn't because they had an argument passed in, so need the extra () to evaluate.

You could test things out with this to see or print type(something)
Thanks. Makes sense. I should have thought that through. In mq.TLO.Me.Invis() the final () adds the user data conversion. My C/C++ brain made that the parameter to 'Invis' and I forgot about the rules. This syntax is going to take some getting used to.

This code worked just fine:
Code:
print(mq.TLO.Me.Invis())
print(mq.TLO.Me.Invis(0)())
print(mq.TLO.Me.Invis('ANY')())
print(mq.TLO.Me.Invis(2)())
 
boolInvis[ANY | 0 ]Gives TRUE/FALSE returns. Options are:
  • ANY or 0 - ${Me.Invis[ANY]} or ${Me.Invis[0]} or ${Me.Invis}
  • NORMAL or 1 - ${Me.Invis[NORMAL]} or just ${Me.Invis[1]}
  • UNDEAD or 2 - ${Me.Invis[UNDEAD]} or just ${Me.Invis[2]}
  • ANIMAL or 3 - ${Me.Invis[ANIMAL]} or just ${Me.Invis[3]}
  • SOS or 4 - ${Me.Invis[SOS]} or just ${Me.Invis[4]} returns true IF you are a ROG AND in fact hidden AND have a skill of at least 100 in HIDE AND have the AA for SoS
 
OK, hate to be a pain but I am trying to make a Lua to provide some handy group functions. I am trying to add a MQ2status-like invis display. But something is happening with Invis() that I don't understand. It is likely something to do with how group information is updated, but here is the issue.

I am using 'mq.TLO.Group.Member(member).Invis(invis_type)()' to determine if a groupie has invis. When they have INVIS and IVU I am expecting to get 'true' for 'invis_type' of 0,1,2. And I do normally, i.e., after I cast bard invis I get 'true' back for any,normal, and undead.

When I make the groupie visible, however, only the 'any/0' call returns 'false'. The normal(1) and undead(2) calls continue to return 'true'. And this isn't just in Lua. If I obtain the same information using '${Group.Member[n].Invis[x]}' I get the same results.

I could maybe deal with this (if 'any' is false then don't care about the rest) except for a related behavior. If I cast bard invis all toons report 'true' for all 3 types. But if I make the main character visible then the other chars continue returning 'true' for any/0, but 'false' for both normal/1 and undead/2. Again, both in the Lua and the MQ TLO. This messes with my logic, as I think the toon has some form of invis, but all the types return 'false'.

MQ2Status seems to not have this problem, so there must be something I can do to get it to work. But I can't seem to figure out the logic to this.
 
OK, hate to be a pain but I am trying to make a LUA to provide some handy group functions. I am trying to add a MQ2status-like invis display. But something is happening with Invis() that I don't understand. It is likely something to do with how group information is updated, but here is the issue.

I am using 'mq.TLO.Group.Member(member).Invis(invis_type)()' to determine if a groupie has invis. When they have INVIS and IVU I am expecting to get 'true' for 'invis_type' of 0,1,2. And I do normally, i.e., after I cast bard invis I get 'true' back for any,normal, and undead.

When I make the groupie visible, however, only the 'any/0' call returns 'false'. The normal(1) and undead(2) calls continue to return 'true'. And this isn't just in LUA. If I obtain the same information using '${Group.Member[n].Invis[x]}' I get the same results.

I could maybe deal with this (if 'any' is false then don't care about the rest) except for a related behavior. If I cast bard invis all toons report 'true' for all 3 types. But if I make the main character visible then the other chars continue returning 'true' for any/0, but 'false' for both normal/1 and undead/2. Again, both in the LUA and the MQ TLO. This messes with my logic, as I think the toon has some form of invis, but all the types return 'false'.

MQ2Status seems to not have this problem, so there must be something I can do to get it to work. But I can't seem to figure out the logic to this.
you can't it doesn't work on other spawns.

you can see my notes in my InvisDisplay Lua which references MQ issue > here <
 
you can't it doesn't work on other spawns.

you can see my notes in my InvisDisplay Lua which references MQ issue > here <
Thanks Sic, now I see this comment:
It turns out that EQ/MQ does not actually allow us to just see *what* type of invis our group member has, just that they HAVE invis.
So it seems that it always returns my value for the individual invis types, but the remote spawns value for the overall. That's what got me - the normal and undead values were being returned from the call, but are basically irrelevant.

Ignore the part I said about MQ2status. I forgot that I am broadcasting the /status command to each toon, who then uses the local info to broadcast it back out.
 
Question - Odd 'Invis()' behavior

Users who are viewing this thread

Back
Top
Cart