Evan
Evan - 认证专家

注册于 5年前

回答
310
文章
36
关注者
39

local http = require("socket.http")
img = http.request("http://www.xxx.com/xxx.bmp");
if img then
   local file = io.open("/var/touchelf/xxx.bmp","w")
   file:write(img)
   file:close()
end

这行了吧.还至于骂大街,真有意思

理论上讲哪个版本和系统都支持.如果有问题建议先升级触摸到最新版本,还不行的话说明设备型号,系统版本,越狱软件,触摸版本

直接加载就行. socket = require "socket" 如果报错那就是触摸版本太低了.

提问请将问题描述清楚是什么设备,什么机型,什么系统,触摸版本是多少

function findColorPro(first,color,sim,x1,y1,x2,y2)
    local Arr = {}
    local colorArr = Split(color,",")
    table.insert(Arr,first)
    for k,v in pairs(colorArr) do
        local colorArrs = Split(v,"|")
        for k2,v2 in pairs(colorArrs) do
            table.insert(Arr,tonumber(v2))
        end
    end
    x, y = findMultiColorInRegionFuzzy(Arr,sim,x1,y1,x2,y2)
    if x ~= -1 and y ~= -1 then
        return true
    else
        return false
    end
end
function Split(szFullString, szSeparator)
    local nFindStartIndex = 1
    local nSplitIndex = 1
    local nSplitArray = {}
    while true do
       local nFindLastIndex = string.find(szFullString, szSeparator, nFindStartIndex)
       if not nFindLastIndex then
        nSplitArray[nSplitIndex] = string.sub(szFullString, nFindStartIndex, string.len(szFullString))
        break
       end
       nSplitArray[nSplitIndex] = string.sub(szFullString, nFindStartIndex, nFindLastIndex - 1)
       nFindStartIndex = nFindLastIndex + string.len(szSeparator)
       nSplitIndex = nSplitIndex + 1
    end
    return nSplitArray
end
function main()
    if findColorPro(0x181F85, "29|1|0x00BBFE,103|-4| 0x0B6BBE,65|9|0x150972", 100, 0, 0, 639, 959) then 
        notifyMessage("yes");
    else 
        notifyMessage("no");
    end
end

function find(path)
    return io.popen("find "..path.." -prune");
end
function main()
    file = find("/var/touchelf/scripts/*.lua");
    if file then
        files = file:read("*a");
        file:close();
        logDebug(files); --这里返回的是scripts目录下所有的lua文件,每行一个
    end
end

发布
问题