Example: One-Key Heal V2
One-Key Heal V2
Use Heitu Super Macro to automatically scan the health deficits of raid or party members and intelligently select the appropriate rank of healing spells. No need to manually switch targets — press one button to heal.
Warning
Requires Heitu version >= 1.11.6. If your stable version is lower, enable Beta Channel in Heitu settings.
This is just an example. You can read the Heitu Super Macro documentation yourself (or give the URL to AI) and customize this function to your needs.
Use Cases
- Quick healing in raids
- Auto-heal party members during quests
- Emergency healing in PVP
How to Use
If the macro character limit is insufficient, place the function in Heitu's Super Macro Base Library:
- Open Heitu → Super Macro
- Paste the function code below into the editor
- In-game, call with
/s S HealRaid()
Or create a new in-game macro with:
/s S HealRaid()Then drag the macro to your action bar and assign a hotkey. Press once to automatically heal the raid member with the largest health deficit.
Full Code
Enter this in the Heitu Super Macro editor:
function HealRaid()
-- ============ Configuration (modify as needed) ============
-- Three healing tiers, ordered by priority (highest first)
-- minLost: minimum health deficit maxDist: max cast range (yards)
-- spellId: spell ID name: spell name (debug output only)
local LEVELS = {
{minLost = 5000, maxDist = 40, spellId = 48782, name = "Holy Light"},
{minLost = 2000, maxDist = 40, spellId = 48785, name = "Flash of Light"},
{minLost = 1, maxDist = 30, spellId = 48825, name = "Holy Shock"},
}
-- Note: for the same health deficit, earlier tiers take priority
-- ==============================================================
local members = TeamMembers()
-- Traverse each healing tier by priority
for _, lv in ipairs(LEVELS) do
local bestLost = 0
local bestInfo = nil
local bestGuid = ""
for i, m in ipairs(members) do
local info = GetUnitInfo(m.guid)
if info and info.health > 0 and info.maxHealth > 0 then
local lost = info.maxHealth - info.health
if lost >= lv.minLost then
local dist = Distance(m.guid)
if dist <= lv.maxDist and lost > bestLost then
bestLost = lost
bestInfo = info
bestGuid = m.guid
end
end
end
end
-- Current tier found a valid target, cast and exit
if bestInfo ~= nil then
print("Healing: " .. bestInfo.name .. "[" .. lv.name .. "] deficit:" .. bestLost .. " distance:" .. Distance(bestGuid))
Spell(lv.spellId, bestGuid)
return
end
end
-- No one needs healing
print("No healing needed")
endThen click the Save & Sync to Game button in the top-right corner.

How It Works
- Scans by priority of the three healing tiers
- Within each tier, finds the member with the largest health deficit within range
- Higher priority (urgent) tiers cast immediately once a target is found, skipping lower tiers
- Does nothing if no valid target is found across all three tiers
flowchart TD
A[Press Hotkey] --> B[Traverse tiers by priority]
B --> C{Current tier: scan party/raid}
C --> D[Skip dead/full HP members]
D --> E[Health deficit >= tier threshold?]
E -->|Yes| F{Distance <= tier max range?}
F -->|Yes| G[Record target with largest deficit]
F -->|No| D
G --> D
E -->|No| D
C --> H{Target found in this tier?}
H -->|Yes| I[Cast corresponding spell]
H -->|No| J{Lower tier available?}
J -->|Yes| C
J -->|No| K[No healing needed]API Reference
| Function | Description |
|---|---|
TeamMembers() | Returns a list of all raid/party members |
GetUnitInfo(guid) | Retrieves detailed member info via guid (HP, status, etc.) |
Distance(guid) | Returns distance to the specified member (yards) |
Spell(spellId, guid) | Casts a spell on the specified member |
Customization
All adjustable parameters are in the LEVELS config table at the top of the function. Only modify the config section:
Adjust Healing Tiers
local LEVELS = {
-- Adjust minLost (health threshold) and maxDist (cast range)
{minLost = 8000, maxDist = 40, spellId = BIG_HEAL_ID, name = "Big Heal"},
{minLost = 4000, maxDist = 35, spellId = MED_HEAL_ID, name = "Medium Heal"},
{minLost = 1, maxDist = 30, spellId = SMALL_HEAL_ID, name = "Small Heal"},
}Switch Spells
Replace spellId with your class's healing spell IDs:
-- Restoration Shaman
{minLost = 5000, maxDist = 40, spellId = HEALING_WAVE_ID, name = "Healing Wave"}
{minLost = 2000, maxDist = 40, spellId = LESSER_WAVE_ID, name = "Lesser Healing Wave"}
{minLost = 1, maxDist = 30, spellId = RIPTIDE_ID, name = "Riptide"}
-- Restoration Druid
{minLost = 5000, maxDist = 40, spellId = REGROWTH_ID, name = "Regrowth"}
{minLost = 2000, maxDist = 40, spellId = REJUVENATION_ID, name = "Rejuvenation"}
{minLost = 1, maxDist = 30, spellId = SWIFTMEND_ID, name = "Swiftmend"}Use Health Percentage Instead
If you prefer percentage-based checks:
-- Use pct in the condition
local pct = (info.health / info.maxHealth) * 100
if pct < 60 and dist <= lv.maxDist then
-- Heal if HP below 60%
endHeal a Specific Party Only
for i, m in ipairs(members) do
-- Only heal subgroup 1 members (subgroup is 0-indexed)
if m.subgroup == 0 then
-- ... rest of logic
end
endAdd More Tiers
The config table supports any number of tiers — just add new rows:
local LEVELS = {
{minLost = 8000, maxDist = 40, spellId = 48782, name = "Holy Light"},
{minLost = 5000, maxDist = 40, spellId = 48785, name = "Flash of Light"},
{minLost = 2000, maxDist = 35, spellId = 48825, name = "Holy Shock"},
{minLost = 1, maxDist = 30, spellId = 25235, name = "Renew"}, -- New 4th tier
}Notes
- Enable Model Editing in Heitu first — Super Macro takes effect automatically
- Disable antivirus or add Heitu directory to whitelist
- Look up spell IDs on database sites like db.heitu.org
- Supports all 60/70/80 client versions (112/114/243/253/343)