魔兽世界怀旧版,自动跟随插件,真麻烦,什么版本投诉,我还是贴出来吧
D:\World of Warcraft\_classic_\Interface\AddOns\
D:\World of Warcraft\_classic_\Interface\AddOns\AutoFollow
其实就两个文件:可以新建文本文件,保存的时候按下面文件后缀保存就可以了。
AutoFollow.lua
----------------
---AutoFollow---
----------------
--Novaspark-Firemaw EU (classic) / Venomisto-Frostmourne OCE (retail).
--https://www.curseforge.com/members/venomisto/projects
--Spams /follow <name> every 2 seconds.
--Use /af playername to start it, or just /af with a player target selected.
--Use /af stop to end it.
local afEnabled, followTarget;
local function doAutoFollow()
if (afEnabled) then
C_Timer.After(2, function()
FollowUnit(followTarget, true);
doAutoFollow();
end)
end
end
local function startAutoFollow(msg)
print("|cffff8700AutoFollowing " .. msg .. " 每2秒跟随一次. (输入 \"/af stop\" 为停止)");
FollowUnit(msg, true);
afEnabled = true;
followTarget = msg;
doAutoFollow();
end
local function printHelp(msg)
print("|cffff8700AutoFollow Help:");
print("|cffff8700Type \"/af playername\" to start following every 2 seconds.");
print("|cffff8700Or just type \"/af\" with a player targeted.");
print("|cffff8700To stop type \"/af stop\".");
end
local followspam = CreateFrame("Frame");
SLASH_PUNKAF1, SLASH_PUNKAF2 = '/autofollow', '/af';
function SlashCmdList.PUNKAF(msg, editBox)
if (msg == "") then
if (UnitIsPlayer("target")) then
if (UnitName("target") == UnitName("player")) then
print("|cffff8700你无法跟随你自己.");
return;
else
startAutoFollow(UnitName("target"));
return;
end
elseif UnitExists("target") then
print("|cffff8700当前目标不是玩家, 先目标一个玩家,或者输入 \"/af 名字\".");
return;
end
print("|cffff8700你需要指定一个玩家才能跟随. 例如: /autofollow 张三");
return;
end
if (msg == "help") then
printHelp();
end
if (msg == "stop" or msg == "end" or msg == "cancel") then
afEnabled = false;
print("|cffff8700停止跟随.");
return;
else
if (string.lower(msg) == string.lower(UnitName("player"))) then
print("|cffff8700你无法跟随你自己.");
return;
end
startAutoFollow(msg);
end
end
AutoFollow.toc
## Interface: 11302
## Notes: Does /follow <name> every few seconds so if follow breaks it will refollow.
## Title: AutoFollow
## Author: Novaspark-Firemaw EU
## Version: 1.0
AutoFollow.lua