• 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 - Silencing [MQ2] prints on chat

Joined
Mar 20, 2024
RedCents
1,051¢
This is probably silly, but I am spamming my own Main Chat window (plus the MQ window) with my Lua script's mq.cmd commands. As the script cycles, commands such as "/pet attack a_fire_beattle" spams non-stop.

Is there a way to silence a particular line in the code so it doesnt print out on ANY game window?

Thanks!
 
Last edited:
you could also unload the plugin mq2chat so it dont show in your main chat.

and also look into the code to make sure that you dont just overly do pet attacks, there is no reason to do the command if its already attacking, and also filter your pet responses to a spam chat tab.
 
@kaen01 is correct. I was in bed and didn't look too much into your message.
MQ2Chat plugin is sending MQ output to your main chat window. Most people turn this one on by accident meaning to use MQ2ChatWnd which is one that goes to a window.
Alternately, MQ has a built in console that displays all of this information without the need for a plugin.

You would want to avoid repeatedly spamming to send in your pet to attack, or any other command if you can avoid it.
It's just not good practice. This is the equivalent of beating your pet I'm told.
 
@kaen01You would want to avoid repeatedly spamming to send in your pet to attack, or any other command if you can avoid it.

This is an interesting comment I would love you to elaborate further.

My code searches for certain conditions to apply: IF main tank is engaged in combat THEN mq.cmd /assist main tank followed by mq.cmd /pet attack. Obviously, the code cycles around every two or three seconds, so the command /pet attack executes multiple times per fight. Is there any way to only send the pet in once per fight?
 
This is an interesting comment I would love you to elaborate further.

My code searches for certain conditions to apply: IF main tank is engaged in combat THEN mq.cmd /assist main tank followed by mq.cmd /pet attack. Obviously, the code cycles around every two or three seconds, so the command /pet attack executes multiple times per fight. Is there any way to only send the pet in once per fight?
could check if the pets target and if that targets pcthp is not 100, then if it is assume the pet is engaged, and dont send pet attack.
 
This is an interesting comment I would love you to elaborate further.

My code searches for certain conditions to apply: IF main tank is engaged in combat THEN mq.cmd /assist main tank followed by mq.cmd /pet attack. Obviously, the code cycles around every two or three seconds, so the command /pet attack executes multiple times per fight. Is there any way to only send the pet in once per fight?
One way is to set a flag (boolean variable) that is false at start. When you first engage and send pet change the variable to true. On your pet attack line put it behind an if check that wont send the command if the variable is true. Then you need to set the parts that would set the variable back to false (no mobs engaged, pet dead, etc).
 
One way is to set a flag (boolean variable) that is false at start. When you first engage and send pet change the variable to true. On your pet attack line put it behind an if check that wont send the command if the variable is true. Then you need to set the parts that would set the variable back to false (no mobs engaged, pet dead, etc).

Maybe I misunderatand how Lua coding works, but wouldnt that boolean variable reset every time the code cycles around? I mean, I assume that I gotta declare that flag as "false" at the top of the code, so every cycle (2 or 3 seconds) it would go back to false even if I switch it to "true" somewhere lower down in the code. Am I wrong?
 
Maybe I misunderatand how LUA coding works, but wouldnt that boolean variable reset every time the code cycles around? I mean, I assume that I gotta declare that flag as "false" at the top of the code, so every cycle (2 or 3 seconds) it would go back to false even if I switch it to "true" somewhere lower down in the code. Am I wrong?
if you declare the variable outside the loop, then it would exist separate from the loop, but still let you change the value during the loop.
 
This is an interesting comment I would love you to elaborate further.

My code searches for certain conditions to apply: IF main tank is engaged in combat THEN mq.cmd /assist main tank followed by mq.cmd /pet attack. Obviously, the code cycles around every two or three seconds, so the command /pet attack executes multiple times per fight. Is there any way to only send the pet in once per fight?
If you share your project then I am sure some Lua pro might be able to help you out.
 
I would say Kaen's suggested method would be more accurate.
Pets only get targets when they're engaged in combat. So if the pet has a target, then the pet is engaged. No need for a bool that you have to manually track, either the pet is or is not engaged.
Since you have a pet window, the information about the pets target is always available (Unlike another player or NPCs target).

Have a look see as some examples of the Pet TLO.

and here is the listed members of the Pet TLO.

Fair warning, I don't Lua. Pretend this is in Lua or something.
Code:
CombatRoutine() {
  if (!Pet.Target.ID) {
    /pet attack
  }
  //Other combat things here!
}

I believe Lua is mq.TLO.Pet.Target.ID or something like that.

With that said, there is a ton of information on the TLOs, their members, and what data type they return. In this case it's Pet TLO, it has a member Target, which has a return type of spawn.
spawn will then have it's own members. Spawn is generic information available about spawns in the game. Things such as their ID, if they're current casting, their cleanname. Some things in the Spawn TLO are not always available, but that distinction isn't made in the docs. Things like MaxHPs for another NPC would be 100, because the most they can have is 100%. But if you do ${Me.MaxHPs} it would likely return the actual health number. Things like MaxMana have a note that says it only updates when targeted/grouped with the spawn. etc.

Tons and tons of information in the documentation that can lead you down at least knowing what information you have available to you. It's still up to you to understand how to use that information.
 
I would say Kaen's suggested method would be more accurate.
Pets only get targets when they're engaged in combat. So if the pet has a target, then the pet is engaged. No need for a bool.
Code:
CombatRoutine() {
  if (!Pet.Target.ID) {
    /pet attack
  }
  //Other combat things here!
}

I believe Lua is mq.TLO.Pet.Target.ID or something like that.

Simple and effective. This is the path I will follow! Thank you sir, very helpful indeed :)
 
Question - Silencing [MQ2] prints on chat

Users who are viewing this thread

Back
Top
Cart