function sortByKey(info)
local arr = {}
for k,v in pairs(info) do
table.insert(arr,k)
end
table.sort(arr)
local newArr = {}
for k,v in pairs(arr) do
table.insert(newArr,info[v])
end
return newArr
end
function main()
t={
[28000] = "a",
[178000] = "e",
[666000] = "d",
[288000] = "f",
}
t_new = sortByKey(t)
for k,v in pairs(t_new) do
logDebug(string.format("k:%s,v:%s",k,v))
end
end
设置里的第二项打开了吗
ftp一段时间失效那就检查代码和服务器吧,手册也有查看错误的方法。安全模式估计是插件冲突,这个手机在你那只能你自己排查。https://share.weiyun.com/5QWrJtv
给你个375版本,愿意用这个就自己下载安装吧
你在服务器开放一个http接口然后脚本get或者post这个接口不就可以了
这个只能你自行测试了.加载后不报错应该就可以用
手机上面使用的qrCodeDecode二维码识别库比较弱.除非这个库更新,要不也没什么别的办法
可以使用草料接口识别无法识别的二维码.
需要先把二维码上传到一个可以访问的网址,例如上图是 https://cdn.pilipa.com/uploads/20201027/fbe2079b1dd9dd26292a11c38ac691d0.png
可以使用又拍云或七牛云
然后使用下面的代码识别
function main()
local http = require "socket.http"
local ltn12 = require "ltn12"
local request_body = [[img=https://cdn.pilipa.com/uploads/20201027/fbe2079b1dd9dd26292a11c38ac691d0.png]] -- 这里是POST的数据
local response_body = {}
local res, code, response_headers = http.request{
url = "https://cli.im/apis/up/deqrimg?img", -- 这里是你提交的域名
method = "POST",
headers =
{
["Content-Type"] = "application/x-www-form-urlencoded";
["Content-Length"] = #request_body;
},
source = ltn12.source.string(request_body),
sink = ltn12.sink.table(response_body),
}
logDebug(res)
logDebug(code)
if type(response_body) == "table" then
logDebug(table.concat(response_body))
else
logDebug("Not a table:", type(response_body))
end
end
上图的返回值如下
{"status":1,"info":{"status":1,"info":"","data":["https:\/\/open.weixin.qq.com\/connect\/confirm?uuid=geEzX1fBIWqUAAAAABJRU5ErkJggg=="]}}
如果返回值里面有多余的斜杠 "\"可使用 下面代码替换
string.gsub(table.concat(response_body), '\\', '')
目前缓存还无法二值化
提示错误应该是if xqf >= 1 and xqf <=10 then 这行吧.xqf是字符串,你需要先转换成数字在对比
if tonumber(xqf) >= 1 and tonumber(xqf) <=10 then
无法root没法使用
上官网www.touchelf.com查询注册状态是否正常
要在同一个局域网内
function main()
local http = require("socket.http")
local ltn12 = require "ltn12"
local response_body = {}
local res, code, response_headers = http.request{
url = "http://xxx", -- 这里是你提交的域名
headers =
{
["Cookies"] = "Evan";
},
sink = ltn12.sink.table(response_body),
}
logDebug(response_body)
end
取多点 按数字 0 取色
问 有没有3.X版本能用的中控, 要求不多, 能上传脚本就行