关于自动跟随
想请教一下大佬写一个自动跟随的脚本。就是想在团队里,自动找到20码左右的队友,然后跟随。比如跟随到身边后又找距离20码左右的队友,再切换目标跟随。
目的是在战场中跟大队走来走去。而不是站着不动。
用魔蜂可以实现吗?
谢谢。 用for do遍历团队成员,然后判断距离,如果超过20码,就自动跟随 懒动行不行 发表于 2024-5-13 06:58 PM
用for do遍历团队成员,然后判断距离,如果超过20码,就自动跟随
可不可以具体点呢?谢谢。 可以参考我的一个跟随脚本的逻辑片段:
local followUnit = nil;
-- 要跟随的固定角色名字,没有就配置为空
local followPlayerName = "妖·蓝玉";
-- 尝试查找指定目标
if followPlayerName ~= "" then
RunMacroText("/cleartarget\n/target " .. followPlayerName);
if UnitName("target") == followPlayerName and BeeRange("target") <= 30 then
followUnit = "target";
else
RunMacroText("/cleartarget");
end
end
-- 没有特定目标时,在队伍中随机选择一个玩家
if followUnit == nil then
local partyCount = GetNumPartyMembers();
for i = 1, partyCount, 1 do
local range = BeeRange("party" .. i);
if range <= 30 then
followUnit = "party" .. i;
end
end
end
-- 有跟随目标则开始跟随
if followUnit then
FollowUnit(followUnit);
end
页:
[1]