Cleric AEHealv1.4 - Heal everyone in range who needs it.

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

Clueless_Coder
a hill giant
a hill giant
Posts: 192
Joined: Wed Aug 25, 2004 3:18 pm

Post by Clueless_Coder » Mon Sep 27, 2004 10:28 am

blueninja wrote:Comparison uses 2 = instead of one.. It should be /if (${Players}==0) {
Does that apply to > and < also? Or just = ?

User avatar
blueninja
a grimling bloodguard
a grimling bloodguard
Posts: 541
Joined: Thu Aug 28, 2003 7:03 am
Location: Göteborg, Sweden

Post by blueninja » Mon Sep 27, 2004 10:43 am

Clueless_Coder wrote:
blueninja wrote:Comparison uses 2 = instead of one.. It should be /if (${Players}==0) {
Does that apply to > and < also? Or just = ?
From TFM:
Logical Operators

==


Equal to

!=


Not equal to

>


Greater than

<


Less than

>=


Greater than or equal to

<=


Less than or equal to

&&


AND

| |


OR

!


NOT


Clueless_Coder
a hill giant
a hill giant
Posts: 192
Joined: Wed Aug 25, 2004 3:18 pm

Post by Clueless_Coder » Mon Sep 27, 2004 11:39 am

Sorry. I read all of that and it's still greek to me when trying to apply it to code I'm reading.

Where in the code posted would the comparision == be applied? I went over it line by line and didn't see any statements that used an
/if (${Players}==0) {
or similar statement.

Sorry if some of the questions come off n00bish. I'm still trying to make heads or tails of all of this.

Clueless_Coder
a hill giant
a hill giant
Posts: 192
Joined: Wed Aug 25, 2004 3:18 pm

Post by Clueless_Coder » Mon Sep 27, 2004 12:39 pm

#1 does your Sub HealcheckTank look like this?

Code:
Sub HealcheckTank

/if (${Target.PctHPs}<65)&&(${Target.Distance}<120) {
/call Cast "Supernal Light"
}

/return
My Sub HealcheckTank is as follows:

Code: Select all

Sub HealcheckTank

    /if (${Target.PctHPs}<65)&&(${Target.Distance}<120) {
    /call Cast "Holy Light"
    }

/return
Also have you made your spell_routines.inc?
Yes, I did. I created the file with the code posted in the Snippets forum and placed it in the Macros folder.

Continuing to test this and the results are not always the same.
Unloaded MQ2 and EQ. Reloaded MQ2 and restarted EQ.

Command typed in EQ:
/macro aeheal 10
Text returned:
[MQ2] AEHeal Macro Activated!
[MQ2] 10 will be targeted and healed. Every 10 players targeted per second will be calculated!
There are no spawns matching: (0-100) any xxxxxxx
There are no spawns matching: (0-100) pc Radius 240.00
[MQ2] Players per second 30.25
That loop was repeated non stop until a target came within radius. At which point I received the following:
Failed to parse /if command. Could not find command to execute.
aeheal.mac@76 (Healcheck Tank): /if (${Target PctHPs}<65)&&(${Target Distance}<120) {
aeheal.mac@62 (Class Check): /if (${TankListFind[|${Target Class}|]}) /call Healcheck Tank
aeheal.mac@48 (Main): /call Class Check
The current macro has ended

Usage: /if (<condition>) <command>
My AEHEal.mac code is as follows:

Code: Select all

| Version 1.1
| AE AutoHeal
| Usage /macro AEHeal <Number of players to check for>
| Example: /macro AEHeal 40
| Will check the closest 40 people to the cleric and heal them apropriately.
| Macro will automatically calculate and echo the number of players check per second, every cycle.
| Looking at the ground (Increasing frame rate) seems to increase number of targets per second drastically.
|
|Known Issues:
| Not healing Shadow Knights at this time.
|

#include spell_routines.inc

Sub Main

  /echo AEHeal Macro Activated!

   /declare PlayersTarg   int      outer
   /declare Targets       int      outer
   /declare Players       int      outer
   /declare CasterList    string   outer
   /declare TankList      string   outer

   /varset Targets 1
   /varset TankList |Warrior|Shadow Knight|Paladin|
   /varset CasterList |Necromancer|Wizard|Enchanter|Magician|Rogue|Druid|Cleric|Bard|Shaman|Beastlord|Berserker|Ranger|

 :verify
   /if (!${Defined[Param0]}) {
   /echo You must specify the number of players near you first!
   /end
  } else {
   /varset PlayersTarg ${Param0}
   /echo ${PlayersTarg} will be targeted and healed. Every ${PlayersTarg} players targeted per second will be calculated!

   :start
    /varset Players ${PlayersTarg}
    /target Xxxxx
    /call ClassCheck
|    /echo ${Targets}
     /if (${Macro.RunTime}>0) {
     /echo Players per second! ${Math.Calc[${Targets}/${Macro.RunTime}]}
     }
   :TargetCycle
    /varcalc Players ${Players}-1
    /target PC radius 240 Next
    /call ClassCheck
    /if (${Players}<1) {
       /varcalc Targets ${Targets}+${PlayersTarg}
       /goto :start
    } else {
       /goto :TargetCycle
    }

/return

Sub ClassCheck

    /if (${CasterList.Find[|${Target.Class}|]}) /call HealcheckCaster

    /if (${TankList.Find[|${Target.Class}|]}) /call HealcheckTank

/return

Sub HealcheckCaster

    /if (${Target.PctHPs}<79) {
    /call Cast "Supernal Remedy"
    }

/return

Sub HealcheckTank

    /if (${Target.PctHPs}<65)&&(${Target.Distance}<120) {
    /call Cast "Holy Light"
    }

/return
Last edited by Clueless_Coder on Mon Sep 27, 2004 2:25 pm, edited 2 times in total.

Neolesh
a hill giant
a hill giant
Posts: 231
Joined: Mon Aug 23, 2004 11:15 am

Post by Neolesh » Mon Sep 27, 2004 1:34 pm

Fook, what a newbie mistake. Try this

Code: Select all

| Version 1.2
| AE AutoHeal 
| Usage /macro AEHeal <Number of players to check for> 
| Example: /macro AEHeal 40 
| Will check the closest 40 people to the cleric and heal them apropriately. 
| Macro will automatically calculate and echo the number of players check per second, every cycle. 
| Looking at the ground (Increasing frame rate) seems to increase number of targets per second drastically. 
| 
|Known Issues: 
| Not healing Shadow Knights at this time. 
| 

#include spell_routines.inc 

Sub Main 

  /echo AEHeal Macro Activated! 

   /declare PlayersTarg   int      outer 
   /declare Targets       int      outer 
   /declare Players       int      outer 
   /declare CasterList    string   outer 
   /declare TankList      string   outer 

   /varset Targets 1 
   /varset TankList |Warrior|Shadow Knight|Paladin| 
   /varset CasterList |Necromancer|Wizard|Enchanter|Magician|Rogue|Druid|Cleric|Bard|Shaman|Beastlord|Berserker|Ranger| 

 :verify 
   /if (!${Defined[Param0]}) { 
   /echo You must specify the number of players near you first! 
   /end 
  } else { 
   /varset PlayersTarg ${Param0} 
   /echo ${PlayersTarg} will be targeted and healed. Every ${PlayersTarg} players targeted per second will be calculated! 

   :start 
    /varset Players ${PlayersTarg} 
    /target ${Me} 
    /call ClassCheck 
|    /echo ${Targets} 
     /if (${Macro.RunTime}>0) { 
     /echo Players per second! ${Math.Calc[${Targets}/${Macro.RunTime}]} 
     } 
   :TargetCycle 
    /varcalc Players ${Players}-1 
    /target PC radius 240 Next 
    /call ClassCheck 
    /if (${Players}<1) { 
       /varcalc Targets ${Targets}+${PlayersTarg} 
       /goto :start 
    } else { 
       /goto :TargetCycle 
    } 

/return 

Sub ClassCheck 

    /if (${CasterList.Find[|${Target.Class}|]}) /call HealcheckCaster 

    /if (${TankList.Find[|${Target.Class}|]}) /call HealcheckTank 

/return 

Sub HealcheckCaster 

    /if (${Target.PctHPs}<79) { 
    /call Cast "Supernal Remedy" 
    } 

/return 

Sub HealcheckTank 

    /if (${Target.PctHPs}<65)&&(${Target.Distance}<120) { 
    /call Cast "Holy Light" 
    } 

/return

Neolesh
a hill giant
a hill giant
Posts: 231
Joined: Mon Aug 23, 2004 11:15 am

Post by Neolesh » Mon Sep 27, 2004 1:47 pm

If this doesn't help try running the sub without the distance check. Like this.

Code: Select all

Sub HealcheckTank 

    /if (${Target.PctHPs}<65) { 
    /call Cast "Holy Light" 
    } 

/return 
I'm just not sure how it's getting, no command to execute error when there is a clear command between the { } and it's formated correctly.. hrmm

Neolesh
a hill giant
a hill giant
Posts: 231
Joined: Mon Aug 23, 2004 11:15 am

Post by Neolesh » Tue Sep 28, 2004 12:25 am

Ok, I figured out why the distance check wasn't working. Here's your new HealcheckTank Sub

Code: Select all

Sub HealcheckTank 

    /if (${Target.PctHPs}<65 && ${Target.Distance}<120) { 
    /call Cast "Holy Light" 
    } 

/return
The formating was bad. Let me know this works for you.

Clueless_Coder
a hill giant
a hill giant
Posts: 192
Joined: Wed Aug 25, 2004 3:18 pm

Post by Clueless_Coder » Tue Sep 28, 2004 7:57 am

Neolesh wrote:Ok, I figured out why the distance check wasn't working. Here's your new HealcheckTank Sub
...
The formating was bad. Let me know this works for you.
Ok.. I see what's happening now. The light bulb went on last night finally.

I updated the macro with the new code posted here and it ran fine I didnt actually heal anyone, but then there usually arent too many people in PoK in need of spot healing.

I typed /mac aeheal 50 and ran around PoK for a good 15 minutes with it scrolling targets smooth as silk.

Until it landed on a lvl 20 SK. At which point it crashed and returned the same error message as it had every other time. I tested it repeatedly with the same result. Ran fine as long as it didn't target an SK.

After about an hour of running all over PoP looking for targets to heal I finally found some and as soon as the macro targeted them it crashed. Lvl 65 barbarian warrior at 25%. 55 Dwarf warrior at 35%, and so on.

So, the issue now isn't one of it actually running at all (The new code fixed that it seems) It seems to run fine in that it targets players. But i can't seem to execute anything once it finds a player it needs to heal. Or when it finds an SK.

Neolesh
a hill giant
a hill giant
Posts: 231
Joined: Mon Aug 23, 2004 11:15 am

Post by Neolesh » Tue Sep 28, 2004 12:05 pm

Once again I am not sure what the problem is. It works really well for me. I used it while raiding last night for an extended period of time, healing everyone just fine.

A_Druid_00
Macro Maker Extraordinaire
Posts: 2378
Joined: Tue Jul 13, 2004 12:45 pm
Location: Rolling on the Lawn Farting

Post by A_Druid_00 » Mon Nov 01, 2004 10:40 pm

So like, I've stopped caring about being so cautious about macroing and gave this one a whirl. Rewrote it for my druid, with a lot of help from Cr4zyb4rd, and changed a few things you might like to add to the cleric version.

First off, did away with the Param0, and just had the macro calculate PCs in range with:

Code: Select all

	/declare PCsInRange	int	outer 
	/declare index		int	outer 
and then:

Code: Select all

	/varset PCsInRange ${SpawnCount[pc radius 200]}
	/for index ${PCsInRange} downto 0 
I did this because it was annoying seeing the "There are no spawns matching blah blah blah" spam if someone left the raid or went OOR of my heal radius.

I also did away with the separate subs for tanks vs. casters since I only have one main patch heal as a druid, making the need to differentiate between classes sort of pointless. I could have left it separate for the sake of setting a different heal % threshold, but 90% of the stuff I raid, it's a good idea to heal the tanks as early as the casters with as slow as my pad heal is. It might not be a bad idea to leave monks off the list by readding the declares, but in my guild our monks do their splitting well outside of my heal radius anyway.

Another thing I did was add a /delay 1 after the /target portion to allow HPs to update before moving on to the HP check, as it was checking the HPs before it recieved an update from the server as I'd expected. It still skips people occasionally with a delay of 1; but setting it to 2, while a lot more reliable, slowed it down too much for my liking. I now go through about 8-12 targets per second with a reasonable degree of accuracy, as opposed to going through 30-40 per second with a lot of missed/late heals when it would acquire an old HP update of <70 and almost instantly update and then cancel itself.

Lastly, added a mount check so that it wouldn't call interrupt if I was mounted.

Here's what the finished mac looks like on my druid, feel free to adapt it to your needs.

Code: Select all

#include Spell_Routines.inc
#include feedme.inc

#CHAT tell

Sub Main 

  /echo AEHeal Macro Activated! 

	/declare PCsInRange	int	outer 
	/declare index		int	outer 

:start 
	/target myself 
:HealCycle 
	/varset PCsInRange ${SpawnCount[pc radius 200]}
	/for index ${PCsInRange} downto 0 
	/target id ${NearestSpawn[${index}, pc radius 200].ID}
	/delay 1 
	/if (${Target.PctHPs}<70) /call Cast "Nature's Infusion" spell 2s CheckHP 
	/next index
	/call FeedMe
	/goto :HealCycle 
/return 

Sub CheckHP 
	/if ( ${Target.PctHPs}>=90 && !${Me.Mount.ID} ) /call Interrupt 
/return
The #CHAT portion is in there because I'm screwing around with adding replies to buff requests into my version too, so ignore that.

I could probably do away with the /target myself at the beginning and get rid of :HealCycle in this version, but this is as far as I got before we stopped raiding tonight.
[quote]<DigitalMocking> man, A_Druid_00 really does love those long ass if statements
<dont_know_at_all> i don't use his macro because i'm frightened of it[/quote]
[quote][12:45] <dont_know_at_all> never use a macro when you can really fuck up things with a plugin[/quote]

cjn
orc pawn
orc pawn
Posts: 19
Joined: Fri Aug 20, 2004 4:21 pm

Post by cjn » Tue Nov 02, 2004 1:10 am

I hate to see this. Not only this macro, I notice this in all healer macros. WHY THE FXXK YOU ALL EXCLUDE RANGER FROM TANK LIST???

LOL j/k

User avatar
Cr4zyb4rd
Plugins Czar
Posts: 1449
Joined: Tue Jul 20, 2004 11:46 am

Post by Cr4zyb4rd » Tue Nov 02, 2004 5:13 am

If it's breaking on Shadow Knight, chances are you need to put quotes around something.

User avatar
Cr4zyb4rd
Plugins Czar
Posts: 1449
Joined: Tue Jul 20, 2004 11:46 am

Post by Cr4zyb4rd » Tue Nov 02, 2004 5:19 am

It might not be a bad idea to leave monks off the list by readding the declares, but in my guild our monks do their splitting well outside of my heal radius anyway.
You should probably at least check if they've FDed in range of you and break off the heal. Maybe just add !${Target.Feigned} to the CheckHP sub? Then again, this might render you suddenly unable to heal anybody vs a mob with an FD attack.

A_Druid_00
Macro Maker Extraordinaire
Posts: 2378
Joined: Tue Jul 13, 2004 12:45 pm
Location: Rolling on the Lawn Farting

Post by A_Druid_00 » Tue Nov 02, 2004 7:45 am

I'll put the feign check into mine and see how it goes. Shouldn't have a huge impact on AE FD mobs unless they do it more often than every 5 seconds :D
[quote]<DigitalMocking> man, A_Druid_00 really does love those long ass if statements
<dont_know_at_all> i don't use his macro because i'm frightened of it[/quote]
[quote][12:45] <dont_know_at_all> never use a macro when you can really fuck up things with a plugin[/quote]

User avatar
Cr4zyb4rd
Plugins Czar
Posts: 1449
Joined: Tue Jul 20, 2004 11:46 am

Post by Cr4zyb4rd » Tue Nov 02, 2004 10:14 am

Well the problem is that if it's in the CheckHP sub, it's going to break off a heal...

Ubertank is at 17%, the heal's almost finished casting...almost...almost.. BAM..FDed. "Holy shit, I better break off my heal spell before it lands!"