LUA脚本(游戏辅助) 点击函数 区域单点多点着色

PS 这个是我自己用来记录的,有兴趣写游戏脚本的朋友请自动搜索 触动精灵官网 ,下载集成开发环境,手机模拟器,以及学习视频,

nLog(‘我的第一个辅助游戏’)

–1.init
init(‘0’,1);–高速程序,当前的游戏是横屏游戏,并且home建在右面

function 点击(x,y)
– body
touchDown(0, x , y)–模拟手指触摸位置 点下
mSleep(20) --停止20ms
touchMove(0, x , y)-- 模拟手指做轻微偏移
mSleep(20)
touchUp(0, x , y) – 模拟手指抬起
end

while (true) do
点击(265, 1427)
mSleep(2000)
end

在一个大范围中 找n个满足条件的点

point = findMultiColorInRegionFuzzyExt(0xf2ae26, "-16|1|0xfefddf,-12|10|0xcf7a14", 90, 209, 1315, 353,1544)

nLog(#point)
for k,v in pairs(ponit) do
	nLog(v.x..','..v.y)
end

区域多点着色以及区域多点着色
while (true) do
–x, y = findColorInRegionFuzzy(0xe0be31, 95,200, 1351, 448, 1540); --区域单点着色
x,y = findMultiColorInRegionFuzzy( 0xf2ae26, “-16|1|0xfefddf,-12|10|0xcf7a14”, 90, 209, 1315, 353,1544) --区域多点着色

if x>-1 or y> -1 then
	nLog(x..','..y)
	点击(x,y)
else
	nLog('很抱歉没有发现这个颜色')
	点击(448, 1540)
end
mSleep(2000)

end

发布了49 篇原创文章 · 获赞 3 · 访问量 5611

猜你喜欢

转载自blog.csdn.net/nb_zsy/article/details/104275716
今日推荐