• Hail, we're RedGuides. We want you to play six (yes, 6!) EverQuest characters at once. We have scripts and a friendly community to help, please join our playstyle and say hello! 👋
  • We've added LLM sections to our Terms & Rules and Resource Rules, for everyone's sanity & in-game safety.
    Read more
    a. Do not replace your voice with an LLM. This goes for your posts and your scripts. Drafting and editing with a tool is fine, but don't take you out of what you share.
    b. Do not replace your EQ character's voice with an LLM. We don't want scripts that speak over /ooc, /shout or other public channels. This has been an unwritten rule that's kept casino scripts off the site for decades, but we're now compelled to make it clear: keep automated communication private.

    Why Does RG Review Scripts?
    Nearly every LLM-written Lua script we see is making your character do impossible things, and rarely in a way that's beneficial to you. We've seen heavy server hammering, /target over impossible distances when /nav spawn would passively accomplish the same thing, a spawn search that fires 20+ times per second, and other pointless actions that are likely annoying GMs.

    You are welcome to use LLMs as a tool to structure, draft, and edit your work, but please read critically before hitting /lua run

Question - How do I get the current target of any arbitrary spawn (AKA How can I get my pet to save my healer merc)?

I often solo with MageKill. I would like my pet to automatically try to save my healer merc if anything attacks it, by taunting it off.
How do I get the target or top aggro holder of any arbitrary spawn without having to rotate all the nearest mobs through my toon's target?
xSpawn.TargetOfTarget does not seem to work.

If this isn't possible then I might look for events where my healer merc takes dmg.
I am open to alternate approaches, the goal is to save the healer whatever it takes.
Thanks in advance for any advice.

Here is some sample code:
SaveHealer
Lua:
---@type Mq
mq = require('mq')

function SaveHealer()
    if mq.TLO.Group.Members() == 0 then return false end

    local healers = {
        ['Cleric'] = true,
        ['Druid'] = true,
        ['Shaman'] = true,
    }
    local save_range = 180
    local myHealers = {}

    -- list group healers
    myHealers[mq.TLO.Me.ID()] = mq.TLO.Me.Name()
    for i = 1, mq.TLO.Group.Members() do
        local member = mq.TLO.Group.Member(i)
        local class = member.Spawn.Class()
        if healers[class] and member.Spawn.Distance3D() < save_range then
            myHealers[member.Spawn.ID()] = member()
        end
    end

    -- check if anything is attacking group healers
    local xSpawn = mq.TLO.NearestSpawn('npc targetable')
    while (xSpawn.Name()) do
        if not xSpawn.Dead() and xSpawn.Distance3D() < save_range then
            if myHealers[xSpawn.TargetOfTarget.ID()] then
                print('-= SAVING =- ' .. myHealers[xSpawn.TargetOfTarget.ID()])
                local id = xSpawn.ID()
                mq.cmd('/pet taunt on')
                mq.delay(100)
                mq.cmd('/pet attack ' .. id)
                mq.delay(100)
                return true
            end
        end
        xSpawn = xSpawn.Next
    end
    return false
end
 
Because EQ mercs are handled by the game differently than player characters, I think this is what the challenge would be. It is far better to consider a FTP healer than use in-game EQ mercs. I understand the pitfalls of needing to have yet another account running, geared, etc. But still. Way better.
 
Because EQ mercs are handled by the game differently than player characters, I think this is what the challenge would be. It is far better to consider a FTP healer than use in-game EQ mercs. I understand the pitfalls of needing to have yet another account running, geared, etc. But still. Way better.
What about saving the human-controlled player healers I play with? How do i find out all the spawns that are hitting my group's healers without DanNet magic?
 
What about saving the human-controlled player healers I play with? How do i find out all the spawns that are hitting my group's healers without DanNet magic?
I don't believe you can. Need Dannet for that I think. There needs to be network (local or machine) feedback. CWTN plugins do not use DanNet, but only monitor on same PC.
 
the CWTN plugins poll data of xtar, so if your human friends are getting smacked, and the target is on the CWTN tank xtar, it will register as a valid target... they wont willy nilly swap, but YOU can hand swap anytime.
 
TargetOfTarget does work, but MQ has to wait for the server to supply the data. You need a long (up to 1s) delay between targetting and polling ToT data.
 
Question - How do I get the current target of any arbitrary spawn (AKA How can I get my pet to save my healer merc)?

Users who are viewing this thread

Back
Top
Cart