Browse Source

使用 ‘自动’ 来做为攻击标志。

Jeff 4 years ago
parent
commit
98e84d2912

+ 4 - 0
GameAssist/GameAssist/Assist.cpp

@@ -1776,6 +1776,7 @@ namespace GameGlobal
 	std::string g_strGameDir;
 	TCHAR g_szGameApp[MAX_PATH];
 	int nGameWndType;
+	int nAttackCount = 0;
 
 	void Init()
 	{
@@ -1806,6 +1807,9 @@ namespace GameGlobal
 			nGameWndType = GW_LARGE;
 		else
 			nGameWndType = GW_FULL;
+
+		// Alt+A´ÎÊý;
+		nAttackCount = GetPrivateProfileInt(_T("SysCfg"), _T("AttackCount"), 120, szValue);
 	}
 
 	std::string BuildImgPath(HWND hWnd, LPCTSTR lpName)

+ 1 - 0
GameAssist/GameAssist/Assist.h

@@ -145,6 +145,7 @@ namespace GameGlobal {
 	extern std::string g_strGameDir;
 	extern TCHAR g_szGameApp[MAX_PATH];
 	extern int nGameWndType;
+	extern int nAttackCount;
 
 	void Init();
 	std::string BuildImgPath(HWND hWnd, LPCTSTR lpName = NULL);

+ 29 - 22
GameAssist/GameAssist/CAction.cpp

@@ -289,30 +289,37 @@ if (!::IsWindow(m_hGameWnd)) return;\
 		BOOL bIsAttack = FALSE;
 		switch (nAttackNPCType)
 		{
-		case 0:
-		{	// 将鼠标移动到指定位置;
-			DebugLog(_T("IsWattingAttack:镜妖中……"));
-			POINT ptDest = { 20, 50 }; // 左上角;
-			MouseMove(ptDest, false);
-			if (ImgAssist::IsMatchIcon(m_hGameWnd, GameGlobal::g_strAppdir + _T("img\\我方攻击.bmp"), { 0, 50, 60, 115 }, rc)) {
-				DebugLog(_T("IsWattingAttack:我方攻击"));
-				bIsAttack = TRUE;
+			case 0:
+			{	// 将鼠标移动到指定位置;
+				DebugLog(_T("IsWattingAttack:镜妖中……"));
+				POINT ptDest = { 20, 50 }; // 左上角;
+				MouseMove(ptDest, false);
+				if (ImgAssist::IsMatchIcon(m_hGameWnd, GameGlobal::g_strAppdir + _T("img\\我方攻击.bmp"), { 0, 50, 60, 115 }, rc)) {
+					DebugLog(_T("IsWattingAttack:我方攻击"));
+					bIsAttack = TRUE;
+				}
+				break;
 			}
-			break;
-		}
-		case 1:
-		{
-			// 将鼠标移动到指定位置;
-			DebugLog(_T("IsWattingAttack:职业挑战中……"));// 要求角色:自定全黑头像;
-			//POINT ptDest = { 625, 28 }; // 左上角;
-			//GAssist::MouseMove(hWnd, ptDest);
-			if (!ImgAssist::IsMatchIcon(m_hGameWnd, GameGlobal::g_strAppdir + _T("img\\战斗中.bmp"), { 600, 25, 655, 80 }, rc)) {
-				DebugLog(_T("IsWattingAttack:我方攻击"));
-				bIsAttack = TRUE;
+			case 1:
+			{
+				// 将鼠标移动到指定位置;
+				DebugLog(_T("IsWattingAttack:职业挑战中……"));// 要求角色:自定全黑头像;
+				//POINT ptDest = { 625, 28 }; // 左上角;
+				//GAssist::MouseMove(hWnd, ptDest);
+				if (!ImgAssist::IsMatchIcon(m_hGameWnd, GameGlobal::g_strAppdir + _T("img\\战斗中.bmp"), { 600, 25, 655, 80 }, rc)) {
+					DebugLog(_T("IsWattingAttack:我方攻击"));
+					bIsAttack = TRUE;
+				}
+				break;
+			}
+			default:
+			{
+				DebugLog(_T("IsWattingAttack:职业挑战中……"));
+				if (ImgAssist::IsMatchIcon(m_hGameWnd, GameGlobal::g_strAppdir + _T("img\\我方攻击2.bmp"), { 720, 85, 806, 120 }, rc)) {
+					DebugLog(_T("IsWattingAttack:我方攻击"));
+					bIsAttack = TRUE;
+				}
 			}
-			break;
-		}
-		default:
 			break;
 		}
 

+ 3 - 3
GameAssist/GameAssist/GameAssistDlg.cpp

@@ -557,15 +557,15 @@ void CGameAssistDlg::OnBnClickedButton12()
 		POINT ptDest = { 625, 28 }; // ×óÉϽÇ;
 		GameAssist::CAction* pAction = (GameAssist::CAction*)pGameInfo->pAction;
 
-		while (true)
+		while (GameGlobal::nAttackCount--)
 		{
 			BOOL bFirst = TRUE;
 			while (pAction->IsBattle())
 			{
 				pAction->MouseMove(ptDest);
-				if (pAction->IsWattingAttack(1))
+				if (pAction->IsWattingAttack(-1))
 				{
-					if (bFirst)
+					if (0)
 					{
 						pAction->SendKey(VK_F1);
 						Sleep(30);

BIN
GameAssist/img/我方攻击2.bmp