• 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

RGMercs Setting up UseHealList when raiding

Joined
May 31, 2022
RedCents
4,172¢
So, one of the things when using RGMercs is when you raid there's a few things you need to set up.
Here's my take on setting up a RGMers HealList and adding to your healers list the tanks and healers from the rest of the raid.

I'm not setting this up as a resource, just putting it here as folks may find some parts (or none) useful.

Any constructive feedback is welcome.

Quick note, I did use github prompt to refactor into functions.

Lua:
-- RGOutsideHeal Script
-- This script configures RGMercs to enable or disable outside healing for healers in the same raid group.
-- It adds healers and tanks from other raid groups to the heal list of group healers.
-- Usage: /lua run init.lua enable|disable
-- to do
-- 1. Add check for Dannet
-- 2. If there are no healers or tanks in the raid outside my group, clear list and turn off outside healing
-- 3. Add check to ensure I'm in a group before running /dgga command
-- 4. Add option to only add tanks to heal list, and not other healers
-- 5. Add option to only add healers to heal list, and not tanks
local mq = require('mq')
-- Valid actions for the script
local valid_actions = { enable = true, disable = true }
-- Classes considered healers
local healer_classes = { Cleric = true, Druid = true, Shaman = true }
-- Classes considered tanks
local tank_classes = { Warrior = true, Paladin = true, ["Shadow Knight"] = true }
-- Function to print a fatal error message and exit the script
local function fatal(message)
    printf(message)
    mq.exit()
end
-- Function to validate the action argument passed to the script
local function validate_action(arg)
    if arg and valid_actions[arg] then
        return arg
    end
    fatal("\awIncorrect argument supplied - valid arguments are \ayenable\aw or \aydisable\aw - exiting script")
end
-- Function to check if RGMercs is running, required for this script
local function require_rgmercs()
    if mq.TLO.Lua.Script('rgmercs').Status() ~= 'RUNNING' then
        fatal('RGMercs not running - exiting')
    end
end
-- Function to get the current raid group number of the player
local function my_raid_group()
    local group = mq.TLO.Raid.Member(mq.TLO.Me.CleanName()).Group()
    if group == nil or group == 0 then
        fatal('Not in a raid, or not in raid group - exiting')
    end
    return group
end
-- Function to build a command string from a table of parts
local function build_command(parts)
    for index = 1, #parts do
        parts[index] = tostring(parts[index])
    end
    return table.concat(parts, ' ')
end
-- Function to execute a command with a delay
local function execute_cmd(command)
    mq.cmd(command)
    mq.delay(250)
end
-- Function to collect healers and tanks from the raid, separating group and raid-wide
local function collect_raid_members(my_group_number)
    local group_healers = {}
    local raid_healers = {}
    local raid_tanks = {}
    for i = 1, mq.TLO.Raid.Members() do
        local member = mq.TLO.Raid.Member(i)
        local class = member.Class()
        local group = member.Group()
        if healer_classes[class] then
            if group == my_group_number then
                table.insert(group_healers, member)
            else
                table.insert(raid_healers, member)
            end
        elseif tank_classes[class] and group ~= my_group_number then
            table.insert(raid_tanks, member)
        end
    end
    return group_healers, raid_healers, raid_tanks
end
-- Function to configure a healer's RGMercs settings to include outside healers and tanks
local function configure_healer(healer_name, raid_healers, raid_tanks)
    execute_cmd(build_command({ '/dex', healer_name, '/rgl', 'set', 'UseHealList', true }))
    execute_cmd(build_command({ '/dex', healer_name, '/rgl', 'heallistclear' }))
    for _, raid_healer in ipairs(raid_healers) do
        execute_cmd(build_command({ '/dex', healer_name, '/rgl', 'heallistadd', raid_healer.Name() }))
    end
    for _, raid_tank in ipairs(raid_tanks) do
        execute_cmd(build_command({ '/dex', healer_name, '/rgl', 'heallistadd', raid_tank.Name() }))
    end
end
-- Validate the action argument from script parameters
local action = validate_action((...))
-- Ensure RGMercs is running
require_rgmercs()
-- If disabling, clear heal lists and disable UseHealList for all group members
if action == 'disable' then
    execute_cmd(string.format('/dgga %s', '/rgl heallistclear'))
    execute_cmd(string.format('/dgga %s %s %s', '/rgl set', 'UseHealList', false))
    return
end
-- Get the player's raid group number
local my_group_number = my_raid_group()
-- Collect healers and tanks from the raid
local group_healers, raid_healers, raid_tanks = collect_raid_members(my_group_number)
-- Configure each healer in the group to heal outside targets
for _, healer in ipairs(group_healers) do
    configure_healer(healer.Name(), raid_healers, raid_tanks)
end
 
Last edited:
RGMercs Setting up UseHealList when raiding

Users who are viewing this thread

Back
Top
Cart