require "global";
require "local";
require "Nz_wpe";
--皇宫"DCE7A1","-79|-3|FFFFFF,-66|-3|FFFFFF,-82|4|FFFFFF,-81|6|FFFFFF,-83|8|FFFFFF,-73|8|FFFFFF,-69|3|FFFFFF,-62|8|FFFFFF"
function checkhuanggongwin7()
	intW, intH = GetWindowRect(); --获取窗体的高和宽
	intX = intW - 200;
	intY = 0;
	intMaxX = intW;
	intMaxY = 50;
	intXC = math.random(intW/3,intW/3*2);
	intYC = math.random(intH/3,intH/3*2);
	strFirstClr = "DCE7A1";
	strParamter = "-79|-3|FFFFFF,-66|-3|FFFFFF,-82|4|FFFFFF,-81|6|FFFFFF,-83|8|FFFFFF,-73|8|FFFFFF,-69|3|FFFFFF,-62|8|FFFFFF";
	intResult, intX, intY  = api_findMultiColor(intX, intY, intMaxX, intMaxY, strFirstClr, strParamter);
--	WriteLog( 'X3:', intX, 'Y:', intY, 'Result:', intResult );
	if intResult == 1 then
		--WriteLog( 'X:', intX, 'Y:', intY, 'Result:', intResult );
		sendMouseClick(intXC , intYC ); --发送点击事件
		return	true;
	else

		return	false;
	end
end
--api_StopApp();




while   api_checkThread(88)  do
	if not checkhuanggongwin7() then
		sgdl();
	end
	api_LuaSleep(500);
end

--api_RunApp();
