• 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

Target and attack. Question on code

letmein

New member
Hey guys, can someone alittle more experienced with the coding take a look at this event?

I want to put a necro in the DZ with my bard.
Necro will run lootwhore, and I want to add this to my current lootwhore macro.

Essentially, what I want it to do is assist the bard, check to see if the mob's hitpoints are below 80% (so pet doesn't steal aggro from bard) then send in pet if below 80%

Next, I want to cast a DoT ONCE only on the mob when he hits 50% life.

I already know the check will keep casting the dot everytime it checks and the mob is below 50%. I don't know the code to say, only cast it once.

Thanks for the help guys.

Sub TargetAtk
/assist TOONNAME
/if (${Target.PctHPs}<80
/pet attack
/if (${Target.PctHPs}<60
| DOT Mob
/cast 1

/return
 
Set a bool flag to true when you cast the dot. Just make sure to reset it to false every time you acquire a new target.

Rich (BB code):
/if ((${Target.PctHPs}<60)&&!${Dotted}) {
   /cast DOT
   /varset Dotted TRUE
}

-CodeCaster
 
Codecaster,

Thanks for the help. So the following:

Rich (BB code):
 Sub TargetAtk
 /assist TOONNAME
 /if ((${Target.PctHPs}<80)&&!${PetAttacking}) {
   /pet attack
   /varset PetAttacking TRUE
}
 /if ((${Target.PctHPs}<60)&&!${Dotted}) {
   /cast 1
   /varset Dotted TRUE
}
 /return

Should assist bard, check to see if bards target is below 80%
If below 80%, send pet to attack. But only once. Meaning, the next check it won't /pet attack again correct? And the same thing with the dot portion?
Will check to see if the mob is below 60%, if it is cast a dot. But only once?

Thanks again.
 
Rich (BB code):
  Sub TargetAtk
 /assist TOONNAME
 /if (${Target.PctHPs}<80 && !${PetAttacking}) {
   /pet attack
   /varset PetAttacking TRUE
 } else {
 /if (${turnedon} && ${Target.PctHPs}>80) {
   /varset PetAttacking FALSE
   }
 }
 /if (${Target.PctHPs}<60 && !${Dotted}) {
   /cast 1
   /varset Dotted TRUE
 } else {
 /if (${turnedon} && ${Target.PctHPs}>60) {
   /varset Dotted FALSE
   }
}
 /return

How's this look guys? Also, How do I only get the DOT event to occur once? Seems to me even with this, the next check and he will cast again because of the first if statement. Is there a "run once" type of command?

Thanks again for all your help.
 
Target and attack. Question on code

Users who are viewing this thread

Back
Top
Cart