• 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 - Constant Spell Interrupts with automated /trackmedown 1 1 1 (lua/Mq2react)

yangwenlii

Active member
Joined
Oct 31, 2020
RedCents
271¢
Version of KissAssist.mac?
12.002
When did your problem start?
December 2020
Character Role?
  1. Assist
What class is having this issue?
  1. Magician
How often does this issue occur?
Sometimes
Can you reproduce the issue?
Can't figure out how to reproduce it intentionally
I recently wrote a simple Lua to automatically use /trackmedown 1 1 1 for my casters since I like to keep my group tight in small spaces and avoid line of sight issues. I periodically run into an issue where all of my caster spells will chain interrupt, and it doesn't correct itself until switching to the next target or disabling the Lua.

Rather than an issue with Kissassist itself, I think this is an issue with my Lua's interaction with kissassist. But I also had the same issue occur using a similar condition in MQ2react and some input would be greatly appreciated.

For reference, this is my Lua:

Lua:
local mq = require('mq')

while true
do
        if mq.TLO.Me.XTarget() > 0 and mq.TLO.Group.Member('CharName').Distance () >= 20 and mq.TLO.Navigation.Active() == false then
            mq.cmd("/trackmedown 1 1 1")
            end
            mq.delay(10)
        end

This is the react I previously used that caused the same issue:

YAML:
  Closer:
    action: /timed 50 /trackmedown 1 1 1
    condition: >-
      ${Target.Type.Equal[NPC]} && ${Me.XTarget}>0 && !${Spawn[pc radius
      20 CharName].ID} && ${Macro[kissassist.mac].Name.Length} && !${Navigation.Active}
 
mq.delay(10)
that is measured in miliseconds so 10 in almost not measurable did you perhaps mean 10 000 for 10 seconds or give it a string value of '10s' ?

mq.delay(val) where val can be an integer (which denotes milliseconds of delay) or a string that ends in 's' 'm' or 'ms' to have delays with human readable durations

Besides that rearrange the code so a condition you test that will almost always fail is first, no need to go test all the other things all the time right ?


Now lets look at the code,
no navigation - possible to move
something on xtarget - possible to move
someone more than 19 units away - move


Lua:
local mq = require('mq')local mq = require('mq')
while true
do
    -- no navigation active
    if mq.TLO.Navigation.Active() == false then
        -- something on xtarget and group leader more than 19 units away
        if mq.TLO.Me.XTarget() > 0 and mq.TLO.Group.Member(mq.TLO.Group.Leader.CleanName()).Distance () >= 20 then
            mq.cmd("/trackmedown 1 1 1")
        end
        mq.delay(500)
    end
    mq.delay(500)
end


Problem I have with this is 19 units is tiny, if the tank moves a bit during the fight your guys is going to try repositioning during the fight ! causing what you see, spell interrupts.

How about changing it like follows.
No movement if you do not have a target.
only do the range check if target changed

Something like this
Lua:
local mq = require('mq')
local targetid = nil
while true do
    if targetid ~= mq.TLO.Target.ID() then
        targetid = mq.TLO.Target.ID()
        -- have a target and no navigation active
        if targetid ~= nil and mq.TLO.Navigation.Active() == false then
            -- group leader more than 19 units away
            if mq.TLO.Group.Member(mq.TLO.Group.Leader.CleanName()).Distance () >= 20 then
                mq.cmd("/trackmedown 1 1 1")
            end
        end
        mq.delay(500)  
    end
    mq.delay(500)
end

PS. Thoughts just off the top of my head, probably some edge cases like repeatedly pulling same mob with same targetID
PPS Stick to one format if you have the do on a separate line then have the then also on separate line, be consistent. makes it easier for others to read
PPPS avoid hardcoded character names like the plague
 
Last edited:
Well I'll be damned. You are my savior. That was the issue. Was going wayyy to fast. Thank you!

Thank you for those edits as well, I am just getting the hang of this, and it is a big help.
 
Last edited:
Question - Constant Spell Interrupts with automated /trackmedown 1 1 1 (lua/Mq2react)

Users who are viewing this thread

Back
Top
Cart