Example: One-Key Heal V6
Video Tutorial
One-Key Heal V6
Using the Heitu Super Macro, you can 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—just press a button to heal.
Warning
Requires Heitu version >= 1.11.15. If your release version is below this, please enable Beta Push in the Heitu settings.
This is just an example. You are fully encouraged to read the Heitu Super Macro documentation yourself (or give the URL to an AI) and enhance this function according to your needs.
What's New in V6 Compared to V5
| Improvement | V5 | V6 |
|---|---|---|
| Priority Target | ❌ Not supported, only full-raid scan by health deficit | ✅ Set priority healing targets; only heals when deficit ≥ threshold |
| Skip Existing HOT | ✅ | ✅ |
| Smart Cancel Cast | ✅ | ✅ |
| Auto Class Detection | ✅ | ✅ |
| Solo Mode | ✅ | ✅ |
Detailed Explanation
1. Priority Target (Biggest Highlight)
V6 introduces a priority target mechanism. You can use HealRaid_AddTarget() to add your currently selected target to the priority array. During healing, the macro scans this priority array first and only heals if the priority target's health deficit reaches CFG_PRIORITY_MIN_LOST (default 200). If the conditions are not met, it falls back to the normal raid scan.
Typical scenarios:
- Assign the MT/tank as a priority target to ensure their health stays stable
- After defeating a boss, clear priority targets to resume normal raid healing
2. Clear Priority Targets
Added HealRaid_ClearTargets(). Calling it clears all priority targets and resumes normal full-raid scanning.
V6 Full Feature List
If this is your first time using One-Key Heal, here are all the features supported by V6:
| Feature | Description |
|---|---|
| Auto Class Detection | Automatically detects Paladin/Priest/Shaman/Druid and switches to the corresponding spell table |
| Multi-Rank Smart Healing | Matches spell ranks by health deficit from largest to smallest, mana-efficient |
| Smart Cancel Cast | Press the macro again after the target is topped off to cancel casting and save mana |
| Solo Mode | Automatically heals yourself when not in a raid—usable even while leveling in the wild |
| Pet Healing | When enabled, scans both raid members and their pets simultaneously |
| Skip Existing HOT | The noAura field prevents overwriting existing HOTs such as 恢复/回春 |
| Priority Target | Set key protection targets; heals them first when deficit ≥ threshold |
| Clear Priority | One-key clear all priority targets, resuming full-raid scanning |
Applicable Scenarios
- Quick healing in raid instances
- Auto-healing party members during questing
- Emergency healing in PVP
- Auto self-healing while solo leveling or grinding in the wild
- Avoid overwriting existing buffs when applying HOTs/恢复
Usage
- Open Heitu → Super Macro
- Paste the [Complete Code] function code into the editor
- Use the following commands in-game:
Healing Loop:
/s S HealRaid()Bind it to a hotkey; press once to auto-heal.
Add Priority Target: Select a teammate → execute /s S HealRaid_AddTarget()
Clear Priority Targets: /s S HealRaid_ClearTargets()
Complete Code
Enter in the Heitu Super Macro editor:
-- ============================================================
-- 配 置 区(按需修改)
-- ============================================================
-- 是否输出治疗调试信息(true=打印,false=静默)
local CFG_DEBUG_HEAL = true
-- 是否同时治疗宠物(true=开启,false=关闭)
local CFG_INCLUDE_PETS = true
-- 优先目标最低血量缺口,低于此值不奶
local CFG_PRIORITY_MIN_LOST = 200
-- 优先目标数组(通过 HealRaid_AddTarget() 添加)
local CFG_priorityTargets = {}
-- 治疗等级配置,按优先级从高到低排列
-- minLost: 最低血量缺口 maxDist: 最大施法距离(码)
-- spellId: 技能ID name: 技能名称(仅用于调试输出)
-- noAura: 跳过已持有该光环的目标(如恢复/回春),0=不判断
-- 注意:血量缺口相同的等级,靠前的优先级更高
-- 每次调用根据当前职业重新获取治疗等级配置
function GetCfgLevels()
local me = GetMeInfo()
local classId = me and me.classId or 0
if classId == 2 then -- 圣骑士
-- 60级策略:圣光闪现R1最省蓝,圣光术R4是常见下级治疗,R8满级救命
return {
{ 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是牧师最知名下级治疗,强效治疗术给坦克,快速治疗应急
return {
{ 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级策略:治疗链自动跳转智能团刷,治疗波给坦克,次级治疗波快速抬血
return {
{ 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
return {
{ 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 },
}
end
return {}
end
-- ============================================================
-- 将当前目标加入优先列表
-- 使用方式:选中一个队友,然后 /s S HealRaid_AddTarget()
function HealRaid_AddTarget()
local info = GetMeInfo()
if not info or not info.targetGuid or info.targetGuid == "0" then
print("请先选中一个目标")
return
end
local tInfo = GetUnitInfo(info.targetGuid)
if not tInfo then
print("无法获取目标信息")
return
end
-- 去重检查:目标已在列表中则提示并返回当前数量
for _, guid in ipairs(CFG_priorityTargets) do
if guid == info.targetGuid then
print("目标已在优先列表中: " .. tInfo.name .. ",当前共 " .. #CFG_priorityTargets .. " 个优先目标")
return
end
end
table.insert(CFG_priorityTargets, info.targetGuid)
print("已添加优先目标: " .. tInfo.name .. " (guid=" .. info.targetGuid .. "),当前共 " .. #CFG_priorityTargets .. " 个优先目标")
end
-- 清空所有优先目标
-- 使用方式:/s S HealRaid_ClearTargets()
function HealRaid_ClearTargets()
local count = #CFG_priorityTargets
CFG_priorityTargets = {}
print("已清空" .. count .. "个优先目标")
end
-- 记录上次治疗的目标,用于再次按键时判断是否需要取消施法
local CFG_lastHealTarget = nil
-- ============================================================
-- 通用扫描治疗函数:按 LEVELS 优先级遍历 scanList,对符合条件的目标施法
-- scanList: 形如 { { guid="xxx" }, ... } 的数组
-- minLostThreshold: 额外的最低血量缺口阈值,0=不限制
-- logPrefix: 调试输出的前缀(如 "优先治疗" / "治疗")
-- 返回 true 表示已施法,false 表示无合适目标
-- ============================================================
function TryHealScan(scanList, minLostThreshold, logPrefix)
minLostThreshold = minLostThreshold or 0
for _, lv in ipairs(GetCfgLevels()) do
local bestLost = 0
local bestInfo = nil
local bestGuid = ""
for _, m in ipairs(scanList) do
local guid = type(m) == "table" and m.guid or m
local info = GetUnitInfo(guid)
if info and info.health > 0 and info.maxHealth > 0 then
local lost = info.maxHealth - info.health
if lost >= lv.minLost and lost >= minLostThreshold then
local dist = Distance(guid)
if dist <= lv.maxDist and lost > bestLost then
-- 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 = guid
end
end
end
end
end
if bestInfo ~= nil then
if CFG_DEBUG_HEAL then
print(logPrefix .. ": " .. bestInfo.name .. "[" .. lv.name .. "] 缺口:" .. bestLost .. " 距离:" .. math.floor(Distance(bestGuid)))
end
Spell(lv.spellId, bestGuid)
CFG_lastHealTarget = bestGuid
return true
end
end
return false
end
-- ============================================================
function HealRaid()
-- ============ 智能取消:如果上次治疗的目标已满血,取消当前施法 ============
if CFG_lastHealTarget then
local lastInfo = GetUnitInfo(CFG_lastHealTarget)
if lastInfo and lastInfo.health > 0 and lastInfo.health >= lastInfo.maxHealth then
StopCasting()
if CFG_DEBUG_HEAL then print("取消施法:" .. lastInfo.name .. " 已满血") end
CFG_lastHealTarget = nil
-- 继续往下扫描,寻找下一个需要治疗的队友
end
end
-- 每次根据当前职业重新获取治疗等级配置
local cfgLevels = GetCfgLevels()
if not cfgLevels or #cfgLevels == 0 then
if CFG_DEBUG_HEAL then print("一键奶:职业配置为空,请检查职业是否支持") end
return
end
-- ============ V6新功能:优先目标扫描 ============
-- 先扫描优先目标数组,只有血量缺口>=CFG_PRIORITY_MIN_LOST才奶
if CFG_priorityTargets and #CFG_priorityTargets > 0 then
if TryHealScan(CFG_priorityTargets, CFG_PRIORITY_MIN_LOST, "优先治疗") then
return
end
end
-- ==========================================
local me = GetMeInfo()
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 CFG_DEBUG_HEAL then print("一键奶:不在团队中,仅治疗自己") end
end
end
-- 构建宠物扫描列表
if CFG_INCLUDE_PETS then
for i, m in ipairs(scanList) do
local guid = type(m) == "table" and m.guid or m
local info = GetUnitInfo(guid)
if info and info.petGuid and info.petGuid ~= "" and info.petGuid ~= "0" then
scanList[#scanList + 1] = { guid = info.petGuid }
end
end
end
-- 大团扫描
if not TryHealScan(scanList, 0, "治疗") then
if CFG_DEBUG_HEAL then print("无需治疗") end
end
endThen click the [Save & Sync to Game] button in the top-right corner of the interface.

How It Works
- When pressing the macro again, it first checks whether the last healed target is at full health. If so, it cancels the current cast (to avoid wasting mana) and continues scanning for a new target.
- Uses
GetMeInfo()to automatically detect your current class and select the corresponding healing spell configuration. - V5 New: Checks whether
TeamMembers()is empty. If not in a raid, adds yourself to the scan list. - Scans by healing rank priority from highest to lowest.
- Within each rank, finds the teammate with the largest health deficit within range.
- V5 New: During scanning, checks the
noAuracondition (if configured), skipping targets that already have that aura. - High-priority (urgent) targets are healed immediately upon discovery; lower-priority ranks are not checked.
- After casting, records the target for the next cancel-cast check.
- If no suitable target is found at any rank, does nothing.
flowchart TD
A[Press Hotkey] --> A1{Last target at full health?}
A1 -->|Yes| A2[Cancel current cast]
A2 --> A3[GetMeInfo: get your class]
A1 -->|No| A3
A3 --> A4[Select spell table by class]
A4 --> A5{TeamMembers empty?}
A5 -->|Yes| A6[Add yourself to scan list]
A5 -->|No| A7[Use raid 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 has noAura aura?}
F3 -->|Yes| D
F3 -->|No| G
F2 -->|Yes| G[Record target with largest 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{Lower ranks remaining?}
J -->|Yes| C
J -->|No| K[No healing needed]Function Reference
| Function | Description |
|---|---|
GetMeInfo() | Get your own info (classId, health, guid, aura list, etc.) |
TeamMembers() | Get the list of all raid/party members (returns empty when not in a raid) |
GetUnitInfo(guid) | Get detailed member info by guid (health, status, aura list, etc.) |
Distance(guid) | Get the distance (in yards) between you and the specified member |
Spell(spellId, guid) | Cast a spell on the 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 added optional field:
| Field | Type | Default | Description |
|---|---|---|---|
minLost | number | Required | Minimum health deficit |
maxDist | number | Required | Maximum cast range (yards) |
spellId | number | Required | Spell ID to cast |
name | string | Required | Spell name (for debugging) |
noAura | number | 0 | Aura spell ID that the target must not have, 0 = no check |
Important Notes
- You must first enable the Model Edit feature in Heitu; the Super Macro will then take effect automatically.
- It is recommended to disable your antivirus or add the Heitu directory to the whitelist.
- Spell IDs can be looked up on database websites such as db.heitu.org.
- Supports all 60/70/80 level clients (112/114/243/253/343).
- When
noAurais0, aura checking is completely skipped and does not affect macro performance. - Aura detection relies on client-side cache data; make sure the target is within visible range.
- In solo mode, if
INCLUDE_PETSis enabled, your own pets will also be scanned automatically.
FAQ
Q1: It doesn't work after following the tutorial
First, update Heitu to the latest version, then check whether the spell IDs in the macro are correct. Do not just copy and use them directly—the spell IDs in the example are for the vanilla (level 60) era.
Q2: What if I want to use One-Key Heal across multiple classes?
No action needed! The macro has built-in auto class detection. It automatically switches to the appropriate spell configuration based on GetMeInfo().classId.
Q3: How to cancel an in-progress heal cast?
When the target is already at full health (e.g., topped off by another healer), pressing the macro again will automatically cancel the current cast.
Q4: How to look up an aura's spell ID
You can look it up on database websites such as db.heitu.org. You can also use the spell on a target in-game, then use Heitu's debugging features to view the 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
endQ5: Setting noAura to a non-zero value breaks the macro
Make sure you entered the aura's spell ID (i.e., the spellId of the buff on the target), not the ID of the spell that applies it. For example, the 恢复 spell ID is 25315, but the 恢复 aura ID on the target is 139. Use the script from Q4 to confirm.