|
跟着cappuccino学着做都会出错,居然出错了不知道怎么检查,求教一下,以下是代码
get_listesc = function ()
Execute("listesc")
wait.make(function()
local l, w = wait.regexp("镖局押镖任务列表")
if string.find(l, "> ") then
SetVariable("hubiao_from",string.sub(l, 3, 6))
else
SetVariable("hubiao_from",string.sub(l, 1, 4))
end
listesc = {}
EnableTrigger("hubiao_listesc",1)
local l, w = wait.regexp("使用命令【getesc 任务序号】来认领押镖任务。")
local quest_no, quest_place = get_best_quest(listesc) -------------106行
SetVariable("hubiao_place",quest_place)
Execute("getesc " .. quest_no)
lj = path_hubiao[GetVariable("hubiao_from")][GetVariable("hubiao_place")][1]
print("获得lj值",lj)
EnableTrigger("hubiao_listesc",0)
end)
end
get_best_quest = function (listesc)
tprint(listesc)
----获得最优任务序号,预留接口
for i, v in pairs(listesc) do
print(v.place)
print("from",GetVariable("hubiao_from"),"to", v.place)
if path_hubiao[GetVariable("hubiao_from")][v.place] then ----------126行
return v.no, v.place
end
---------------------------------------------------
错误信息为:Error raised in trigger function (in wait module)
stack traceback:
[string "Script file"]:126: in function 'get_best_quest'
[string "Script file"]:106: in function <[string "Script file"]:96> |
|