Wang Jeff 4 vuotta sitten
vanhempi
commit
d7d9c3cfdc
2 muutettua tiedostoa jossa 44 lisäystä ja 8 poistoa
  1. 44 8
      GameAssist/GameAssist/GameAssistDlg.cpp
  2. BIN
      GameAssist/img/jn-jk/gdd/qd.bmp

+ 44 - 8
GameAssist/GameAssist/GameAssistDlg.cpp

@@ -26,14 +26,6 @@ VOID DebugLog(CHAR* pszStr, ...)
 }
 
 
-#define FIND_NPC(hWnd, NPC, rc) \
-GAssist::SetClipboardString(NPC);\
-GAssist::SendKey(hWnd, VK_TAB); Sleep(100+rand()%100);\
-GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2 + rand() % 2, (rc.top + rc.bottom) / 2 + rand() % 2)); Sleep(200+rand()%100);\
-GAssist::SendKey(hWnd, 0x56, TRUE); Sleep(200+rand()%100);\
-GAssist::MouseDbClick(hWnd, CPoint((rc.right + rc.left) / 2 + rand() % 2, (rc.top + rc.bottom) / 2 + rand() % 2)); Sleep(200+rand()%100);\
-GAssist::SendKey(hWnd, VK_TAB);
-
 BOOL FindNPC(HWND hWnd, LPCSTR lpszNPC)
 {
 	CRect rc;
@@ -61,6 +53,28 @@ BOOL FindNPC(HWND hWnd, LPCSTR lpszNPC)
 	return TRUE;
 }
 
+BOOL ClickSetup(HWND hWnd, LPCSTR lpszTemplateImage)
+{
+	CRect rc;
+	TCHAR szTemplateImage[MAX_PATH] = { 0 };
+	// 先截图;
+	GAssist::SaveHwndToBmpFile(hWnd, GAssist::g_strAppdir + _T("Game.bmp"));
+	_stprintf_s(szTemplateImage, _T("%s%s"),GAssist::g_strAppdir.c_str(), lpszTemplateImage);
+	if (GAssist::GetImgMatchtemplate(GAssist::g_strAppdir + _T("Game.bmp"), szTemplateImage, rc)) {
+		// 找到匹配的模块;
+		GAssist::MouseMove(hWnd, CPoint(rc.left + rand() % 10, rc.top + rand() % 10));
+		GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2 + rand() % 3, (rc.top + rc.bottom) / 2 + rand() % 3), TRUE);
+		Sleep(200 + rand() % 50);// 进入孤独洞要时间切换地图;
+		// 单击目标后,要往移走鼠标,防止下面匹配的时候被鼠标挡住;
+		GAssist::MouseMove(hWnd, CPoint(rc.left + 20 + rand() % 10, rc.top + 30 + rand() % 10));
+		Sleep(300 + rand() % 300);// 进入孤独洞要时间切换地图;
+		DebugLog(_T("找到目标并单击成功"));
+		return TRUE;
+	}
+
+	return FALSE;
+}
+
 // 用于应用程序“关于”菜单项的 CAboutDlg 对话框
 
 class CAboutDlg : public CDialog
@@ -664,7 +678,29 @@ void CGameAssistDlg::OnBnClickedButton6() // 职业
 					{
 						if (_tcscmp(szName[i], _T("医师独侠")) == 0)
 						{
+							Sleep(5500 + rand()%300); // 等你走到她面前;
+							if (ClickSetup(hProWnd, "img\\jn-jk\\gdd\\xyy.bmp"))
+							{
+								// 选择技能:缚神诀;
+								if (ClickSetup(hProWnd, "img\\jn-jk\\gdd\\fsj.bmp"))
+								{
+									if (!ClickSetup(hProWnd, "\\img\\jn-jk\\gdd\\qd.bmp"))
+										break;
+									Sleep(200+rand()%30);
+									if (!ClickSetup(hProWnd, "\\img\\jn-jk\\gdd\\qd.bmp"))
+										break;
+									Sleep(100 + rand()%50);
+									// 打6下;
+									for (size_t i = 0; i < 5; i++)
+									{
+										// 缚神诀的快捷键是:F6
+										GAssist::SendKey(hProWnd, VK_F6);
+										Sleep(1600+rand()%300);
+									}
+								}
+							}
 
+							break;
 						}
 						else
 						{

BIN
GameAssist/img/jn-jk/gdd/qd.bmp