虽然那位大神给ai学习的都是335脚本,但我通过告诉ai需要施法的技能,和优先级,他也给我写出了个兽王脚本。
因为是那位大神训练的ai,脚本我就不收钱了。直接贴出来。
[Lua] 纯文本查看 复制代码 -- 检查并施放猎人印记
local function ApplyHuntersMark()
if BeeTargetDeBuffTime("猎人印记") < 1 and BeeSpellCoolDown("猎人印记") == 0 then
BeeRun("/cast 猎人印记", "target")
end
end
-- 检查并施放毒蛇钉刺
local function ApplySerpentSting()
if BeeTargetDeBuffTime("毒蛇钉刺") < 1 and BeeSpellCoolDown("毒蛇钉刺") == 0 then
BeeRun("/cast 毒蛇钉刺", "target")
end
end
-- 检查并施放杀戮命令
local function CastKillCommand()
if BeeSpellCoolDown("杀戮命令") == 0 then
BeeRun("/cast 杀戮命令")
end
end
-- 检查并施放奥术射击或眼镜蛇射击
local function CastArcaneShotOrAutoShot()
local energy = BeeUnitMana("player", nil, 0) -- 获取玩家当前能量值
if energy > 60 and BeeSpellCoolDown("奥术射击") == 0 then
BeeRun("/cast 奥术射击", "target")
else
BeeRun("/cast 眼镜蛇射击", "target")
end
end
-- 检查并施放杀戮射击
local function CastKillShot()
local healthPercent = BeeUnitHealth("target", "%") -- 获取目标血量百分比
if healthPercent < 20 and BeeSpellCoolDown("杀戮射击") == 0 then
BeeRun("/cast 杀戮射击", "target")
end
end
-- 检查并施放狂野怒火
local function CastWildfire()
if BeeSpellCoolDown("狂野怒火") == 0 then
BeeRun("/cast 狂野怒火")
end
end
-- 检查并施放集中火力
local function CastFocusFire()
if BeeSpellCoolDown("集中火力") == 0 and BeePlayerBuffTime("集中火力")<1 and BeeSpellCoolDown("狂野怒火") > 0 then
BeeRun("/cast 集中火力")
end
end
-- 主函数,整合上述逻辑
local function Main()
ApplyHuntersMark()
ApplySerpentSting()
CastKillCommand()
CastArcaneShotOrAutoShot()
CastKillShot()
CastWildfire() -- 进入战斗后优先施放狂野怒火
CastFocusFire() -- 狂野怒火冷却时施放集中火力
end
-- 战斗状态检查,如果进入战斗则开始主循环
local function CheckCombat()
if BeeIsCombat() then
Main()
end
end
-- 启动脚本
CheckCombat( )
------------------------------------------------------------------------------
说下心得,要明确告诉ai,目标保持那些debuff,ai有时候不理解debuff和buff的区别。BeeUnitBuffCount(“狂乱效果“,”pet”)无法使用,所以第一次就无法5层集中火力,前20秒只能1层了。总体来说,ai写脚本的确便捷很多。
|