你看不见我~ 发表于 2022-7-11 00:09:28

335怎么写跟随后攻击啊?

我写了个跟随宏
if BeeCastSpellFast() then return;end
if UnitName("focus") and ((BeeRange("focus")<=25 and BeeRange("focus")>=10) or not BeeUnitIsFollow()) then
    FollowUnit("focus");
end
还有一个攻击宏的目标的代码。,,,,不知道对不对
--自动攻击焦点目标
if not IsMounted("player")   then
    BeeRun("/target [@focustarget,harm]");
    return true;
end

这俩怎么实现啊?跟随的宏实现了,攻击的宏没反应啊?????

idlng 发表于 2022-7-11 19:27:43

local focus = "focus"
local focuscombat = BeeUnitAffectingCombat(focus)
local attacking = BeeUnitAffectingCombat()

if 干饭 or 喝水 or 坐骑 or 施法中 or 光荣牺牲 then
    return true;
end


if BeeRange(focus) < 35
and focuscombat
and not attacking then
    if UnitExists("focustarget")
    and UnitIsEnemy("focustarget") then
      RunMacroText("/target focustarget\n/attack")
    end
end

你看不见我~ 发表于 2022-7-11 22:55:14

idlng 发表于 2022-7-11 07:27 PM
local focus = "focus"
local focuscombat = BeeUnitAffectingCombat(focus)
loca ...

调试不过啊,这个干饭喝水是什么鬼啊?

idlng 发表于 2022-7-11 23:00:35

你看不见我~ 发表于 2022-7-11 10:55 PM
调试不过啊,这个干饭喝水是什么鬼啊?

干饭{:6_233:}

就是

BeePlayerBuffTime("喝水")>0 --干饭
or BeePlayerBuffTime("进食")>0 --喝水

你看不见我~ 发表于 2022-7-12 09:24:29

idlng 发表于 2022-7-11 11:00 PM
干饭

就是

大佬,,看看我这个写的,,总是跟随,不停止,而且攻击方向和距离都不对,稍微方向不对,或者远一点就攻击不到,什么问题啊?
local focus = "focus"
local focuscombat = BeeUnitAffectingCombat(focus)
local attacking = BeeUnitAffectingCombat()

if BeePlayerBuffTime("喝水")>0 or BeePlayerBuffTime("进食")>0 or BeePlayerBuffTime("召唤军马")>0 then
    return true;
end
if BeeCastSpellFast() then return;end
if UnitName("focus") and ((BeeRange("focus")<=30 and BeeRange("focus")>=20 or not BeeUnitIsFollow())) then
    FollowUnit("focus");
end

if BeeRange(focus) < 35
and focuscombat
and not attacking then
    if UnitExists("focustarget")
    and UnitIsEnemy("focustarget") then
      RunMacroText("/target focustarget\n/attack")
    end
end

老血 发表于 2022-7-16 14:24:27

http://www.luacn.net/thread-27413-1-1.html

下雨啦 发表于 2022-9-5 14:13:01

进来学习下科普贴啊!!!

盗潜灬风云 发表于 2022-9-9 14:48:11

进来学习。。。感谢大佬科普。。。

初级小白 发表于 2022-10-23 09:41:02

学习。。。感谢大佬科普。。。
页: [1]
查看完整版本: 335怎么写跟随后攻击啊?