Jeff преди 4 години
родител
ревизия
3509e44b12
променени са 1 файла, в които са добавени 16 реда и са изтрити 22 реда
  1. 16 22
      GameAssist/GameAssist/GameAssistDlg.cpp

+ 16 - 22
GameAssist/GameAssist/GameAssistDlg.cpp

@@ -580,7 +580,7 @@ void CGameAssistDlg::OnBnClickedButton4()
 }
 
 
-void CGameAssistDlg::OnBnClickedButton5()
+void CGameAssistDlg::OnBnClickedButton5() // 开宝箱;
 {
 	HWND hProcessMainWnd = GAssist::GetProcessMainWnd();
 	if (GAssist::nGameWndType == GAssist::GW_SMALL)
@@ -622,39 +622,33 @@ void CGameAssistDlg::OnBnClickedButton5()
 }
 
 
-void CGameAssistDlg::OnBnClickedButton6()
+void CGameAssistDlg::OnBnClickedButton6() // 职业挑战;
 {
 	CRect rc;
 	HWND hProWnd = GAssist::GetProcessMainWnd();
 	//// 打开世界地图;
-	GAssist::SendKey(hProWnd, VK_TAB); Sleep(300);
-	if (GAssist::GetImgMatchtemplate(hProWnd, GAssist::g_strAppdir + _T("img\\寻路窗口.bmp"), rc)) {
-		//// Click
-		GAssist::MouseClick(hProWnd, CPoint((rc.right + rc.left) / 2 + rand() % 2, (rc.top + rc.bottom) / 2 + rand() % 2)); Sleep(200);
-		//// 设置剪切板:职业大挑战;
-		GAssist::SetClipboardString("职业训导大师"); Sleep(200);
-		//// Ctrl+V
-		GAssist::SendKey(hProWnd, 0x56, TRUE); Sleep(300);
-		//// DbClick
-		GAssist::MouseDbClick(hProWnd, CPoint(CPoint((rc.right + rc.left) / 2 + 5 + rand() % 2, (rc.top + rc.bottom) / 2 + 50 + rand() % 2))); Sleep(200);
-	}
-	else
-	{
+	GAssist::SendKey(hProWnd, VK_TAB); Sleep(500 + rand() % 200);
+	if (!GAssist::GetImgMatchtemplate(hProWnd, GAssist::g_strAppdir + _T("img\\寻路窗口.bmp"), rc))
 		return;
-	}
 
+	//// 单击寻路窗口;
+	GAssist::MouseClick(hProWnd, CPoint((rc.right + rc.left) / 2 + rand() % 2, (rc.top + rc.bottom) / 2 + rand() % 2)); Sleep(500 + rand() % 200);
+	//// 设置剪切板:职业大挑战;
+	GAssist::SetClipboardString("职业训导大师"); Sleep(200 + rand() % 200);
+	//// Ctrl+V
+	GAssist::SendKey(hProWnd, 0x56, TRUE); Sleep(300 + rand() % 200);
+	// 先移动到目标后,才能实现单击;
+	GAssist::MouseMove(hProWnd, CPoint((rc.right + rc.left) / 2 + 5 + rand() % 2, (rc.top + rc.bottom) / 2 + 60 + rand() % 2)); Sleep(200 + rand() % 100);
+	//// 寻路窗口往下50就是目标;
+	GAssist::MouseDbClick(hProWnd, CPoint((rc.right + rc.left) / 2 + 5 + rand() % 2, (rc.top + rc.bottom) / 2 + 60 + rand() % 2)); Sleep(200 + rand() % 100);
 	//// 退出世界地址;
-	GAssist::SendKey(hProWnd, VK_TAB); Sleep(200);
-	FIND_NPC(hProWnd, _T("职业训导大师"));
-
-	// 截图;
-	GAssist::SaveHwndToBmpFile(hProWnd, GAssist::g_strAppdir + _T("Game.bmp"));
+	GAssist::SendKey(hProWnd, VK_TAB); Sleep(200 + rand() % 50);
 
 	// 选择进入;
 	BOOL bMatch = FALSE;
 	int trySize = 20;
 	while (!(bMatch = GAssist::GetImgMatchtemplate(GAssist::g_strAppdir + _T("Game.bmp"), GAssist::g_strAppdir + _T("img\\zyxdds-wytztm.bmp"), rc))) {
-		Sleep(3000);
+		Sleep(3000+rand()%500);
 		// 截图;
 		GAssist::SaveHwndToBmpFile(hProWnd, GAssist::g_strAppdir + _T("Game.bmp"));
 		if (!trySize--) break;