• 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

Lua - Trade Summoned Item to Raid Pets

This might be a niche situation so just posting as a script to share. I use this to summon 14x Hammer of Souls and give them to my 14 mag pets in the raid. Spell name, summoned item name and number of pets can be adjusted with variables at the top of the script

hammerpets.lua
Lua:
local mq = require('mq')

    --Trade code from GiveToMe by TheDroidUrLookingFor https://www.redguides.com/community/resources/give-to-me.2876/


local spellName = 'Hammer of Souls'
local summonedItemName = 'Hammer of Souls'
local numberOfPets = 14

local WaitTime = 750

local function InventoryOpen()
    if mq.TLO.Window('InventoryWindow').Open() then return true else return false end
end
local function CheckCursor()
    if mq.TLO.Cursor.ID() == 0 then return false else return true end
end
local function CursorEmpty()
    if mq.TLO.Cursor.ID() == 0 then return true else return false end
end
local function HaveTarget()
    if mq.TLO.Target.ID() ~= nil then return true else return false end
end

local function NavToTrade(navTarget)
    mq.cmd('/nav target')
    while mq.TLO.Navigation.Active() do
        if (mq.TLO.Spawn(navTarget).Distance3D() < 20) then
            mq.cmd('/nav stop')
        end
        mq.delay(50)
    end
end

local function NavTarget(name, spawntype)
    mq.cmd('/target "' .. name .. '" ' .. spawntype)
    mq.delay(2000, HaveTarget)
    mq.cmd('/face')

    if mq.TLO.Spawn(name).Distance3D() > 20 then
        NavToTrade(name)
    end
end

local function ClickTrade()
    mq.delay(WaitTime)
    mq.cmd('/notify TradeWnd TRDW_Trade_Button leftmouseup')
    mq.delay(WaitTime)
end

local function Give(itemName, qty)
    if mq.TLO.FindItem(itemName).ID() ~= nil then
        local itemSlot = mq.TLO.FindItem('='..itemName).ItemSlot()
        local itemSlot2 = mq.TLO.FindItem('='..itemName).ItemSlot2()
        local pickup1 = itemSlot - 22
        local pickup2 = itemSlot2 + 1
        --grab the whole stack, or specific amount
        if qty ~= 'all' and mq.TLO.FindItem('='..itemName).StackCount() >= 1 then
            qty = tonumber(qty)
            mq.cmd('/itemnotify in pack' .. pickup1 .. ' ' .. pickup2 .. ' leftmouseup')
            mq.delay(WaitTime)
            mq.cmd('/notify QuantityWnd QTYW_Slider newvalue ' .. qty)
            mq.delay(WaitTime)
            mq.cmd('/notify QuantityWnd QTYW_Accept_Button leftmouseup')
        else
            mq.cmd('/shift /itemnotify in pack' .. pickup1 .. ' ' .. pickup2 .. ' leftmouseup')
        end
        --Give it
        mq.delay(WaitTime, CheckCursor)
        mq.cmd('/click left target')
        mq.delay(WaitTime, CursorEmpty)
    end
end

if mq.TLO.MacroQuest.GameState() == 'INGAME' then
    --Summon 14 hammers if we don't have any in inventory
    if mq.TLO.FindItem(summonedItemName).ID() == nil then
        for i=1,numberOfPets do
            --cast Hammer of souls
            mq.cmdf('/cast %s', spellName)
            while mq.TLO.Me.Casting() or not mq.TLO.Me.SpellReady(spellName)() do
                mq.delay(1000)
            end
            mq.delay(100)
            mq.cmdf('/autoinventory')
        end
    end

    --Give them to all the mage pets
    --For each raid member
    local raidMemberCount = mq.TLO.Raid.Members()
    InventoryOpen()
    for i=1,raidMemberCount do
        if mq.TLO.Me.CleanName() ~= mq.TLO.Raid.Member(i).CleanName() and mq.TLO.Raid.Member(i).Pet() ~= 'NO PET' then
            local spawntype = 'pet'
            NavTarget(mq.TLO.Raid.Member(i).Pet(), spawntype)

            Give(summonedItemName, 1)

            ClickTrade()

        end
    end
end
 
Lua - Trade Summoned Item to Raid Pets

Users who are viewing this thread

Back
Top
Cart