新人求助,如何把本地识别的数字保存到数组
lua吧
全部回复
仅看楼主
level 2
bb622553 楼主
::zhuc::
local code
UserInfo[1] = code
code = localOcrText("/var/touchelf/scripts/tessdata", -- 语言包tessdata目录在设备中的路径
"eng", -- 语言类型为中文
164, -- 图片左上角X坐标为100
202, -- 图片左上角Y坐标为100
311, -- 图片右下角X坐标为200
225, -- 图片右下角Y坐标为200
"0123456789"); -- 设置白名单字符串,只识别数字
if tonumber(code) > -1 then
notifyMessage(code)
end
else
goto zhuc
end
UpdateUser()
2015年04月20日 10点04分 1
level 2
bb622553 楼主
mSleep(300)
rotateScreen(90)
code = localOcrText("/var/touchelf/scripts/tessdata", -- 语言包tessdata目录在设备中的路径
"eng", -- 语言类型为中文
98,4 , -- 图片左上角X坐标为100
120,20 , -- 图片右下角X坐标为200
"0123456789"); -- 设置白名单字符串,只识别数字
rotateScreen(0)
if code == "" and code == nil then
goto guaj
else
codea = tonumber(code)
end
if codea >52 and codea < 59 then
click(76,155)
else
goto guaj
end
出现错误 attempt to compare number with nil
2015年04月20日 16点04分 2
level 6
and改成or试试
2015年04月20日 18点04分 3
level 2
bb622553 楼主
不行诶,
2015年04月20日 19点04分 4
level 11
codea为nil吧
2015年04月21日 16点04分 5
1