零基础小白学触动 - 05 - 触动常用函数
点击 滑动 原理
其实都可以分解成 按下=》 等待一定时间或者移动动作=》 松开
点击: tSLib库的函数tap(x,y) 后面还有2个参数 可以自己看手册 https://www.zybuluo.com/miniknife/note/293935#函数tap-点击
滑动 moveTo(x1,y1,x2,y2,step) 详细的 https://www.zybuluo.com/miniknife/note/293935#函数moveto-滑动
?如何实现精确滑动 https://zimaoxy.com/b/t-860-1-3.html 深入研究 暂时还没理解思路 而触动手册里面给的例子测试过 无法做到完美的精确滑动 就不用了 还有其他模式的滑动 在当前滑动无效的情况下
延时 mSleep()
坐标初始化函数 init(0) 没什么说的 0是home在下 1是home在右 2是home在左 脚本开始要坐标初始化下 而且不能把init() 放到其他文件然后require导入 是对main.lua无效的 血泪的教训
小知识:require 调用文件的使用注意
-
require会自动判断当前原码是否已经载入该文件 如果已经载入这个文件就不会再继续载入 给我们一个省事的用法
- 无法叠加require 比如说 我在主脚本里面调用自己的模版 但是在自己的模版里面调用 TSLib库 这样是无法在主脚本里面直接调用TSLib库的 只能直接在主脚本里面载入TSLib
- 多个调用文件之间的函数 表 变量的互通情况的注意事项
并不清楚lua实现的原理 但是也勉强总结了一些经验
1.几个文件相互调用的情形下 文件内的变量函数表或者其他数据类型 如果想要其他文件也可以自由调用 那么千万不能加local变成局部变量 个人原来很喜欢尽可能的减少全局变量的数母来提高效率但是这样会导致很多调用问题 就算是在main.lua的最外层 用local声明的伪局部变量也不行
2.如果某个被调用文件内的函数或者表 调用了其他文件的变量 函数 或者表 注意调用时候双方的前后位置 因为 如果 其他文件的变量 函数 或者表 尚未载入完成 我们就引用了 被调用文件内的函数或者表 那么自然参与运算的变量函数表也是空的
小知识:取色器的一个补充 R快捷键的作用
用于两张截图的多个相同坐标的颜色的对比 比按键的切换图片对比更加精细
在第一张图片上取多个点 这里就在蓝色对勾上取点
切换到第二个图片 点击快捷键R 坐标没变化 但是这里显示是第二张图片的颜色了
小知识:nLog()函数的注意事项
1.输出日志到触动精灵 IDE 编辑器
2.由触动精灵脚本编辑器发起的脚本运行将会接收到 nLog 回传信息,其他方式运行的脚本将不会触发 nLog 函数 的确相当于按键的traceprint
for i=1,20 do
nLog(tostring(i))
end
结果
20
19
18
17
16
15
13
12
11
10
9
6
8
7
5
3
2
1
14
从结果看 不单单输出的内容是倒着的 而且比如14还出现在1之前 顺序也是乱的 是日志是异步生成的 导致的
解决办法:
nLog之间加上一点点延迟经过测试 延迟为1ms的话依然无法解决问题 可以设置为10ms 就顺序正常了
for i=1,20 do
nLog(tostring(i))
mSleep(5)
end
为了彻底解决这个问题 暂时想到的解决办法
function nLogEx(str) nLog(str) mSleep(10) end --下面是最常用的显示当前哪个文件和第几行 也对里面nLog做了处理 function traceprint(str) local info = debug.getinfo(2) nLog("[" .. tostring(info["source"]) .. "]" .. "第" .. tostring(info["currentline"]) .. "行 " .. tostring(str)) --nLog("[" .. string.format("%s:%d:", info["source"]:match(".*\\([^\\]*)")) .. "]" .. "第" .. tostring(info["currentline"]) .. "行 " .. tostring(str)) mSleep(5)--为了nLog的显示顺序的暂时解决办法 end
小知识:nLog()函数无法满足需求 因为我刚发现触动的日志系统真的很强大 上面那个日志函数并不完善
http://www.cncrk.com/downinfo/117279.html --官方群管理员说这个没问题 一个局域网查看触动日志的工具
--【脚本实例】 --1、写到本地日志 initLog("test", 0);--把 0 换成 1 即生成形似 test_1397679553.log 的日志文件 wLog("test","[DATE] Test_1 OK!!!"); mSleep(500); wLog("test","[DATE] Test_2 OK!!!"); closeLog("test"); --关闭日志 --2、发送服务器日志 initLog("192.168.1.1", 2); --初始化日志,并以异步方式发送;把 2 换成 3 即为同步发送 wLog("192.168.1.1", "[DATE] Test OK!!!"); --将日志发送到 192.168.1.1 closeLog("192.168.1.1"); --关闭服务器连接 --3、多日志记录 initLog("test_1", 0); initLog("test_2", 0); wLog("test_1","[DATE] Test_1 OK!!!"); mSleep(500); wLog("test_2","[DATE] Test_2 OK!!!"); closeLog("test_1"); closeLog("test_2");
简易的例子
--避免日志顺序不对的对日志函数的封装 function nLogEx(str) nLog(str) mSleep(5) end --wLog加强版 只需要写日志内容就好 不需要填写日志文件名和[data]了 --需要配置表的日志文件元素 --运行后 在日志输出窗口可以看到Nlog的信息 也可以在对应的日志文件里面找到wLog的日志记录 function wLogEx(contents) if config["isLog"] then wLog(config["logFileName"], tostring(contents)) nLogEx(contents) end end --配置区 config={} ----脚本信息 config["author"]="点滴积累"--作者 config["QQ"]="1847154827"--QQ config["scriptName"]="测试脚本一"--脚本名字 ----日志相关(暂时不考虑多日志并存的情况) config["isLog"]=true--是否开启日志(包含日志输出窗口和日志文件两部分) config["logFileName"]=tostring(config["scriptName"]) .. tostring(os.date("%Y%m%d%H%M%S",os.time())) --只是当前日志文件名字不是完整路径年月日时分秒 如XXXX20190816112336 加了个前缀 config["logMode"]=0--0表示写入本地日志文件--1 - 生成 1 个以时间戳命名的后缀为 .log 的文件到 log 文件夹下 2 - 异步发送到服务器(支持引擎 v1.7.0 及 Android v2.4.1 以上版本)3 - 同步发送到服务器(仅支持触动精灵 iOS v1.7.0 及以上版本) --初始化区 init(0)--设置坐标初始化 这个初始化必须在main.lua下声明 不然整个坐标都会出问题 if config["isLog"] then initLog(tostring(config["logFileName"]), config["logMode"])--设置日志初始化 日志文件名和日志模式 日志名由配置表的元素提供 end --测试区 for i=1,20 do wLogEx("hello" .. tostring(i)) end --销毁区--脚本停止前要做的事情 if config["isLog"] then closeLog(config["logFileName"]); end
小知识:beforeUserExit 销毁事件的触发
此函数可以被 lua_exit()
、音量键停止
、远程接口停止
触发 但是脚本自己报错崩溃这个情况他不会触发 还有脚本正常运行完毕也不会触发
实际测试哪些能触发
1.os.exit() X 不会正常触发beforeUserExit 销毁事件 不但不会正常的停止 脚本还有一些奇怪的表现 不要用os.exit()停止脚本
2.lua_exit()√ 以后使用这个停止脚本
3.编辑器上的停止按钮 √
4 音量减号√
零基础小白学触动 - 06 - 如何写简单的点击脚本
这节课只是取坐标然后点击而已
零基础小白学触动 - 07 - 找色
小知识:toast的显示问题
因为这个东西是异步显示 下图是同时呈现toast和nlog
?
结论:很遗憾 这个toast无法保证实时的显示信息 和按键的showmessage无法比
小知识:老师提到 使用中文变量 可能会影响效率 我自己做了个测试 代码如下
?
结果:
?
?
?
结论:中文变量和英文变量基本没区别 可以安心的使用中文变量 不过为了省事变量还是尽量英文或者拼音把
知识点:触动的多点找色 多点比色 找图 循环多点找色 循环多点比色 循环找图 等待多点找色消失 等点多点比色消失 等待找图消失
--输出日志信息到日志窗口和日志文件 日志文件的输出由配置表控制 function traceprint(str) local info = debug.getinfo(2) local tempStr="[" .. tostring(info["source"]) .. "]" .. "第" .. tostring(info["currentline"]) .. "行 " .. tostring(str) if config["isLog"] then wLog(config["logFileName"], tostring(tempStr)) end nLog(tempStr) mSleep(5)--为了nLog的显示顺序的暂时解决办法 end function try(block) local tablejoin = function (...) local result = {} for _, t in ipairs({...}) do if type(t) == "table" then for k, v in pairs(t) do if type(k) == "number" then table.insert(result, v) else result[k] = v end end else table.insert(result, t) end end return result end -- get the try function local try = block[1] assert(try) -- get catch and finally functions local funcs = tablejoin(block[2] or {}, block[3] or {}) -- try to call it local result_error = {} local results = {pcall(try)} if not results[1] then -- run the catch function if funcs and funcs.catch then result_error = {funcs.catch(results[2])} end end -- run the finally function if funcs and funcs.finally then local result_fin = {funcs.finally(table.unpack(results))} if #result_fin > 0 then return table.unpack(result_fin) end end -- ok? if results[1] and #results > 1 then return table.unpack(results, 2, #results) else if #result_error > 0 then return table.unpack(result_error) else return nil end end end function catch(block) -- get the catch block function return {catch = block[1]} end function finally(block) -- get the finally block function return {finally = block[1]} end --[[ 功能:多点找色 interface 界面 window 窗口 Button 按钮 参数:就是一个表 基本结构 ddzs_zhujiemian_kaishiyouxiButton={"游戏主界面_开始游戏按钮",color, posandcolor, degree, x1, y1, x2, y2,{orient=1, main = 0x101010,list = 0x202020}} 返回值:-1 1 -1表示找不到 1表示找到 坐标在全局变量intX,intY里面 --]] function ddzs(tempTable) -- 1.检测传递进来的参数的合法性 这里就罢了 -- 2.开始传递进来参数进行多点找色 -- 3.判断查找结果 返回函数返回值 return try{ function () --下面代码随便写 有可能抛出异常即可 local result=-1 local startTime=os.time() local mark=tempTable[1] local color=tempTable[2] local posandcolor=tempTable[3] local degree=tempTable[4] local x1=tempTable[5] local y1=tempTable[6] local x2=tempTable[7] local y2=tempTable[8] local tempX=-1 local tempY=-1 if type(tempTable[9])=="table" then tempX, tempY = findMultiColorInRegionFuzzy(color, posandcolor, degree, x1, y1, x2, y2,tempTable[9]) else tempX, tempY = findMultiColorInRegionFuzzy(color, posandcolor, degree, x1, y1, x2, y2) end if tempX>-1 and tempY>-1 then result=1 traceprint("[多点找色] [" .. tostring(mark) .. "] 坐标:" .. tostring(tempX) .. "," ..tostring(tempY)) intX=tempX intY=tempY else traceprint("[多点找色] <" .. tostring(mark) .. "> 没找到 ") end return result end, catch{ function (errors) --这里对应函数名要改 traceprint("函数[" .. tostring("ddzs") .. "] <" .. tostring(tempTable[1] ) .. "> 错误信息:".. tostring(errors)) end } } end --[[ 多点比色 参数 {"游戏主界面_开始游戏按钮",array,dim,flag} 注意颜色数组是x1,y1,颜色数值 而不是以|分隔 返回值:-1 1 -1表示找不到 1表示找到 坐标在全局变量intX,intY里面 坐标其实就是颜色组第一个元素的坐标 --]] function ddbs(tempTable) return try{ function () --下面代码随便写 有可能抛出异常即可 local result=-1 local startTime=os.time() local mark=tempTable[1] local tempArray=tempTable[2] local dim=tempTable[3] local flag=tempTable[4] local tempX=-1 local tempY=-1 if multiColor(tempArray,dim,flag) == true then tempX=tonumber( tempArray[1][1]) or -1 tempY=tonumber( tempArray[1][2]) or -1 if tempX==-1 or tempY==-1 then error("第一颜色项坐标存在问题") else result=1 traceprint("[多点比色] [" .. tostring(mark) .. "] 坐标:" .. tostring(tempX) .. "," ..tostring(tempY)) intX=tempX intY=tempY end else traceprint("[多点比色] <" .. tostring(mark) .. "> 没找到 ") end return result end, catch{ function (errors) --这里对应函数名要改 traceprint("函数[" .. tostring("ddbs") .. "] <" .. tostring(tempTable[1] ) .. "> 错误信息:".. tostring(errors)) end } } end --[[ --找图 不过触动对找图支持的好差 截图还需要用ps 参数 {"游戏主界面_开始游戏按钮",picpath, degree, x1, y1, x2, y2, alpha, type} 返回值:-1 1 -1表示找不到 1表示找到 坐标在全局变量intX,intY里面 --]] function zt(tempTable) return try{ function () --下面代码随便写 有可能抛出异常即可 local result=-1 local startTime=os.time() local mark=tempTable[1] local picpath=tempTable[2] local degree=tempTable[3] local x1=tempTable[4] local y1=tempTable[5] local x2=tempTable[6] local y2=tempTable[7] local alpha=tempTable[8] or 0 local tempType=tempTable[9] local tempX=-1 local tempY=-1 if tempType==nil then tempX, tempY = findImageInRegionFuzzy(picpath, degree, x1, y1, x2, y2, alpha) else tempX, tempY = findImageInRegionFuzzy(picpath, degree, x1, y1, x2, y2, alpha,tempType) end if tempX>-1 and tempY>-1 then result=1 traceprint("[找图] [" .. tostring(mark) .. "] 坐标:" .. tostring(tempX) .. "," ..tostring(tempY)) intX=tempX intY=tempY else traceprint("[找图] <" .. tostring(mark) .. "> 没找到 ") end return result end, catch{ function (errors) --这里对应函数名要改 traceprint("函数[" .. tostring("zt") .. "] <" .. tostring(tempTable[1] ) .. "> 错误信息:".. tostring(errors)) end } } end --[[ 循环多点找色 参数 ({"游戏主界面_开始游戏按钮",color, posandcolor, degree, x1, y1, x2, y2,{orient=1, main = 0x101010,list = 0x202020}},10) 返回值:-1 1 -1表示找不到 1表示找到 坐标在全局变量intX,intY里面 --]] function waitDdzs(tempTable,limitTime) return try{ function () --下面代码随便写 有可能抛出异常即可 local result=-1 local startTime=os.time() local mark=tempTable[1] local color=tempTable[2] local posandcolor=tempTable[3] local degree=tempTable[4] local x1=tempTable[5] local y1=tempTable[6] local x2=tempTable[7] local y2=tempTable[8] local tempX=-1 local tempY=-1 limitTime=tonumber(limitTime) or 5--默认是5秒限制 while(true) do if (os.time()- startTime)>limitTime then --traceprint("到时间了跳出") result=-1 break end if type(tempTable[9])=="table" then tempX, tempY = findMultiColorInRegionFuzzy(color, posandcolor, degree, x1, y1, x2, y2,tempTable[9]) else tempX, tempY = findMultiColorInRegionFuzzy(color, posandcolor, degree, x1, y1, x2, y2) end if tempX>-1 and tempY>-1 then result=1 intX=tempX intY=tempY --traceprint("找到了跳出") break else end mSleep(100) end if result==1 then traceprint("[循环多点找色] [" .. tostring(mark) .. "] 坐标:" .. tostring(tempX) .. "," ..tostring(tempY)) else traceprint("[循环多点找色] <" .. tostring(mark) .. "> 没找到 ") end return result end, catch{ function (errors) --这里对应函数名要改 traceprint("函数[" .. tostring("waitDdzs") .. "] <" .. tostring(tempTable[1] ) .. "> 错误信息:".. tostring(errors)) end } } end --循环多点比色 function waitDdbs(tempTable,limitTime) return try{ function () --下面代码随便写 有可能抛出异常即可 local result=-1 local startTime=os.time() local mark=tempTable[1] local tempArray=tempTable[2] local dim=tempTable[3] local flag=tempTable[4] local tempX=-1 local tempY=-1 limitTime=tonumber(limitTime) or 5--默认是5秒限制 while(true) do if (os.time()- startTime)>limitTime then --traceprint("到时间了跳出") result=-1 break end if multiColor(tempArray,dim,flag) == true then tempX=tonumber( tempArray[1][1]) or -1 tempY=tonumber( tempArray[1][2]) or -1 if tempX==-1 or tempY==-1 then error("第一颜色项坐标存在问题") else result=1 intX=tempX intY=tempY break end else end mSleep(100) end if result==1 then traceprint("[循环多点比色] [" .. tostring(mark) .. "] 坐标:" .. tostring(tempX) .. "," ..tostring(tempY)) else traceprint("[循环多点比色] <" .. tostring(mark) .. "> 没找到 ") end return result end, catch{ function (errors) --这里对应函数名要改 traceprint("函数[" .. tostring("waitDdbs") .. "] <" .. tostring(tempTable[1] ) .. "> 错误信息:".. tostring(errors)) end } } end --循环找图 function waitZt(tempTable,limitTime) return try{ function () --下面代码随便写 有可能抛出异常即可 local result=-1 local startTime=os.time() local mark=tempTable[1] local picpath=tempTable[2] local degree=tempTable[3] local x1=tempTable[4] local y1=tempTable[5] local x2=tempTable[6] local y2=tempTable[7] local alpha=tempTable[8] or 0 local tempType=tempTable[9] local tempX=-1 local tempY=-1 limitTime=tonumber(limitTime) or 5--默认是5秒限制 while(true) do if (os.time()- startTime)>limitTime then --traceprint("到时间了跳出") result=-1 break end if tempType==nil then tempX, tempY = findImageInRegionFuzzy(picpath, degree, x1, y1, x2, y2, alpha) else tempX, tempY = findImageInRegionFuzzy(picpath, degree, x1, y1, x2, y2, alpha,tempType) end if tempX>-1 and tempY>-1 then result=1 intX=tempX intY=tempY break else end mSleep(100) end if result==1 then traceprint("[循环找图] [" .. tostring(mark) .. "] 坐标:" .. tostring(tempX) .. "," ..tostring(tempY)) else traceprint("[循环找图] <" .. tostring(mark) .. "> 没找到 ") end return result end, catch{ function (errors) --这里对应函数名要改 traceprint("函数[" .. tostring("waitZt") .. "] <" .. tostring(tempTable[1] ) .. "> 错误信息:".. tostring(errors)) end } } end --等待多点找色消失 function waitDdzsDisappear(tempTable,limitTime) return try{ function () --下面代码随便写 有可能抛出异常即可 local result=-1 local startTime=os.time() local mark=tempTable[1] local color=tempTable[2] local posandcolor=tempTable[3] local degree=tempTable[4] local x1=tempTable[5] local y1=tempTable[6] local x2=tempTable[7] local y2=tempTable[8] local tempX=-1 local tempY=-1 limitTime=tonumber(limitTime) or 5--默认是5秒限制 while(true) do if (os.time()- startTime)>limitTime then break end if type(tempTable[9])=="table" then tempX, tempY = findMultiColorInRegionFuzzy(color, posandcolor, degree, x1, y1, x2, y2,tempTable[9]) else tempX, tempY = findMultiColorInRegionFuzzy(color, posandcolor, degree, x1, y1, x2, y2) end if tempX>-1 and tempY>-1 then else break--找不到了才跳出 end mSleep(100) end if result==1 then traceprint("[等待多点找色消失] <" .. tostring(mark) .. "> 消失失败") else traceprint("[等待多点找色消失] [" .. tostring(mark) .. "] 消失成功 ") end --return result end, catch{ function (errors) --这里对应函数名要改 traceprint("函数[" .. tostring("waitDdzsDisappear") .. "] <" .. tostring(tempTable[1] ) .. "> 错误信息:".. tostring(errors)) end } } end --等待多点比色消失 function waitDdbsDisappear(tempTable,limitTime) return try{ function () --下面代码随便写 有可能抛出异常即可 local result=-1 local startTime=os.time() local mark=tempTable[1] local tempArray=tempTable[2] local dim=tempTable[3] local flag=tempTable[4] local tempX=-1 local tempY=-1 limitTime=tonumber(limitTime) or 5--默认是5秒限制 while(true) do if (os.time()- startTime)>limitTime then break end if multiColor(tempArray,dim,flag) == true then tempX=tonumber( tempArray[1][1]) or -1 tempY=tonumber( tempArray[1][2]) or -1 if tempX==-1 or tempY==-1 then error("第一颜色项坐标存在问题") else result=1 end else result=-1 break end mSleep(100) end if result==1 then traceprint("[等待多点比色消失] <" .. tostring(mark) .. "> 消失失败") else traceprint("[等待多点比色消失] [" .. tostring(mark) .. "] 消失成功 ") end --return result end, catch{ function (errors) --这里对应函数名要改 traceprint("函数[" .. tostring("waitDdbsDisappear") .. "] <" .. tostring(tempTable[1] ) .. "> 错误信息:".. tostring(errors)) end } } end --等待找图消失 function waitZtDisappear(tempTable,limitTime) return try{ function () --下面代码随便写 有可能抛出异常即可 local result=-1 local startTime=os.time() local mark=tempTable[1] local picpath=tempTable[2] local degree=tempTable[3] local x1=tempTable[4] local y1=tempTable[5] local x2=tempTable[6] local y2=tempTable[7] local alpha=tempTable[8] or 0 local tempType=tempTable[9] local tempX=-1 local tempY=-1 limitTime=tonumber(limitTime) or 5--默认是5秒限制 while(true) do if (os.time()- startTime)>limitTime then result=-1 break end if tempType==nil then tempX, tempY = findImageInRegionFuzzy(picpath, degree, x1, y1, x2, y2, alpha) else tempX, tempY = findImageInRegionFuzzy(picpath, degree, x1, y1, x2, y2, alpha,tempType) end if tempX>-1 and tempY>-1 then result=1 else result=-1 break end mSleep(100) end if result==1 then traceprint("[等待找图消失] <" .. tostring(mark) .. "> 消失失败") else traceprint("[等待找图消失] [" .. tostring(mark) .. "] 消失成功 ") end --return result end, catch{ function (errors) --这里对应函数名要改 traceprint("函数[" .. tostring("waitZtDisappear") .. "] <" .. tostring(tempTable[1] ) .. "> 错误信息:".. tostring(errors)) end } } end
零基础小白学触动 - 08 - 如何写更智能的找色点击脚本
小知识:可以直接连接手机ip+端口 直接在手机上写代码
?
但是不推荐这个方式 不成熟 没有意义
本节课没什么 老师演示了下 一个用多点找色 实现找箱子的实例
知识点:关于lua下的错误处理机制(感谢紫猫插件的源码提供的错误处理函数) 这4个函数构建了整个错误处理机制 让脚本函数出错不至于脚本崩溃 并且可以日志报错 之后我们所有函数都要类似下面的test11的结构 闭包形式 和try catch 形式
function traceprint(str) local info = debug.getinfo(2) nLog("[" .. tostring(info["source"]) .. "]" .. "第" .. tostring(info["currentline"]) .. "行 " .. tostring(str)) --nLog("[" .. string.format("%s:%d:", info["source"]:match(".*\\([^\\]*)")) .. "]" .. "第" .. tostring(info["currentline"]) .. "行 " .. tostring(str)) mSleep(5)--为了nLog的显示顺序的暂时解决办法 end function try(block) local tablejoin = function (...) local result = {} for _, t in ipairs({...}) do if type(t) == "table" then for k, v in pairs(t) do if type(k) == "number" then table.insert(result, v) else result[k] = v end end else table.insert(result, t) end end return result end -- get the try function local try = block[1] assert(try) -- get catch and finally functions local funcs = tablejoin(block[2] or {}, block[3] or {}) -- try to call it local result_error = {} local results = {pcall(try)} if not results[1] then -- run the catch function if funcs and funcs.catch then result_error = {funcs.catch(results[2])} end end -- run the finally function if funcs and funcs.finally then local result_fin = {funcs.finally(table.unpack(results))} if #result_fin > 0 then return table.unpack(result_fin) end end -- ok? if results[1] and #results > 1 then return table.unpack(results, 2, #results) else if #result_error > 0 then return table.unpack(result_error) else return nil end end end function catch(block) -- get the catch block function return {catch = block[1]} end function finally(block) -- get the finally block function return {finally = block[1]} end --出错函数 这种结构就是我们的每个函数的基本结构 因为这样的结构可以保证就算函数出错了 脚本也不会崩溃同时这也是闭包结构 function test11(a) return try{ function () if a==1 then error("error a==1")--抛出异常 else --error("error a~=1") return a end end,--注意这有逗号 --捕获异常 catch{ function (errors) traceprint("test11 发生运行时错误!错误信息:".. tostring(errors)) end } } end --这里必然出错 但是脚本没有崩溃 被错误函数处理完毕了 后面的代码依然正常执行 traceprint(test11(1))--[main.lua]第45行 test11 发生运行时错误!错误信息:[string "main.lua"]:35: error a==1 traceprint("1111111111")--[main.lua]第57行 1111111111
原文地址:https://www.cnblogs.com/zjl8455482/p/11369925.html