require "global";
require "local";
require "Nz_wpe";
--龙城"DCE7A1","-61|7|FFFFFF,-61|-3|FFFFFF,-63|-3|FFFFFF,-71|0|FFFFFF,-74|1|FFFFFF,-76|-3|FFFFFF,-79|-3|FFFFFF,-83|-1|FFFFFF,-83|7|FFFFFF,-69|7|FFFFFF"
function checklongcheng()
	intW, intH = GetWindowRect(); --获取窗体的高和宽
	intX = intW - 200;
	intY = 0;
	intMaxX = intW;
	intMaxY = 50;
	intXC = math.random(intW/4,intW/4*3);
	intYC = math.random(intH/3,intH/3*2);
	strFirstClr = "DCE7A1";
	strParamter = "-61|7|FFFFFF,-61|-3|FFFFFF,-63|-3|FFFFFF,-71|0|FFFFFF,-74|1|FFFFFF,-76|-3|FFFFFF,-79|-3|FFFFFF,-83|-1|FFFFFF,-83|7|FFFFFF,-69|7|FFFFFF";
	intResult, intX, intY  = api_findMultiColor(intX, intY, intMaxX, intMaxY, strFirstClr, strParamter);
--	WriteLog( 'X3:', intX, 'Y:', intY, 'Result:', intResult );
	if intResult == 1 then
		return	true;
	else
		sendMouseClick(intXC , intYC ); --发送点击事件
		return	false;
	end
end
--api_StopApp();




while   api_checkThread(89)  do
	if  checklongcheng() then
		sgdl();
	end
	api_LuaSleep(300);
end

--api_RunApp();
