• 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

HP Watcher Macro Help

Moonspell

Member
Hello, I thought of a macro/plugin I would like to have to help me on raids. What the script does is keep track of specified players HP and gives me a warning if their health drops too low. The macro itself is really simple:

Rich (BB code):
#turbo

Sub Main
:loopy
/if (${NearestSpawn[TOONSNAME].PctHPs}<70) {
	/popup HEAL TOONSNAME
	/delay 4s
}
/goto :loopy

The problem with this is that if I want to add more people to keep an eye on, I have to manually open up the macro and edit it. I'd like to find out a way that I could avoid doing this. I thought I could try and use an INI file, but the MQ2 Wiki isn't quite clear on how I could add/call on the fly.

I think this would work better as a plugin, since you could make a new command that would let you add/remove players to watch on the fly, instead of having to try and make an event for it. Does anyone have any hints/tips on what I could do? Sadly, I don't know C++, else I'd do it on my own.

Thanks
 
Might want to make it so the macro uses arguments based off what you type. For example...

/macro Lazyraidhealer Player1 Player2 Player3 Player4

And then include those variables in to your heal code.
 
That's a good idea, Mochila. Quite frequently I'll have to be a healer for more than one group, and something like this helps me keep track of their health without having to click their names in the raid tool.
 
Here ya go Moonspell. You can add people to monitor by typing /add. It will add them in 3 different methods...

/add <Name> - Adds one person.
/add <Name1> <Name2> ..... - Adds all people in the given list. Dont go too crazy here just add a few at a time.
/add - Adds your current Target.

Note:
This macro will target each person in your list to be watched.... This is done because unless a spawn is in your group, is the Target of your Target, or is your Target its health will not be updated. This forces an update. It should do this targeting VERY fast so be careful if you think someone might watch your actions for MQ2 usage.

Rich (BB code):
#Event AddMonitor "[MQ2] Add Monitor#*#"
#turbo

Sub Main
/squelch /alias /add /echo Add Monitor

|======================================|
|Alerts if health is below this amount.|
|======================================|
/declare alerthealth int outer 99

|===============================|
|Checks health in this interval.|
|===============================|
/declare delay timer outer 5s

|====================================================================|
|Checks INI file for new additions via editing the ini file directly.|
|====================================================================|
/declare update timer outer 30s

|==============================|
|System Variables - Do Not Edit|
|==============================|
/declare TotalTargets int outer 0
/declare temploop1 int outer
/declare temploop2 int outer
/declare updateloop int outer
/declare temptarget int outer

:loopy
/doevents
/delay 1
/if (${delay}) /goto :loopy
/varset delay ${delay.OriginalValue}
/if (!${update}) {
	/varset update ${update.OriginalValue}
	/if (${TotalTargets}!=${Ini["LazyRaidHealer.ini","HealList","Targets"]}) {
		/varset TotalTargets ${Ini["LazyRaidHealer.ini","HealList","Targets"]}
		/for updateloop 1 to ${TotalTargets}
			/if (!${Defined[Targets${updateloop}]}) /declare Targets${updateloop} string outer
			/varset Targets${updateloop} ${Ini["LazyRaidHealer.ini","HealList","Targets${updateloop}"]}
		/next updateloop
		}
	}
/if (${TotalTargets}) {
	/if (${Target.ID}) {
		/varset temptarget ${Target.ID}
		} else {
		/varset temptarget 0
		}

	/for temploop1 1 to ${TotalTargets}
		/if (${Spawn[pc ${Targets${temploop1}}].ID}) {
			/target ID ${Spawn[pc ${Targets${temploop1}}].ID}
			/delay 1
			}
	/next temploop1

	/squelch /target clear
	/if (${temptarget}) /target ID ${temptarget}

	/for temploop2 1 to ${TotalTargets}
		/if (${Spawn[pc ${Targets${temploop2}}].ID}) {
			/if (${Spawn[pc ${Targets${temploop2}}].PctHPs}<${alerthealth}) {
				/popup HEAL ${Targets${temploop2}.Upper}
				/goto :loopy
				}
			}
	/next temploop2
	}
/goto :loopy
/end

|=========================|
|123456789012345678       |
|[MQ2] Add Monitor <Names>|
|=========================|
Sub Event_AddMonitor(string name)
/if (${name.Length}==17) {
	/if (!${Target.ID}) {
		/echo No Target or Name Supplied. Aboring Add.
		/return
		}
	/echo Adding via Target: (${Target.CleanName}).
	/call AddToIni LazyRaidHealer.ini HealList Targets ${Target.CleanName}
	/return
	}
/varset name ${name.Right[-18]}
/echo ${name}
/if (${name.Find[" "]}) {
	/echo Adding the following names:
	/declare addlooper int local
	/for addlooper 1 to 20
		/if (!${name.Arg[${addlooper}].Length}) {
			/echo Added ${Int[${Math.Calc[${addlooper}-1]}]} Names.
			/return
			}
		/echo ${name.Arg[${addlooper}]}
		/call AddToIni LazyRaidHealer.ini HealList Targets ${name.Arg[${addlooper}]}
	/next addlooper
	}
/echo Adding Single: ${name}.
/call AddToIni LazyRaidHealer.ini HealList Targets ${name}
/return

|================|
|Filename.ini    |
|                |
|[Section]       |
|Variable=1      |
|Variable1=Blah  |
|================|
Sub AddToIni(string FileName, Section, Variable, Value)
	/declare temp int local ${Ini[${FileName},${Section},${Variable}]}
	/varcalc temp ${temp}+1
	/ini "${FileName}" "${Section}" "${Variable}" "${temp}"
	/varset Variable ${Variable}${temp}
	/ini "${FileName}" "${Section}" "${Variable}" "${Value}"
	/if (!${Defined[Targets${temp}]}) /declare Targets${temp} string outer
	/varset Targets${temp} ${Value}
	/varset TotalTargets ${temp}
/return
 
Thank you for the help, Z166!

I'm going to tinker around with the code to see if I can't get it to monitor everyone's HP without having to get them on target. I think using NearestSpawn may be the right answer.


Thanks again!
 
Moonspell said:
Thank you for the help, Z166!

I'm going to tinker around with the code to see if I can't get it to monitor everyone's HP without having to get them on target. I think using NearestSpawn may be the right answer.


Thanks again!
HP information is only available in the 3 ways z166204 described.
-Targeting
-HoTT
-In Group
 
I use something like this when im grouped. Im a bsty so when the cleric gets a hit i see it and heal him/her so he/she can concentrate on the MT. Z166 i might have to use yours so i dont have to change the name evertime.
 
HardOne said:
HP information is only available in the 3 ways z166204 described.
-Targeting
-HoTT
-In Group

I've been using the code I posted a few days ago all this week testing it (with other goodies I've added in) and it works fine. Whenever someone on my watch list goes below the percent HP I define, I get a warning on my screen.
 
HP Watcher Macro Help

Users who are viewing this thread

Back
Top
Cart