|
楼主 |
发表于 2020-11-26 20:36:01
|
显示全部楼层
本帖最后由 dengtaliyi 于 2020-11-27 10:24 AM 编辑
这是我用拿来主义学习的代码,请问找到npc怎么停止
function slow_path(path_name, time_wait)
if nil~= path_dir_bianli_table[path_name] then
fill_slow_path(path_name);
slow_path_thread=coroutine.create(function ()
for i,v in ipairs(temp_slow_path_table) do
world.DoAfterSpecial(time_wait, "slow_auto_next();",12);
coroutine.yield();
world.Send(v);
end
end);
coroutine.resume(slow_path_thread);
else
Note("你有这个搜索路径么");
end
end
slow_state=0;
function slow_pause()
slow_stat=1;
end
function slow_resume()
slow_stat=0;
slow_auto_next();
end
function slow_auto_next()
if slow_state==0 then
coroutine.resume(slow_path_thread);
end
end
function slow_path_Init()
world.AddAlias("al_slow_path","^\\#slow (.*?) (.*?)$",
"slow_path(\"%1\",%2);",
alias_flag.Enabled + alias_flag.Replace + alias_flag.RegularExpression,
"");
world.SetAliasOption("al_slow_path", "send_to", "12");
end
slow_path_Init(); |
|