请教,mush里,这种应该怎么做?
function aaaaa()wait.make (function ()
SetVariable("a_con","0")
SetVariable("b_con","0")
local a_con = tonumber(GetVariable ("a_con"))
local b_con = tonumber(GetVariable ("b_con"))
Send("say 做某某某\r\nset brief 1")
wait.time (1)
Send("xxxxxx")
wait.time (1)
for i=1,15 do
Send("xxxxxxxxxxxxxxxxxxx")
wait.time (5)
if a_con == 1 and b_con == 1 then
break
end
end
if a_con == 1 and b_con == 1 then
isxxxxok()
end
Send("xxxxxxxxxxx")
wait.time (1)
xxxxxx()
end)
end
function isxxxxok()
wait.make (function ()
Send("xxxxxxxxxx")
wait.time (1)
Send("xxxxxxxxxx")
wait.time (5)
Send("xxxxxxxxxx")
wait.time (1)
end)
end
-----------------------------这样也不行--------------------
function aaaaa()
wait.make (function ()
SetVariable("a_con","0")
SetVariable("b_con","0")
local a_con = tonumber(GetVariable ("a_con"))
local b_con = tonumber(GetVariable ("b_con"))
Send("say 做某某某\r\nset brief 1")
wait.time (1)
Send("xxxxxx")
wait.time (1)
for i=1,15 do
Send("xxxxxxxxxxxxxxxxxxx")
wait.time (5)
if a_con == 1 and b_con == 1 then
break
end
end
if if a_con == 1 and b_con == 1 then
wait.make (function ()
Send("xxxxxxxxxx")
wait.time (1)
Send("xxxxxxxxxx")
wait.time (5)
Send("xxxxxxxxxx")
wait.time (1)
end
Send("xxxxxxxxxxx")
wait.time (1)
xxxxxx()
end)
end
这两个都是1
SetVariable("a_con","0")
SetVariable("b_con","0")
[ 本帖最后由 tesaa 于 2010-3-31 09:49 PM 编辑 ] 是红色部分不执行吗? 把
isxxxxok()
换成一个直接的命令比如说
Send("hi")这种
我觉得是 isxxxxok()根本没有来得及进去...被后面的冲掉了.你再试看看 典型用ZMUD的#WAIT理念往MUSH套啊。
换用DoAfter()吧,相对简单点,不要用wait.make了。
wait.make用的是LUA的协同,不熟悉的话还是不要用了。 用DoAfter更加麻烦:
DoAfterSpeedWalk (1,"(out) e 3n (enter shudong) (say 天堂有路你不走呀)")
DoAfterSpeedWalk (2,"5e (ask xxx about xxx)")
DoAfterSpeedWalk (3,"2s 6w u")
DoAfterSpeedWalk (4,"(out) 2d 9e 4e")
DoAfterSpeedWalk (5,"e (eu) (unwield all) (wield bian) e (hit xxx)")
DoAfterSpeedWalk (6,"(perform whip.chan) (unwield bian)")
DoAfterSpeedWalk (14,"(unwield all) (wield hero sword) (wield dao) (yun powerup) (kill xxx)")
DoAfterSpeedWalk (16,"(nu) (kill xxx)") require"wait"
function aaaaa()
wait.make (function ()
SetVariable("a_con","0")
SetVariable("b_con","0")
local a_con = tonumber(GetVariable ("a_con"))
local b_con = tonumber(GetVariable ("b_con"))
print(a_con,b_con)
Send("say 做某某某\r\nset brief 1")
wait.time (1)
Send("xxxxxx1")
wait.time (1)
for i=1,15 do
Send("xxxxxxxxxxxxxxxxxxx2")
wait.time (1)
if a_con ~= 1 and b_con ~= 1 then
break
end
end
if a_con ~= 1 and b_con ~= 1 then
isxxxxok()
end
Send("xxxxxxxxxxx3")
wait.time (1)
--- xxxxxx()
end)
end
function isxxxxok()
wait.make (function ()
Send("xxxxxxxxxx4")
wait.time (1)
Send("xxxxxxxxxx5")
wait.time (5)
Send("xxxxxxxxxx6")
wait.time (1)
end)
end
然后输入/aaaaa()
看看运行结果,就很清楚了 设定SpeekWalk的时间间隔比这个要容易些。 好。我试试6楼的方法。SpeekWalk怎么用。给个例子出来嘛。 http://pkuxkx.com/forum/viewthread.php?tid=8059&extra=page%3D&page=1
上面的帖子muxiao那一楼的plugin,仔细看一下,或许有帮助。 楼主的这个思路,真是....很那个啥..
如果你是要想做遍历路径的话...可以去看看maper的领悟机器人.那里有一个走路的功能.....你琢磨一下,就可以明白了
页:
[1]