|
发表于 2025-6-11 17:11:56
|
显示全部楼层
看看大佬们的local target = "target"
local focusTarget = "focustarget"
-- 跟随目标
function FollowTarget()
if UnitIsFriend("player", target) and not UnitIsDeadOrGhost(target) then
if IsSpellInRange("跟随", target) then
CastSpellByName("跟随", target)
else
print("太远了,无法跟随")
end
end
end
-- 切换焦点目标
function FocusTarget()
if UnitExists(focusTarget) and not UnitIsDeadOrGhost(focusTarget) then
TargetLastEnemy()
AttackTarget(focusTarget)
else
TargetNextEnemy()
end
end
-- 检查并攻击焦点目标
function AttackFocusTarget()
if UnitExists(focusTarget) and not UnitIsDeadOrGhost(focusTarget) then
if IsSpellInRange("攻击", focusTarget) then
AttackTarget(focusTarget)
else
print("焦点目标太远了,无法攻击")
end
end
end
-- 主输出循环
while true do
-- 跟随目标
FollowTarget()
-- 切换焦点目标
FocusTarget()
-- 检查并使用主要输出技能
if IsUsableSpell("致死打击") then
CastSpellByName("致死打击", target)
elseif IsUsableSpell("顺劈斩") then
CastSpellByName("顺劈斩", target)
elseif IsUsableSpell("英勇打击") then
CastSpellByName("英勇打击", target)
end
-- 检查并使用群体攻击技能
if IsUsableSpell("雷霆一击") and UnitCount(target) > 1 then
CastSpellByName("雷霆一击", target)
end
-- 继续攻击
AttackTarget(target)
break
end
|
|