• 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

Request - Need some Macro help

Saetun

Active member
Looking for some help identifying my issue with a macro I am working on. I am using MQ2Cast and MQ2DanNet for additional info. The issue I am having is with notifications of what the character is doing. I am using /dgtell all to put it in the MQ2 window. Problem is : with fast cast spells sometimes (most times) it doesn't post any notification. For longer cast spells sometimes it posts the message twice. And sometimes it just does one or the other of the behaviors for no discernable reason. I have tried adding some checks and delays and such and tried various methods to combat this but nothing seems to work 100%. Thanks to CTaylor for the suggestions on DanNet delays and checks, they made my queries rock solid.

Code in question :

Code:
---------------Example sub where spell is cast and notification generated----------------
Sub doncbuffs
    /for gmember 0 to ${Group}
       
        /if (${hpbuff.NotEqual[NULL]}) {
            /varset hpbuffcheck QUERY
            /varset stackcheck QUERY
            /dquery ${Group.Member[${gmember}]} -q "Me.Buff[${hpbufftocheck}].ID" -o hpbuffcheck
            /dquery ${Group.Member[${gmember}]} -q "Spell[${hpbuff}].Stacks" -o stackcheck
            /delay 20 ${hpbuffcheck.NotEqual[QUERY]}&&${stackcheck.NotEqual[QUERY]}
                /if (!${hpbuffcheck} && !${Me.Casting.ID} && ${stackcheck} && ${Group.Member[${gmember}].Present}) {
                    /call castspell "${hpbuff}" ${Group.Member[${gmember}].ID} ${gmember} "${Group.Member[${gmember}]}"
                        /if (${Macro.Return.Equal[CAST_SUCCESS]}) {
                            /dgtell all ==> ${hpbuff} on ${Group.Member[${gmember}]}
                        }
                }
        }
       
        /next gmember
        /return
------------------Castspell routine for reference ------------------------------------------------

Sub castspell(string castspell,int castid,int gmember,string name)
    /if (${Me.CurrentMana}<${Spell[${castspell}].Mana}) /return
    /if (${Window[SpellBookWnd]}) /book
    /if (${Group.Member[${gmember}].FeetWet}!=${Me.FeetWet}) /return
    /if (!${Me.Moving} && ${Spawn[${castid}].Distance}<=${Spell[${castspell}].MyRange} && ${Group.Member[${gmember}].Present} && ${Spawn[${castid}].LineOfSight} && !${Me.Invis}) {
        /casting "${castspell}" ${miscgem} -targetid|${castid}
    }
        /delay 20 ${Cast.Ready[${castspell}]}
        /delay 20 ${Window[CastingWindow].Open}
        /delay ${Math.Calc[(${Spell[${castspell}].MyCastTime}*10)+20]} !${Me.Casting.ID}

        /if (${Cast.Result.NotEqual[CAST_CANCELLED]}) {
            /varset castresult ${Cast.Result}
        } else {
            /varset castresult CAST_CANCELLED
        }
/return ${castresult}
 
Code:
Sub castspell(string castspell,int castid,int gmember,string name)
    /if (${Me.CurrentMana}<${Spell[${castspell}].Mana}) /return
    /if (${Window[SpellBookWnd]}) /book
    /if (${Group.Member[${gmember}].FeetWet}!=${Me.FeetWet}) /return
    /if (!${Me.Moving} && ${Spawn[${castid}].Distance}<=${Spell[${castspell}].MyRange} && ${Group.Member[${gmember}].Present} && ${Spawn[${castid}].LineOfSight} && !${Me.Invis}) {
        /casting "${castspell}" ${miscgem} -targetid|${castid}
        /delay 5
    }
     /if (${Spell[${castspell}].CastTime}) {
         /while (${Window[CastingWindow].Open}) {
              /delay 2
         }
     } else {
         /delay 2
     }
        /if (${Cast.Result.NotEqual[CAST_CANCELLED]}) {
            /varset castresult ${Cast.Result}
        } else {
            /varset castresult CAST_CANCELLED
        }
/return ${castresult}

That's not perfect, but the direction I would be going. If you having issues with instant cast spells, you need to take that into account and have a slight delay so the plugin can have a chance to update Cast.Result. I don't like using MQ2Cast, because it is not stable 100% of the time. It likes to flake out sometimes.
 
Thanks again for the advice. Haven't had a chance to try this out yet but I get the concept. I was certainly having issues with it running over my delays that I had. Been having fun learning MQ2 and working on this and really appreciate the help of the community.
 
Request - Need some Macro help

Users who are viewing this thread

Back
Top
Cart