该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
必备工具:
1.海草同步器 下载地址: http://pan.baidu.com/s/1c0nLwi8
2.修改版 File.lua : http://pan.baidu.com/s/1o69fE1G
按键精灵代码:
//Http获取HTTP请求
Function HttpGet(url)
Dim sTime,rpath,requestPath
sTime = Time()
requestPath = "/mnt/sdcard/sweadsync/"
rpath = requestPath & "request.txt"
File.Write rpath, url
Do
Delay (1000)
If File.Exist(rpath) = False Then
HttpGet = File.Read(requestPath & "response.txt")
Exit Function
End If
Loop While (Time() - sTime) < 30
HttpGet = ""
End Function
//Ftp获取文件
Function FtpGet(remotepath,localpath,user,pass)
Dim sTime,rpath,requestPath
sTime = Time()
requestPath = "/mnt/sdcard/sweadsync/"
rpath = requestPath & "ftpget.txt"
File.Write rpath, remotepath & "," & localpath & "," & user & "," & pass
Do
Delay (1000)
If File.Exist(rpath) = False Then
FtpGet = File.Read(requestPath & "ftpgetResult.txt")
Exit Function
End If
Loop While (Time() - sTime) < 30
FtpGet = ""
End Function
//Ftp上传文件
Function FtpPut(remotepath,localpath,user,pass)
Dim sTime,rpath,requestPath
sTime = Time()
requestPath = "/mnt/sdcard/sweadsync/"
rpath = requestPath & "ftpput.txt"
File.Write rpath, remotepath & "," & localpath & "," & user & "," & pass
Do
Delay (1000)
If File.Exist(rpath) = False Then
FtpPut = File.Read(requestPath & "ftpputResult.txt")
Exit Function
End If
Loop While (Time() - sTime) < 30
FtpPut = ""
End Function
//处理不同分辨率是图片比较必用
Function ImageOpt(src,newsrc,rotate,scale) //本地链接地址,生成后的图片链接,旋转角度,图片放大缩小值
Dim sTime,rpath
sTime = Time()
rpath = requestPath & "imageopt.txt"
Call File.Write(rpath, src & "," & newsrc & "," & rotate & "," & scale)
Do
Delay (1000)
If File.Exist(rpath) = False Then
ImageOpt= newsrc
Exit Function
End If
Loop While (Time() - sTime) < 30
ImageOpt = ""
End Function