触摸精灵lua脚本实现微信群加好友功能
                                                            生活随笔
收集整理的這篇文章主要介紹了
                                触摸精灵lua脚本实现微信群加好友功能
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.                        
                                --此腳本針對(duì)iPhone5/5s
--目前只實(shí)現(xiàn)一個(gè)屏幕微信群好友的添加,如果想添加更多好友,
--需要?jiǎng)澠敛僮鳎瑘?zhí)行劃屏操作時(shí)建議循環(huán)滑動(dòng)
function main()  
--獲取屏幕的分辨率
w,h = getScreenResolution();
--輸出屏幕的長(zhǎng)、寬
notifyMessage(string.format("%d,%d
",w,h));
mSleep(500);
-- 運(yùn)行微信
appRun("com.tencent.xin");
--處理第一個(gè)點(diǎn)擊位置
local base_i = w*(1/16);
local base_j = h*(128/1136);
local add_i = w*(15/64);
local index = 0;
local bool = 1;
for j = base_j,2000, h*(190/1136) do
	for i = base_i,w,add_i do
		--[[mSleep(500);
		r,g,b = getColorRGB(i+50,j+50);--取x,y位置色
		mSleep(500);
		if r == 0xff and g == 0xff and b == 0xff then
		bool = 0;
		notifyMessage("結(jié)束條件找到");
		mSleep(2000);
		else
		--notifyMessage("沒(méi)有找到結(jié)束條件");
		--mSleep(2000);
		end;
]]
		mSleep(1000);
		touchDown(0,i+50,j+50);
		mSleep(50);
		touchUp(0);
		mSleep(1000);
		--實(shí)現(xiàn)全屏找圖,添加到通訊錄
		image_x,image_y = findImage("var/mobile/Applications/add.bmp");
		--mSleep(500);
		if image_x ~= -1 and  image_y ~= -1 then
		--notifyMessage("找到圖");
		--添加好有
		touchDown(0,image_x+5,image_y+5);
		mSleep(50);
		touchUp(0);
		mSleep(500);
		touchDown(0,600,50);
		mSleep(50);
		touchUp(0);
		--時(shí)間間隔設(shè)置稍微長(zhǎng)點(diǎn),受網(wǎng)絡(luò)環(huán)境影響
		mSleep(2000);
			--發(fā)送添加好友成功后返回,不用找圖或找色,直接單擊返回按鈕的點(diǎn)效率比較高
			touchDown(0,20,80);
			mSleep(50);
			touchUp(0);
		--如果沒(méi)有找到添加通訊圖圖,則全屏查找發(fā)消息
		else
		--	
		mSleep(1000);
		message_x,message_y = findImage("var/mobile/Applications/message.bmp");
		mSleep(50);
		if message_x ~= -1 and  message_y ~= -1 then
		--notifyMessage("找到圖");
			mSleep(50);
			--notifyMessage("如果是消息直接返回");
			--發(fā)送添加好友成功后返回
			touchDown(0,20,80);
			mSleep(50);
			touchUp(0);
			--添加通訊錄和發(fā)消息都沒(méi)有找到則提示一下信息
		else
			mSleep(500);
			notifyMessage("既沒(méi)有添加通訊錄也沒(méi)有發(fā)送消息");
			end;
			end;
		
			
--[[
		--全屏模糊找色,尋找添加通訊錄按鈕
		x,y = findColorFuzzy(0x00B92F,90);
		if x ~= -1 and y ~= -1 then
		touchDown(3,x,y);
		mSleep(500);
		touchUp(3);
		else
		notifyMessage("沒(méi)有找到");
		mSleep(2000);
		end
		mSleep(2000);
		--添加好友驗(yàn)證消息并尋找發(fā)送按鈕
		send_x,send_y = findColorFuzzy(0x00B92F,85);
		if send_x ~= -1 and send_y ~= -1 then
		touchDown(4,send_x,send_y);
		mSleep(500);
		touchUp(4);
		end
		mSleep(2000);
		x_back,y_back = findColorInRegionFuzzy(0xffffff,95,20,60,80,200);
			if x_back ~= -1 and y_back ~= -1 then
			touchDown(2,x_back,y_back);
			mSleep(200);
			touchUp(2);
			--mSleep(100);
			end
			]]
			mSleep(50);
	end
	base_j = base_j+h*(190/1136);
	mSleep(200);
end
--
end
		
總結(jié)
以上是生活随笔為你收集整理的触摸精灵lua脚本实现微信群加好友功能的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
 
                            
                        - 上一篇: 【图像超分辨率】Remote Sensi
- 下一篇: 【图像超分辨率】End-to-End S
