Example: One-Key Heal V5
Video Tutorial
One-Key Heal Version 5
Leverage Heitu Super Macro to automatically scan the health deficits of raid or party members and intelligently select healing spells of the appropriate rank. No need to manually switch targets — one press completes the healing.
Warning
Requires Heitu version >= 1.11.11. If the stable version is lower than this, please enable Beta Updates in Heitu settings.
This is just an example. You can read the Heitu Super Macro documentation yourself or have an AI read it (provide the URL to the AI), and then refine this function according to your needs.
What's New in V5 Compared to V4
| Upgrade | V4 | V5 |
|---|---|---|
| Solo Mode | ❌ Cannot use when not in a group | ✅ Automatically adds yourself to the scan list when not in a group, usable solo |
| Skip Existing HOT | ❌ Not supported | ✅ Configure the noAura field to skip targets that already have the aura, avoiding overwrites |
| Smart Cast Cancellation | ✅ | ✅ |
| Auto Class Detection | ✅ | ✅ |
Detailed Explanation
1. Solo Mode (Biggest Highlight)
V4 relies on TeamMembers() to get the group member list. If you are not in any group, the list is empty and the macro cannot work.
V5 detects when you are not in a group and automatically adds yourself to the scan list, so it works even when solo questing in the open world. If pet healing is enabled, it will also automatically heal your pet.
2. Skip Existing HOT (Avoid Overwriting)
V5 introduces the noAura field. When set to a spell ID, the scan will skip targets that already have that aura.
Typical scenarios:
- Priest refreshing 恢复: set
noAura = 25315(恢复 aura ID), won't reapply 恢复 to targets that already have it - Druid refreshing 回春: set
noAura = 25299(回春术 aura ID), only applies 回春 to targets without it - Prevents overwriting others' HOTs, saving mana and increasing efficiency
noAura = 0 (default) means no check, behavior identical to V4.
Use Cases
- Quick healing in raids
- Auto-healing party members during group quests
- Emergency healing in PvP
- Self-healing while solo leveling / open-world farming
- Avoid overwriting existing buffs when applying HOTs / 恢复
How to Use
- Open Heitu → Super Macro
- Paste the [complete code] function into the editor area
- In-game, use
/s S HealRaid()to call it
Or create a new macro in-game and enter the following:
/s S HealRaid()Then drag the macro to your action bar and set a keybind. One press will automatically heal the group member with the largest health deficit.
Complete Code
Enter the following in the Heitu Super Macro editor:
-- 记录上次治疗的目标,用于再次按键时判断是否需要取消施法
-- 复制到黑兔编辑器的时候,这个也要复制
local lastHealTarget = nil
function HealRaid()
-- ============ 智能取消:如果上次治疗的目标已满血,取消当前施法 ============
if lastHealTarget then
local lastInfo = GetUnitInfo(lastHealTarget)
if lastInfo and lastInfo.health > 0 and lastInfo.health >= lastInfo.maxHealth then
StopCasting()
if DEBUG_HEAL then print("取消施法:" .. lastInfo.name .. " 已满血") end
lastHealTarget = nil
-- 继续往下扫描,寻找下一个需要治疗的队友
end
end
-- ============ 配置区(按需修改)============
-- 是否同时治疗宠物(true=开启,false=关闭)
local INCLUDE_PETS = true
-- 是否输出治疗调试信息(true=打印,false=静默)
local DEBUG_HEAL = true
-- 根据自身职业自动选择技能配置
local me = GetMeInfo()
local classId = me and me.classId or 0
if classId == 0 then
print("一键奶:获取自身职业失败,classId=0,请确认黑兔已连接游戏")
return
end
-- 治疗等级配置,按优先级从高到低排列
-- minLost: 最低血量缺口 maxDist: 最大施法距离(码)
-- spellId: 技能ID name: 技能名称(仅用于调试输出)
-- noAura: 跳过已持有该光环的目标(如恢复/回春),0=不判断
local LEVELS = {}
if classId == 2 then -- 圣骑士
-- 60级策略:圣光闪现R1最省蓝,圣光术R4是常见下级治疗,R8满级救命
LEVELS = {
{ minLost = 5000, maxDist = 40, spellId = 10329, name = "圣光术(满级)", noAura = 0 },
{ minLost = 1500, maxDist = 40, spellId = 19943, name = "圣光闪现(满级)", noAura = 0 },
{ minLost = 1000, maxDist = 40, spellId = 1026, name = "圣光术(等级4)", noAura = 0 },
{ minLost = 1, maxDist = 40, spellId = 19750, name = "圣光闪现(等级1)", noAura = 0 },
}
elseif classId == 5 then -- 牧师
-- 60级策略:治疗术R2是牧师最知名下级治疗,强效治疗术给坦克,快速治疗应急
LEVELS = {
{ minLost = 5000, maxDist = 40, spellId = 25315, name = "恢复(满级)", noAura = 25315 }, -- 目标没有恢复,就先上恢复
{ minLost = 5000, maxDist = 40, spellId = 25314, name = "强效治疗术(满级)", noAura = 0 },
{ minLost = 1500, maxDist = 40, spellId = 6064, name = "治疗术(等级4)", noAura = 0 },
{ minLost = 1000, maxDist = 40, spellId = 9474, name = "快速治疗(4级)", noAura = 0 },
{ minLost = 500, maxDist = 40, spellId = 2055, name = "治疗术(等级2)", noAura = 0 },
{ minLost = 1, maxDist = 40, spellId = 2054, name = "治疗术(等级1)", noAura = 0 },
}
elseif classId == 7 then -- 萨满
-- 60级策略:治疗链自动跳转智能团刷,治疗波给坦克,次级治疗波快速抬血
LEVELS = {
{ minLost = 5000, maxDist = 40, spellId = 25357, name = "治疗波(满级)", noAura = 0 },
{ minLost = 1000, maxDist = 40, spellId = 10622, name = "治疗链(等级2)", noAura = 0 },
{ minLost = 1, maxDist = 40, spellId = 1064, name = "治疗链(等级1)", noAura = 0 },
}
elseif classId == 11 then -- 德鲁伊
-- 60级策略:治疗之触R4是德鲁伊最省蓝下级治疗,R11满级给坦克,愈合应急+HOT
LEVELS = {
{ minLost = 5000, maxDist = 40, spellId = 25299, name = "回春(满级)", noAura = 25299 }, -- 如果没有回春,就先套回春
{ minLost = 5000, maxDist = 40, spellId = 25297, name = "治疗之触(满级)", noAura = 0 },
{ minLost = 1500, maxDist = 40, spellId = 5188, name = "治疗之触(等级4)", noAura = 0 },
{ minLost = 1000, maxDist = 40, spellId = 8941, name = "愈合(等级5)", noAura = 0 },
{ minLost = 500, maxDist = 40, spellId = 8938, name = "愈合(等级2)", noAura = 0 },
{ minLost = 1, maxDist = 40, spellId = 8936, name = "愈合(等级1)", noAura = 0 },
}
else
print("当前职业无内置治疗配置,classId=" .. classId .. ",请手动添加LEVELS")
return
end
-- 注意:血量缺口相同的等级,靠前的优先级更高
-- ==========================================
local members = TeamMembers()
-- ============ V5新增:不在团队时,把自己加入扫描列表 ============
local scanList = {}
if members and #members > 0 then
-- 在团队中,正常添加所有成员
for i, m in ipairs(members) do
scanList[#scanList + 1] = m
end
else
-- 不在团队,把自己加进去
if me and me.guid then
scanList[#scanList + 1] = { guid = me.guid, name = "(自己)" }
if DEBUG_HEAL then print("一键奶:不在团队中,仅治疗自己") end
end
end
-- 构建宠物扫描列表
if INCLUDE_PETS then
for i, m in ipairs(scanList) do
local info = GetUnitInfo(m.guid)
if info and info.petGuid and info.petGuid ~= "" and info.petGuid ~= "0" then
scanList[#scanList + 1] = { guid = info.petGuid }
end
end
end
-- 按优先级遍历每个治疗等级
for _, lv in ipairs(LEVELS) do
local bestLost = 0
local bestInfo = nil
local bestGuid = ""
for _, m in ipairs(scanList) 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
-- ============ V5新增:noAura 判断(跳过已有该光环的目标)============
local noAuraOk = true
if lv.noAura and lv.noAura ~= 0 then
if info.auras then
for _, aura in ipairs(info.auras) do
if aura.spellId == lv.noAura then
noAuraOk = false -- 目标已有该光环,跳过
break
end
end
end
end
-- =============================================================
if noAuraOk then
bestLost = lost
bestInfo = info
bestGuid = m.guid
end
end
end
end
end
-- 当前等级有符合条件的目标,直接施放并结束
if bestInfo ~= nil then
if DEBUG_HEAL then
print("治疗: " ..
bestInfo.name .. "[" .. lv.name .. "] 缺口:" .. bestLost .. " 距离:" .. math.floor(Distance(bestGuid)))
end
Spell(lv.spellId, bestGuid)
lastHealTarget = bestGuid -- 记录本次目标,供下次取消判断
return
end
end
-- 没有需要治疗的队友
if DEBUG_HEAL then print("无需治疗") end
endThen click the [Save and Sync to Game] button in the top-right corner of the interface.

How It Works
- On pressing the macro again, first check whether the last healed target is at full health; if so, cancel the current cast (to avoid wasting mana) and continue scanning for a new target
- Use
GetMeInfo()to automatically detect your class and select the corresponding healing spell configuration - New in V5: Check whether
TeamMembers()is empty; if not in a group, add yourself to the scan list - Scan by healing rank priority in descending order
- Within each rank, find the group member with the largest health deficit within range
- New in V5: When scanning, check the
noAuracondition (if configured) and skip targets that already have that aura - If a high-priority (urgent) target is found, cast immediately and skip lower-priority checks
- After casting, record the target for the next cancellation check
- If no suitable target is found at any rank, do nothing
flowchart TD
A[Press Keybind] --> A1{Is the last healed target at full health?}
A1 -->|Yes| A2[Cancel current cast]
A2 --> A3[GetMeInfo: get own class]
A1 -->|No| A3
A3 --> A4[Select spell table based on class]
A4 --> A5{Is TeamMembers empty?}
A5 -->|Yes| A6[Add self to scan list]
A5 -->|No| A7[Use group member list]
A6 --> A8[Optional: add pets]
A7 --> A8
A8 --> B[Iterate healing ranks by priority]
B --> C{Current rank: scan members}
C --> D[Skip dead / full-health members]
D --> E{Health deficit >= rank threshold?}
E -->|Yes| F{Distance <= rank max distance?}
F -->|Yes| F2{noAura == 0?}
F2 -->|No| F3{Target already has noAura aura?}
F3 -->|Yes| D
F3 -->|No| G
F2 -->|Yes| G[Record target with largest health deficit]
F -->|No| D
E -->|No| D
C --> H{Target found at current rank?}
H -->|Yes| I[Cast spell and record target]
H -->|No| J{Any lower ranks remaining?}
J -->|Yes| C
J -->|No| K[No healing needed]Function Reference
| Function | Description |
|---|---|
GetMeInfo() | Get your own info (class classId, health, guid, aura list, etc.) |
TeamMembers() | Get the list of all raid/party members (returns empty when not in a group) |
GetUnitInfo(guid) | Get detailed info about a member by guid (health, status, aura list, etc.) |
Distance(guid) | Get the distance to a specified member (in yards) |
Spell(spellId, guid) | Cast a spell on a specified member |
StopCasting() | Cancel the currently casting spell |
Aura Data Structure Returned by GetUnitInfo
info.auras = {
{
spellId = 774, -- 光环的法术ID
endTime = 1712345678, -- 光环到期时间戳(毫秒),0=长期有效
applications = 1, -- 光环层数
castUnitGuid = 12345, -- 施法者的GUID
},
-- ... 更多光环
}Customization
LEVELS Field Reference
Each entry in the V5 LEVELS configuration table has an additional optional field:
| Field | Type | Default | Description |
|---|---|---|---|
minLost | number | Required | Minimum health deficit |
maxDist | number | Required | Maximum cast distance (yards) |
spellId | number | Required | Spell ID to cast |
name | string | Required | Spell name (for debugging) |
noAura | number | 0 | Aura spell ID the target must NOT have; 0 = no check |
Example: Priest Refreshing 恢复 (Without Overwriting)
To avoid reapplying 恢复 to targets that already have it, set noAura on the lowest-priority 恢复 spell:
elseif classId == 5 then -- 牧师
LEVELS = {
-- 最高优先级:补恢复,但只给没有恢复的目标(恢复光环ID=25315)
{minLost = 5000, maxDist = 40, spellId = 25315, name = "恢复(满级)", noAura = 25315 },
{minLost = 5000, maxDist = 40, spellId = 25314, name = "强效治疗术(满级)", noAura = 0},
{minLost = 1500, maxDist = 40, spellId = 6064, name = "治疗术(等级4)", noAura = 0},
{minLost = 1000, maxDist = 40, spellId = 9474, name = "快速治疗(4级)", noAura = 0},
{minLost = 500, maxDist = 40, spellId = 2055, name = "治疗术(等级2)", noAura = 0},
{minLost = 1, maxDist = 40, spellId = 2054, name = "治疗术(等级1)", noAura = 0},
}Example: Druid Refreshing 回春 (Without Overwriting)
elseif classId == 11 then -- 德鲁伊
LEVELS = {
{minLost = 5000, maxDist = 40, spellId = 25297, name = "治疗之触(满级)", noAura = 0},
{minLost = 1500, maxDist = 40, spellId = 5188, name = "治疗之触(等级4)", noAura = 0},
-- 愈合:只给没有愈合HOT的目标(愈合光环ID=8936)
{minLost = 1000, maxDist = 40, spellId = 8941, name = "愈合(等级5)", noAura = 8936},
-- 回春:只给没有回春的目标(回春光环ID=774)
{minLost = 500, maxDist = 40, spellId = 8938, name = "回春(等级2)", noAura = 25299},
{minLost = 1, maxDist = 40, spellId = 8936, name = "愈合(等级1)", noAura = 0},
}Disabling Solo Mode
If you do not want the macro to heal yourself when solo, you can comment out the relevant code section, or always keep the if #members > 0 check and add a return to exit early.
Notes
- You need to enable the Model Edit feature in Heitu first; Super Macro will then take effect automatically
- It is recommended to disable your antivirus or whitelist the Heitu directory
- Spell IDs can be looked up via database websites (e.g. db.heitu.org)
- Supports all level 60/70/80 version clients (112/114/243/253/343)
- When
noAurais0, aura checking is completely skipped with no impact on macro efficiency - Aura checking is based on client cache data; ensure the target is within visible range
- In solo mode, if
INCLUDE_PETSis enabled, your own pet will also be scanned automatically
FAQ
Q1: It doesn't work after following the tutorial
First, upgrade Heitu to the latest version. Then check whether the spell IDs in the macro are correct — do not just copy and paste blindly. The spell IDs in the example are for a level 80 Paladin.
Q2: What if I want to use One-Key Heal on multiple classes?
No action needed! The macro has built-in auto class detection and will automatically switch to the corresponding class's spell configuration based on GetMeInfo().classId.
Q3: How do I cancel a healing cast that's in progress?
When the target is already at full health (e.g. healed by another healer), press the macro again to automatically cancel the current cast.
Q4: The macro doesn't work when solo
V5 has resolved this issue. When not in a group, it automatically adds yourself to the scan list, so it works normally even when solo leveling.
Q5: How do I look up an aura's spell ID?
You can look it up via database websites (e.g. db.heitu.org). You can also use the spell on a target in-game and then use Heitu's debugging features to view the current target's aura list. Alternatively, use a simple Lua script to iterate and print:
local info = GetUnitInfo("target")
if info and info.auras then
for _, aura in ipairs(info.auras) do
print("光环ID: " .. aura.spellId .. " 剩余: " .. aura.endTime .. " 层数: " .. aura.applications .. " 施法者: " .. aura.castUnitGuid)
end
endQ6: The macro stops working after setting noAura to a non-zero value
Make sure you entered the aura's spell ID (i.e. the spellId of the buff displayed on the target), not the spell ID used to cast it. For example, the 恢复 spell ID is 25315, but the 恢复 aura ID on the target is 139. You can use the script from Q5 above to confirm.