Explorar o código

IsWaittingAttack函数修整

Jeff %!s(int64=4) %!d(string=hai) anos
pai
achega
ae8b956ba6
Modificáronse 1 ficheiros con 42 adicións e 5 borrados
  1. 42 5
      GameAssist/GameAssist/GameAssistDlg.cpp

+ 42 - 5
GameAssist/GameAssist/GameAssistDlg.cpp

@@ -119,6 +119,7 @@ BOOL IsBattle(HWND hWnd)
 
 BOOL IsWattingAttack(HWND hWnd)
 {
+#if 0
 	// 先截图
 	BOOL bIsAttack = FALSE;
 	GAssist::SaveHwndToBmpFile(hWnd, GAssist::g_strAppdir + _T("IsWattingAttack.bmp"));
@@ -178,6 +179,22 @@ BOOL IsWattingAttack(HWND hWnd)
 	if (tempImg.data) tempImg.release();
 
 	return bIsAttack;
+#else
+	BOOL bIsAttack = FALSE;
+	// 将鼠标移动到指定位置;
+	POINT ptDest = { 20, 50 }; // 左上角;
+	GAssist::MouseMove(hWnd, ptDest);
+	
+	CRect rc;
+	if (GAssist::IsMatchIcon(hWnd, GAssist::g_strAppdir + _T("img\\我方攻击中.bmp"), { 0, 0, 30, 60 }, rc)) {
+		DebugLog(_T("IsWattingAttack:我方攻击"));
+		return FALSE;
+	}
+
+	DebugLog(_T("IsWattingAttack:非技能选择"));
+
+	return bIsAttack;
+#endif
 }
 
 void BattleOnece(HWND hWnd, BOOL bHasSummoner)
@@ -312,15 +329,16 @@ void BattleJY(HWND hWnd, BOOL bHasSummoner, BOOL bZJ)
 					
 					// 选择重击;
 					if (bZJ) {
-						SRAND(200, 450);
+						SRAND(150, 350);
 						GAssist::SendKey(hWnd, VK_S, FALSE, TRUE);
-						if (GAssist::GetImgMatchtemplate(hWnd, GAssist::g_strAppdir + _T("img\\活动\\镜妖\\重击2.bmp"), rc))
+						if (GAssist::GetImgMatchtemplate(hWnd, GAssist::g_strAppdir + _T("img\\活动\\镜妖\\重击.bmp"), rc))
 						{
+							SRAND(100,300);
 							GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2 + rand() % 3, (rc.top + rc.bottom) / 2 + rand() % 3), TRUE);
 						}
 					}
 
-					SRAND(200, 500);
+					SRAND(300, 500);
 					GAssist::MouseMove(hWnd, CPoint(290 - 3, 140 - 15));
 					GAssist::MouseClick(hWnd, CPoint(290 - 3, 140 - 20));
 				}
@@ -926,7 +944,7 @@ void CGameAssistDlg::OnBnClickedButton2()
 // 		vdx.CaptureImage(pData, len);
 // 		vdx.Deinit();
 // 	}
-#if 1
+#if 0
 	DWORD dwPid = GAssist::GetProcessId();
 	HWND hProWnd = GAssist::GetProMainHwnd(dwPid);
 	// 截图;
@@ -934,7 +952,26 @@ void CGameAssistDlg::OnBnClickedButton2()
 	//strImg = CTime::GetCurrentTime().Format("%Y-%m-%d %H:%M:%S %W-%A");
 	strImg = CTime::GetCurrentTime().Format("%H%M%S-Game.bmp");
 	GAssist::SaveHwndToBmpFile(hProWnd, strImg.GetString());
-#else
+#endif
+
+#if 1
+
+#endif
+	CRect rc;
+	HWND hProWnd = GAssist::GetProcessMainWnd();
+	// POINT spt= { 20, 555 }; // 左下角;
+	POINT spt = { 20, 50 }; // 左上角
+
+		// 选择坐标点;
+		GAssist::MouseMove(hProWnd, spt);
+
+		CString strImg;
+		//strImg = CTime::GetCurrentTime().Format("%Y-%m-%d %H:%M:%S %W-%A");
+		strImg = CTime::GetCurrentTime().Format("%H%M%S-Game.bmp");
+		GAssist::SaveHwndToBmpFile(hProWnd, strImg.GetString());
+
+
+#if 0
 	CRect rc;
 	HWND hProWnd = GAssist::GetProcessMainWnd();
 	POINT spt[4] = { { 250, 335 }, { 310,360}, { 385, 315}, { 280,295 } };