• 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

Problem - Macro will cast on everything not just NPCs with Target.Type.Equal[NPC]

zathus

Well-known member
I am not sure if the code was updated to something else but it used to not cast on PCs at all, now using the following code it just casts no mater what. the issue is if i accidently target myself i end up casting on myself. any advice?

Code:
/if (${Target.Type.Equal[NPC]} && !${Target.MyBuff[${Me.Gem[1].Name}].ID} || ${Target.MyBuff[${Me.Gem[1].Name}].Duration.Seconds}<2) /cast 1
 
What is this from?

If you target yourself what does ${Target.Type.Equal[NPC]} evaluate to?
Not sure i understand your question. if i target myself it just keeps going. if i use this macro, it just casts spell 1 no mater what i target

Code:
#warning
#turbo 140

Sub Main
:Loop
/delay 5s ${Me.SpellReady[1]}
/if (${Target.Type.Equal[NPC]} && !${Target.MyBuff[${Me.Gem[1].Name}].ID} || ${Target.MyBuff[${Me.Gem[1].Name}].Duration.Seconds}<1) /cast 1

/goto :Loop
 
its probably because you have the npc check in the first "and" and then there's nothing on the second "or" so it would fire if only the last condition is reached.

Id try adding the NPC check as an AND with the check after the "or"

so basically your saying if this is true
{Target.Type.Equal[NPC]} && !${Target.MyBuff[${Me.Gem[1].Name}].ID}

or

${Target.MyBuff[${Me.Gem[1].Name}].Duration.Seconds}<1
 
its probably because you have the npc check in the first "and" and then there's nothing on the second "or" so it would fire if only the last condition is reached.

Id try adding the NPC check as an AND with the check after the "or"

so basically your saying if this is true
{Target.Type.Equal[NPC]} && !${Target.MyBuff[${Me.Gem[1].Name}].ID}

or

${Target.MyBuff[${Me.Gem[1].Name}].Duration.Seconds}<1
You are correct! thank you. changing it to this worked so the "Or" also checks to see if the target is a NPC

/if (${Target.Type.Equal[NPC]} && !${Target.MyBuff[${Me.Gem[1].Name}].ID} || ${Target.Type.Equal[NPC]} && ${Target.MyBuff[${Me.Gem[1].Name}].Duration.Seconds}<1) /cast 1

Edit: come to think of it. This all might be redundant and more complicated then need be. if ${Target.MyBuff[${Me.Gem[1].Name}].Duration.Seconds}<1 isnt meet, its going to cast 1. so why have !${Target.MyBuff[${Me.Gem[1].Name}].ID} in the first place. I have like 30 of these and feel like i made them more complicated then i needed too lol
 
Last edited:
Use extra parenthesis to get the right order of operations.
( A && B || C ) does the "A && B" first and then evaluates that sub-result against "|| C"

If, instead, you want A to be present with B or C, you need to do ( A && ( B || C ) )
 
Use extra parenthesis to get the right order of operations.
( A && B || C ) does the "A && B" first and then evaluates that sub-result against "|| C"

If, instead, you want A to be present with B or C, you need to do ( A && ( B || C ) )
Thats so cool! Opens up all kinds of new activates =)
 
Problem - Macro will cast on everything not just NPCs with Target.Type.Equal[NPC]

Users who are viewing this thread

Back
Top
Cart