手机触屏坏了点中间横着一段触摸没反应了,所以写了这段代码自己用的。供大家研究吧……
-----------------------------------------------------------------------
-- 本文件为脚本入口文件,请不要删除
-- 该脚本适用于脚本精灵2.0.1及以上版本
-- 脚本从main()开始执行
-- 脚本界面从createUI()开始执行,脚本可以无界面
-----------------------------------------------------------------------
--脚本名称:残屏辅助
--脚本描述:自用辅助
-- 创建脚本界面入口
function createUI()
showLoopSetting(false)
local bar_txt =[[
Anjon制作,残屏辅助用用.
]]
createTextView("bar",bar_txt)
newLine()
createTextView("ld_txt","亮度值")
createEditText("edit_ld",3,EDIT_TYPE_NUMBER)
newLine()
createButton("ld_ok","设置亮度","ld_btn")
newLine()
createTextView("x_t","X轴坐标:")
createEditText("x_edit",270,EDIT_TYPE_NUMBER)
createTextView("aa"," ")
createEditText("x1_edit",270,EDIT_TYPE_NUMBER)
newLine()
createTextView("y_t","Y轴坐标:")
createEditText("y_edit",480,EDIT_TYPE_NUMBER)
createTextView("bb"," ")
createEditText("y1_edit",480,EDIT_TYPE_NUMBER)
newLine()
createRadioBox("box_edit","点击",true)
createRadioBox("box_edit","长按",false)
createRadioBox("box_edit","滑动",false)
createRadioBox("box_edit","百度急救",false)
newLine()
createRadioBox("box_edit","贴吧弹窗",false)
end
-- 脚本执行入口
function main()
local box= tostring(box_edit)
local zb={x=tonumber(x_edit),y=tonumber(y_edit);x1=tonumber(x1_edit),y1=tonumber(y1_edit)}
if box =="点击" then
touchClick(zb.x,zb.y)
touchUp()
elseif box=="长按" then
touchDown(zb.x,zb.y)
sleep(1500)
touchUp()
elseif box=="滑动" then
touchDown(zb.x,zb.y,1)
sleep(200)
touchMove(zb.x1,zb.y1,1)
touchUp()
elseif box=="百度急救" then
touchDown(270,475,1)
touchMove(270,900,1)
touchUp()
elseif box=="贴吧弹窗" then
touchClick(480,450)
touchUp()
end
end
function ld_btn()
local ld= getText(DEFAULT_WINDOW_NAME,"edit_ld")
local file= io.open("/sys/class/leds/lcd-backlight/brightness","w")
file:write(ld)
file:close()
end
--if getScriptElfVersion() < 201 then
--main()
--end
-----------------------------------------------------------------------
-- 本文件为脚本入口文件,请不要删除
-- 该脚本适用于脚本精灵2.0.1及以上版本
-- 脚本从main()开始执行
-- 脚本界面从createUI()开始执行,脚本可以无界面
-----------------------------------------------------------------------
--脚本名称:残屏辅助
--脚本描述:自用辅助
-- 创建脚本界面入口
function createUI()
showLoopSetting(false)
local bar_txt =[[
Anjon制作,残屏辅助用用.
]]
createTextView("bar",bar_txt)
newLine()
createTextView("ld_txt","亮度值")
createEditText("edit_ld",3,EDIT_TYPE_NUMBER)
newLine()
createButton("ld_ok","设置亮度","ld_btn")
newLine()
createTextView("x_t","X轴坐标:")
createEditText("x_edit",270,EDIT_TYPE_NUMBER)
createTextView("aa"," ")
createEditText("x1_edit",270,EDIT_TYPE_NUMBER)
newLine()
createTextView("y_t","Y轴坐标:")
createEditText("y_edit",480,EDIT_TYPE_NUMBER)
createTextView("bb"," ")
createEditText("y1_edit",480,EDIT_TYPE_NUMBER)
newLine()
createRadioBox("box_edit","点击",true)
createRadioBox("box_edit","长按",false)
createRadioBox("box_edit","滑动",false)
createRadioBox("box_edit","百度急救",false)
newLine()
createRadioBox("box_edit","贴吧弹窗",false)
end
-- 脚本执行入口
function main()
local box= tostring(box_edit)
local zb={x=tonumber(x_edit),y=tonumber(y_edit);x1=tonumber(x1_edit),y1=tonumber(y1_edit)}
if box =="点击" then
touchClick(zb.x,zb.y)
touchUp()
elseif box=="长按" then
touchDown(zb.x,zb.y)
sleep(1500)
touchUp()
elseif box=="滑动" then
touchDown(zb.x,zb.y,1)
sleep(200)
touchMove(zb.x1,zb.y1,1)
touchUp()
elseif box=="百度急救" then
touchDown(270,475,1)
touchMove(270,900,1)
touchUp()
elseif box=="贴吧弹窗" then
touchClick(480,450)
touchUp()
end
end
function ld_btn()
local ld= getText(DEFAULT_WINDOW_NAME,"edit_ld")
local file= io.open("/sys/class/leds/lcd-backlight/brightness","w")
file:write(ld)
file:close()
end
--if getScriptElfVersion() < 201 then
--main()
--end










