- -----------------------------------------------------------------------
- -- 本文件为脚本入口文件,请不要删除
- -- 该脚本适用于脚本精灵2.0.1及以上版本
- -- 脚本从main()开始执行
- -- 脚本界面从createUI()开始执行,脚本可以无界面
- -----------------------------------------------------------------------
- -- 创建脚本界面入口
- function createUI()
- showLoopSetting(false)
- createTextView('plocation', '烈火遮天喊话,魔游游 大神作品');newLine()
- createTextView('myy', 'bbs.moyoyo.com');newLine()
- createTextView('info', '输入喊话内容,多句喊话内容用“=”等号隔开');newLine()
- createEditText('content','',MATCH_PARENT,MATCH_PARENT);newLine()
- createTextView('time','输入喊话间隔时间(秒)');newLine()
- createEditText('inter_time','',MATCH_PARENT,MATCH_PARENT);newLine()
- end
- clarity=90
- local w,h = getResolutionRatio()
- if w==720 and h==1280 then
- a,b=580,560 --输入框
- x,y=580,870 --发送
- else
- toast('暂不支持此分辨率')
- sleep(3000)
- exit();
- end
- function main()
- timespace=inter_time*1000 --时间间隔
- str1={}
- str1=split(content,'=')
- repeat
- for i, v in pairs(str1) do
- touchClick(a,b) -- 喊话框的位置,点击激活
- sleep(500)
- deleteText(100,100)
- sleep(500)
- if i==1 then
- input(v..'-魔游游')
- else
- input(v)
- end
- --输入喊话内容
- sleep(1000)
- inputDone()
- sleep(1000)
- touchClick(x,y)
- --点击发送
- sleep(timespace)
- --喊话间隔时间
- end
- until false
- end
- function split(str, pat)
- local t = {}
- local fpat = '(.-)' .. pat
- local last_end = 1
- local s, e, cap = str:find(fpat, 1)
- while s do
- if s ~= 1 or cap ~= '' then
- table.insert(t,cap)
- end
- last_end = e 1
- s, e, cap = str:find(fpat, last_end)
- end
- if last_end <= #str then
- cap = str:sub(last_end)
- table.insert(t, cap)
- end
- return t
- end
|
|
|