节奏大师-触动脚本(源码)

-- 720*1280分辨率下抓的色
-- QQ731967569
init("0",1);
require("TSLib");

function 是否游戏中()
	x,y = findMultiColorInRegionFuzzy( 0xff5d21, "0|4|0xa43003,9|3|0x2b2224", 90, 1197, 31, 1231, 56);
	if x > -1 or y > -1 then
		return true;
	else
		return false;
	end
end

function 蓝色()
	x, y = findColorInRegionFuzzy( 0x26d2cf, 90, 60, 597, 1219, 665); 
	if x > -1 or y > -1 then
		nLog("蓝色="..x..','..y)
		tap(x,y);
	end
end

function 比较颜色(x,y,x1,y1)
	while (true) do
		local r,g,b = getColorRGB( x1,  y1); 
		nLog("取到的颜色="..r..','..g..','..b);
		if r < 20 or g < 20 or b < 20 then
			touchMove(0, x, y);
			touchUp(0, x, y);
			nLog("绿色抬起="..x..','..y);
			break;
		end
	end
end

function 四键模式()
	while (true) do
		local 是否游戏中 = 是否游戏中();
		if 是否游戏中 then
			蓝色();
			-- 绿色(长按)
			x, y = findColorInRegionFuzzy( 0x4fa300, 95, 60, 597, 1219, 665); 
			if x > -1 or y > -1 then
				touchDown(0, x, y);
				nLog("绿色按下="..x..','..y);
				if x < 345 then
					nLog('第1个格子');
					比较颜色(x,y,201,  590);
				end
				if x < 640 and x > 345 then
					nLog('第2个格子');
					比较颜色(x,y,495,  590);
				end
				if x < 940 and x > 640 then
					nLog('第3个格子');
					比较颜色(x,y,782,  592);
				end
				if x > 940 then
					nLog('第4个格子');
					比较颜色(x,y,1080,  592);
				end
			end
		end
	end
end

function 五键模式()
	while (true) do
		local 是否游戏中 = 是否游戏中();
		if 是否游戏中 then
			蓝色();
			-- 绿色(长按)
			x, y = findColorInRegionFuzzy( 0x4fa300, 95, 60, 597, 1219, 665); 
			if x > -1 or y > -1 then
				touchDown(0, x, y);
				nLog("绿色按下="..x..','..y);
				if x < 274 then
					nLog('第1个格子');
					比较颜色(x,y,167,  589);
				end
				if x < 518 and x > 274 then
					nLog('第2个格子');
					比较颜色(x,y,399,  590);
				end
				if x < 760 and x > 518 then
					nLog('第3个格子');
					比较颜色(x,y,638,  588);
				end
				if x < 1002 and x > 760 then
					nLog('第4个格子');
					比较颜色(x,y,875,  590);
				end
				if x > 1002 then
					nLog('第5个格子');
					比较颜色(x,y,1109,  590);
				end
			end
		end
	end
end

function 六键模式()
	while (true) do
		local 是否游戏中 = 是否游戏中();
		if 是否游戏中 then
			蓝色();
			-- 绿色(长按)
			x, y = findColorInRegionFuzzy( 0x4fa300, 95, 60, 597, 1219, 665); 
			if x > -1 or y > -1 then
				touchDown(0, x, y);
				nLog("绿色按下="..x..','..y);
				if x < 235 then
					nLog('第1个格子');
					比较颜色(x,y,143,  589);
				end
				if x < 437 and x > 235 then
					nLog('第2个格子');
					比较颜色(x,y,339,  589);
				end
				if x < 638 and x > 437 then
					nLog('第3个格子');
					比较颜色(x,y,537,  589);
				end
				if x < 837 and x > 638 then
					nLog('第4个格子');
					比较颜色(x,y,738,  588);
				end
				if x < 1040 and x > 837 then
					nLog('第5个格子');
					比较颜色(x,y,937,  590);
				end
				if x > 1040 then
					nLog('第6个格子');
					比较颜色(x,y,1132,  590);
				end
			end
		end
	end
end

--四键模式();
--五键模式();
--六键模式();
while (true) do
	x,y = findMultiColorInRegionFuzzy( 0xffffff, "6|1|0xd8c682,11|1|0x588fb4,18|1|0x14376a", 90, 85, 200, 224, 288);
	if x > -1 or y > -1 then
		nLog('4键');
		四键模式();
		break;
	end
	x,y = findMultiColorInRegionFuzzy( 0xffffff, "8|0|0xcaba88,12|0|0xf9686b,16|0|0x7e1d4b", 90, 25, 387, 121, 422);
	if x > -1 or y > -1 then
		nLog('5键');
		五键模式();
		break;
	end
	x,y = findMultiColorInRegionFuzzy( 0xffffff, "6|0|0xcfba8b,9|0|0xe9b251,13|0|0x655b26", 90, 95, 615, 157, 647);
	if x > -1 or y > -1 then
		nLog('6键');
		六键模式();
		break;
	end
end

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值