Quellcode durchsuchen

修改镜妖流程;

Jeff vor 4 Jahren
Ursprung
Commit
4b18b74269

+ 10 - 0
GameAssist/GameAssist/Assist.cpp

@@ -826,6 +826,8 @@ namespace GAssist
 		::DeleteObject(hBitmap);	 	
 		::DeleteObject(hMemDC); 	
 		::ReleaseDC(hWnd, hDC); 
+
+		Sleep(30);
 	}  
 
 
@@ -987,7 +989,11 @@ namespace GAssist
 		GAssist::SaveHwndToBmpFile(hWnd, g_strAppdir + _T("Game.bmp"));
 		cv::Mat srcImg, tempImg, matchImg;
 		if (!OpenImage(g_strAppdir + _T("Game.bmp"), srcImg) || !OpenImage(strTempImg, tempImg))
+		{
+			if (srcImg.data) srcImg.release();
+			if (tempImg.data) tempImg.release();
 			return FALSE;
+		}
 
 		cv::matchTemplate(srcImg, tempImg, matchImg, cv::TM_CCOEFF_NORMED);
 		// ¹éÒ»»¯µ½0~1
@@ -1022,7 +1028,11 @@ namespace GAssist
 	{
 		cv::Mat srcImg, tempImg, matchImg;
 		if (!OpenImage(strSrcImg, srcImg) || !OpenImage(strTempImg, tempImg))
+		{
+			if (srcImg.data) srcImg.release();
+			if (tempImg.data) tempImg.release();
 			return FALSE;
+		}
 
 		cv::matchTemplate(srcImg, tempImg, matchImg, cv::TM_CCOEFF_NORMED);
 		// ¹éÒ»»¯µ½0~1

+ 69 - 0
GameAssist/GameAssist/Assist.h

@@ -6,6 +6,75 @@
 #include <map>
 #include <string>
 
+
+//定义数据字符0~9
+#define   VK_0         0x30 
+#define   VK_1         0x31 
+#define   VK_2         0x32 
+#define   VK_3         0x33 
+#define   VK_4         0x34 
+#define   VK_5         0x35 
+#define   VK_6         0x36 
+#define   VK_7         0x37 
+#define   VK_8         0x38 
+#define   VK_9         0x39
+
+//定义数据字符A~Z
+#define   VK_A	0x41 
+#define   VK_B	0x42 
+#define   VK_C	0x43 
+#define   VK_D	0x44 
+#define   VK_E	0x45 
+#define   VK_F	0x46 
+#define   VK_G	0x47 
+#define   VK_H	0x48 
+#define   VK_I	0x49 
+#define   VK_J	0x4A 
+#define   VK_K	0x4B 
+#define   VK_L	0x4C 
+#define   VK_M	0x4D 
+#define   VK_N	0x4E 
+#define   VK_O	0x4F 
+#define   VK_P	0x50 
+#define   VK_Q	0x51 
+#define   VK_R	0x52 
+#define   VK_S	0x53 
+#define   VK_T	0x54 
+#define   VK_U	0x55 
+#define   VK_V	0x56 
+#define   VK_W	0x57 
+#define   VK_X	0x58 
+#define   VK_Y	0x59 
+#define   VK_Z	0x5A 
+
+//定义数据字符a~z
+#define   VK_a	0x61 
+#define   VK_b	0x62 
+#define   VK_c	0x63 
+#define   VK_d	0x64 
+#define   VK_e	0x65 
+#define   VK_f	0x66 
+#define   VK_g	0x67 
+#define   VK_h	0x68 
+#define   VK_i	0x69 
+#define   VK_j	0x6A 
+#define   VK_k	0x6B 
+#define   VK_l	0x6C 
+#define   VK_m	0x6D 
+#define   VK_n	0x6E 
+#define   VK_o	0x6F 
+#define   VK_p	0x70 
+#define   VK_q	0x71 
+#define   VK_r	0x72 
+#define   VK_s	0x73 
+#define   VK_t	0x74 
+#define   VK_u	0x75 
+#define   VK_v	0x76 
+#define   VK_w	0x77 
+#define   VK_x	0x78 
+#define   VK_y	0x79 
+#define   VK_z	0x7A 
+
 namespace GAssist
 {
 	enum {

+ 3 - 0
GameAssist/GameAssist/GameAssist.vcxproj

@@ -145,6 +145,9 @@
       <AdditionalLibraryDirectories>..\opencv\lib</AdditionalLibraryDirectories>
       <AdditionalDependencies>opencv_core420d.lib;opencv_imgproc420d.lib;opencv_highgui420d.lib;opencv_ml420d.lib;opencv_video420d.lib;opencv_features2d420d.lib;opencv_calib3d420d.lib;opencv_objdetect420d.lib;opencv_flann420d.lib;opencv_dnn420d.lib;opencv_imgcodecs420d.lib;opencv_photo420d.lib;opencv_stitching420d.lib;opencv_videoio420d.lib;opencv_gapi420d.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
+    <PostBuildEvent>
+      <Command>xcopy $(SolutionDir)img $(OutputPath)img\ /s/y/a</Command>
+    </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <Midl>

+ 271 - 29
GameAssist/GameAssist/GameAssistDlg.cpp

@@ -12,7 +12,8 @@
 #define new DEBUG_NEW
 #endif
 
-#define RAND(a,b) (rand()*(b-a)+a)
+#define RAND(a,b) (rand()%(b-a)+a)
+#define SRAND(a,b) (Sleep(rand()%(b-a)+a))
 
 VOID DebugLog(CHAR* pszStr, ...)
 {
@@ -28,31 +29,147 @@ VOID DebugLog(CHAR* pszStr, ...)
 }
 
 
-BOOL FindNPC(HWND hWnd, LPCSTR lpszNPC)
+CRect FindNPC(HWND hWnd, LPCSTR lpszNPC)
 {
 	CRect rc;
 	//// 打开世界地图;
-	GAssist::SendKey(hWnd, VK_TAB); Sleep(500 + rand() % 200);
+	GAssist::SendKey(hWnd, VK_TAB); SRAND(500, 600);
 	if (!GAssist::GetImgMatchtemplate(hWnd, GAssist::g_strAppdir + _T("img\\寻路窗口.bmp"), rc))
-		return FALSE;
+		return rc;
 
 	//// 单击寻路窗口;
-	GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2 + rand() % 2, (rc.top + rc.bottom) / 2 + rand() % 2)); Sleep(500 + rand() % 200);
+	GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2 + rand() % 2, (rc.top + rc.bottom) / 2 + rand() % 2)); SRAND(500, 800);
 	//// 设置剪切板:职业大挑战;
-	GAssist::SetClipboardString(lpszNPC); Sleep(200 + rand() % 200);
+	GAssist::SetClipboardString(lpszNPC); SRAND(200, 500);
 	//// Ctrl+V
-	GAssist::SendKey(hWnd, 0x56, TRUE); Sleep(300 + rand() % 200);
+	GAssist::SendKey(hWnd, 0x56, TRUE); SRAND(300, 500);
 	// 先移动到目标后,才能实现单击;
-	GAssist::MouseMove(hWnd, CPoint((rc.right + rc.left) / 2 + 5 + rand() % 2, (rc.top + rc.bottom) / 2 + 60 + rand() % 2)); Sleep(200 + rand() % 100);
+	GAssist::MouseMove(hWnd, CPoint((rc.right + rc.left) / 2 + 5 + rand() % 2, (rc.top + rc.bottom) / 2 + 60 + rand() % 2)); SRAND(200, 300);
 	//// 寻路窗口往下50就是目标;
-	GAssist::MouseDbClick(hWnd, CPoint((rc.right + rc.left) / 2 + 5 + rand() % 2, (rc.top + rc.bottom) / 2 + 60 + rand() % 2)); Sleep(200 + rand() % 100);
+	GAssist::MouseDbClick(hWnd, CPoint((rc.right + rc.left) / 2 + 5 + rand() % 2, (rc.top + rc.bottom) / 2 + 60 + rand() % 2)); SRAND(200, 300);
 	//// 退出世界地址;
-	GAssist::SendKey(hWnd, VK_TAB); Sleep(200 + rand() % 50);
+	GAssist::SendKey(hWnd, VK_TAB); SRAND(200, 300);
 
 	// 问题:返回TRUE并不表示到寻路到NPC;
 	// 是否成功寻路到NPC要对NPC人物进向模板匹配或与NPC对话框模板匹配
 
-	return TRUE;
+	return rc;
+}
+
+BOOL IsOnMap(HWND hWnd, LPCSTR lpszTemplateImage)
+{
+	CRect rc;
+	TCHAR szTemplateImage[MAX_PATH] = { 0 };
+	::ShowWindow(hWnd, SW_SHOWNORMAL);
+	::SetForegroundWindow(hWnd);
+	// 先截图;
+	DebugLog(_T("IsOnMap=%s"), lpszTemplateImage);
+	GAssist::SaveHwndToBmpFile(hWnd, GAssist::g_strAppdir + _T("Game.bmp")); SRAND(200, 500);
+	_stprintf_s(szTemplateImage, _T("%s%s"), GAssist::g_strAppdir.c_str(), lpszTemplateImage);
+	if (GAssist::GetImgMatchtemplate(GAssist::g_strAppdir + _T("Game.bmp"), szTemplateImage, rc)) {
+		// 找到匹配的模块;
+		DebugLog(_T("在目标地图上:%s"), lpszTemplateImage);
+		return TRUE;
+	}
+
+	DebugLog(_T("不在目标地图上:%s"), lpszTemplateImage);
+	return FALSE;
+}
+
+// 与镜妖战斗;
+void BattleJY(HWND hWnd)
+{
+	if (!IsOnMap(hWnd, _T("img\\地图\\贫民房.bmp"))) {
+		return;
+	}
+
+	CRect rc;
+	POINT spt[4] = { { 175, 280 }, { 225,305 }, { 300, 266 }, { 225,305 } };
+	for( int i =0; !GAssist::GetImgMatchtemplate(hWnd, GAssist::g_strAppdir + _T("img\\活动\\镜妖\\镜妖3.bmp"), rc); i++ )
+	{
+		// 打开世界地图;
+		GAssist::SendKey(hWnd, VK_TAB); SRAND(200, 300);
+		// 选择坐标点;
+		GAssist::MouseClick(hWnd, spt[i % 4]);
+		// 退出世界地图;
+		GAssist::SendKey(hWnd, VK_TAB); SRAND(500, 900);
+
+		if (i > 10) {
+			DebugLog(_T("未找到镜妖+10"));
+			break;
+		}
+	}
+
+	// 找到镜妖;
+	GAssist::MouseMove(hWnd, CPoint(rc.left + rand() % 10, rc.top + rand() % 10));
+	DebugLog(_T("移动鼠标"));
+	GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2 + rand() % 3, (rc.top + rc.bottom) / 2 + rand() % 3), TRUE);
+	SRAND(300, 600);
+	// 单击目标后,要往移走鼠标,防止下面匹配的时候被鼠标挡住;
+	GAssist::MouseMove(hWnd, CPoint(rc.right + RAND(5, 12), rc.bottom + RAND(5, 10)));
+	SRAND(200, 500);
+	DebugLog(_T("找到目标并单击成功:%s"));
+
+	// 我来抓你;
+	if (GAssist::GetImgMatchtemplate(hWnd, GAssist::g_strAppdir + _T("img\\活动\\镜妖\\我来抓您的.bmp"), rc)) {
+		// 找到匹配的模块;
+		GAssist::MouseMove(hWnd, CPoint(rc.left + rand() % 10, rc.top + rand() % 10));
+		DebugLog(_T("我来抓你:移动鼠标"));
+		GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2 + rand() % 3, (rc.top + rc.bottom) / 2 + rand() % 3), TRUE);
+		SRAND(800, 1500);
+		DebugLog(_T("我来抓你:找到目标并单击成功:%s"));
+
+		BOOL bBattle = FALSE;
+		while (GAssist::GetImgMatchtemplate(hWnd, GAssist::g_strAppdir + _T("img\\活动\\镜妖\\战斗中.bmp"), rc))
+		{
+			DebugLog(_T("BattleJY:战斗中"));
+			while (GAssist::GetImgMatchtemplate(hWnd, GAssist::g_strAppdir + _T("img\\活动\\镜妖\\技能选择.bmp"), rc))
+			{
+				DebugLog(_T("BattleJY:技能选择"));
+				if (!bBattle)
+				{
+					// 根据角色选择技能;
+					GAssist::SendKey(hWnd, VK_F1);
+					SRAND(200, 300);
+					// 打镜妖喽罗;
+					GAssist::MouseClick(hWnd, CPoint(290 - 3, 140 - 20));
+					//GAssist::MouseMove(hWnd, CPoint(220 - 5, 180 - 10));// 打主镜妖;
+					SRAND(100,200);
+
+					// 召唤兽技能;
+					if (GAssist::GetImgMatchtemplate(hWnd, GAssist::g_strAppdir + _T("img\\活动\\镜妖\\召唤兽技能选择.bmp"), rc))
+					{
+						SRAND(200, 500);
+						GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2 + rand() % 3, (rc.top + rc.bottom) / 2 + rand() % 3), TRUE);
+						DebugLog(_T("BattleJY:召唤兽技能选择"));
+						
+						// 选择重击;
+						SRAND(300, 800);
+						if (GAssist::GetImgMatchtemplate(hWnd, GAssist::g_strAppdir + _T("img\\活动\\镜妖\\重击.bmp"), rc))
+						{
+							GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2 + rand() % 3, (rc.top + rc.bottom) / 2 + rand() % 3), TRUE);
+						}
+
+						SRAND(200, 500);
+						GAssist::MouseMove(hWnd, CPoint(290 - 3, 140 - 15));
+						GAssist::MouseClick(hWnd, CPoint(290 - 3, 140 - 20));
+					}
+
+					bBattle = TRUE;
+				}
+				else
+				{
+					GAssist::SendKey(hWnd, VK_A, FALSE, TRUE);
+					SRAND(50, 100);
+					GAssist::SendKey(hWnd, VK_A, FALSE, TRUE);
+					SRAND(60, 100);
+				}
+			}
+
+			// 战斗中等待;
+			SRAND(800, 1200);
+		}
+	}
 }
 
 BOOL ClickSetup(HWND hWnd, LPCSTR lpszTemplateImage)
@@ -60,23 +177,27 @@ 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);
+	DebugLog(_T("ClickSetup=%s"), lpszTemplateImage);
+	GAssist::SaveHwndToBmpFile(hWnd, GAssist::g_strAppdir + _T("Game.bmp")); SRAND(200, 500);
+	_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));
+		DebugLog(_T("移动鼠标"));
 		GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2 + rand() % 3, (rc.top + rc.bottom) / 2 + rand() % 3), TRUE);
-		Sleep(200 + rand() % 50);// 进入孤独洞要时间切换地图;
+		SRAND(300, 600);	// 进入孤独洞要时间切换地图;
 		// 单击目标后,要往移走鼠标,防止下面匹配的时候被鼠标挡住;
-		GAssist::MouseMove(hWnd, CPoint(rc.left + 20 + rand() % 10, rc.top + 30 + rand() % 10));
-		Sleep(300 + rand() % 300);// 进入孤独洞要时间切换地图;
-		DebugLog(_T("找到目标并单击成功"));
+		GAssist::MouseMove(hWnd, CPoint(rc.right + RAND(5, 12), rc.bottom + RAND(5, 10)));
+		SRAND(200, 500);	// 进入孤独洞要时间切换地图;
+		DebugLog(_T("找到目标并单击成功:%s"), lpszTemplateImage);
 		return TRUE;
 	}
 
+	DebugLog(_T("没有找到目标:%s"), lpszTemplateImage);
 	return FALSE;
 }
 
+
 // 用于应用程序“关于”菜单项的 CAboutDlg 对话框
 
 class CAboutDlg : public CDialog
@@ -435,11 +556,89 @@ void CGameAssistDlg::OnBnClickedButton2()
 	HWND hProWnd = GAssist::GetProMainHwnd(dwPid);
 	// 截图;
 	GAssist::SaveHwndToBmpFile(hProWnd, "Game.bmp");
+
+// 	GAssist::MouseMove(hProWnd, CPoint(290 - 5, 140 - 20));
+// 
+// 	Sleep(5000);
+// 	GAssist::MouseMove(hProWnd, CPoint(220 - 5, 180 - 10));
 }
 
 
 void CGameAssistDlg::OnBnClickedButton3() // 镜妖;
 {
+	
+#if 1
+	/*
+	-- 是否在星秀村
+	-- 是否在贫民房
+		|-- 否:我帮您抓
+		|-- -- 是否进入过贫民房
+		|		|-- 否:我这就去
+		|		|	|-- 选择:幸运镜妖
+		|		|	|-- 我就选择它
+		|		|-- 是:直接进入贫民房
+		|-- 是:找到镜妖NPC
+		|		|-- 我来抓您的
+		|		|
+		|		|
+		|
+		|
+	*/
+	CRect rc;
+	HWND hProWnd = GAssist::GetProcessMainWnd();
+	if (IsOnMap(hProWnd, _T("img\\地图\\贫民房.bmp")))
+		goto battle;
+
+	rc = FindNPC(hProWnd, "臭美的小米");
+
+	// 选择进入;
+	BOOL bMatch = FALSE;
+	int trySize = 20;
+	// 我要挑战他们;
+	while ( !(bMatch = ClickSetup(hProWnd, _T("img\\活动\\镜妖\\1-我帮您抓.bmp"))) ) {
+		SRAND(800, 1200);
+		if (!trySize--) break;
+	}
+
+	if (bMatch) {
+		GAssist::MouseMove(hProWnd, CPoint(rc.left, rc.top));
+		// 单击:我要挑战他们;
+		GAssist::MouseClick(hProWnd, CPoint((rc.right + rc.left) / 2, (rc.top + rc.bottom) / 2), TRUE);
+		SRAND(1000, 1500);// 等出图;
+
+		// 移动一下;
+		GAssist::MouseMove(hProWnd, CPoint(rc.left, rc.top));
+		::SetCursorPos(rc.left + rand() % 6, rc.top + rand() % 8);
+
+		// 是否第一次进入地图;
+		if ( ClickSetup(hProWnd, _T("img\\活动\\镜妖\\2-我这就去.bmp")))
+		{
+			SRAND(600,1200);
+			if ( ClickSetup(hProWnd, _T("img\\活动\\镜妖\\3-战意镜妖.bmp")))
+			{
+				SRAND(600, 1800);
+				if ((bMatch = ClickSetup(hProWnd, _T("img\\活动\\镜妖\\4-我就选择它.bmp"))))
+				{
+					SRAND(800, 1800);
+				}
+			}
+		}
+	}
+
+battle:
+	if (IsOnMap(hProWnd, _T("img\\地图\\贫民房.bmp"))) {
+		GAssist::MouseMove(hProWnd, CPoint(rc.left + rand() % 10, rc.top + rand() % 10));
+		GAssist::MouseClick(hProWnd, CPoint((rc.right + rc.left) / 2 + rand() % 3, (rc.top + rc.bottom) / 2 + rand() % 3), TRUE);
+		SRAND(1500, 2000);// 进入孤独洞要时间切换地图;
+		DebugLog(_T("进入贫民房"));
+
+		// 找镜妖;
+		for (int i = 0; i < 100; i++)
+		{
+			BattleJY(hProWnd);
+		}
+	}
+#else
 	// 获取进程句柄;
 	DWORD dwPid = GAssist::GetProcessId();
 	HWND hProWnd = GAssist::GetProMainHwnd(dwPid);
@@ -558,6 +757,7 @@ void CGameAssistDlg::OnBnClickedButton3() // 
 
 		}
 	}
+#endif
 
 }
 
@@ -614,6 +814,7 @@ void CGameAssistDlg::OnBnClickedButton6() // 职业
 	CRect rc;
 	DebugLog(_T("进入孤独洞========="));
 	HWND hProWnd = GAssist::GetProcessMainWnd();
+#if 0
 	//// 打开世界地图;
 	GAssist::SendKey(hProWnd, VK_TAB); Sleep(500 + rand() % 200);
 	if (!GAssist::GetImgMatchtemplate(hProWnd, GAssist::g_strAppdir + _T("img\\寻路窗口.bmp"), rc))
@@ -631,16 +832,19 @@ void CGameAssistDlg::OnBnClickedButton6() // 职业
 	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 + rand() % 50);
+#else
+	rc = FindNPC(hProWnd, "职业训导大师");
+#endif
 
 	// 选择进入;
 	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 + rand() % 500);
+		Sleep(RAND(2000, 3000));
 		// 截图;
 		GAssist::SaveHwndToBmpFile(hProWnd, GAssist::g_strAppdir + _T("Game.bmp"));
-		GAssist::MouseMove(hProWnd, CPoint(rc.left + rand()%10, rc.top+rand()%10));
+		GAssist::MouseMove(hProWnd, CPoint(rc.left + rand() % 10, rc.top + rand() % 10));
 		if (!trySize--) break;
 	}
 
@@ -648,11 +852,11 @@ void CGameAssistDlg::OnBnClickedButton6() // 职业
 		GAssist::MouseMove(hProWnd, CPoint(rc.left, rc.top));
 		// 单击:我要挑战他们;
 		GAssist::MouseClick(hProWnd, CPoint((rc.right + rc.left) / 2, (rc.top + rc.bottom) / 2), TRUE);
-		Sleep(2000 + rand()%500 );// 等出图;
+		Sleep(RAND(2000, 2500));// 等出图;
 
 		// 移动一下;
 		GAssist::MouseMove(hProWnd, CPoint(rc.left, rc.top));
-		::SetCursorPos(rc.left + rand()%6, rc.top + rand()%8);
+		::SetCursorPos(rc.left + rand() % 6, rc.top + rand() % 8);
 
 		trySize = 5;
 		bMatch = FALSE;
@@ -660,14 +864,14 @@ void CGameAssistDlg::OnBnClickedButton6() // 职业
 		GAssist::SaveHwndToBmpFile(hProWnd, GAssist::g_strAppdir + _T("Game.bmp"));
 		while (!(bMatch = GAssist::GetImgMatchtemplate(GAssist::g_strAppdir + _T("Game.bmp"), GAssist::g_strAppdir + _T("img\\zyxdds-zbhl.bmp"), rc))) {
 			GAssist::MouseMove(hProWnd, CPoint(rc.left + rand() % 20, rc.top + rand() % 20));
-			Sleep(200 + rand()%200);//等进入地图;
+			Sleep(RAND(200,500));//等进入地图;
 			if (!trySize--) break;
 		}
 
-		if ( bMatch ) {
+		if (bMatch) {
 			GAssist::MouseMove(hProWnd, CPoint(rc.left + rand() % 10, rc.top + rand() % 10));
 			GAssist::MouseClick(hProWnd, CPoint((rc.right + rc.left) / 2 + rand() % 3, (rc.top + rc.bottom) / 2 + rand() % 3), TRUE);
-			Sleep(1500 +  rand()%300);// 进入孤独洞要时间切换地图;
+			Sleep(RAND(1500,2000));// 进入孤独洞要时间切换地图;
 			DebugLog(_T("进入孤独洞1"));
 			// 判断是否在孤独洞;
 			GAssist::SaveHwndToBmpFile(hProWnd, GAssist::g_strAppdir + _T("Game.bmp"));
@@ -680,32 +884,70 @@ void CGameAssistDlg::OnBnClickedButton6() // 职业
 					{
 						if (_tcscmp(szName[i], _T("医师独侠")) == 0)
 						{
-							Sleep(RAND(5500,6300)); // 等你走到她面前(步行、初骑、中骑、高骑,坐骑加速等级有关);
+							Sleep(RAND(5500, 6300)); // 等你走到她面前(步行、初骑、中骑、高骑,坐骑加速等级有关);
 							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") || !ClickSetup(hProWnd, "\\img\\jn-jk\\gdd\\1次确定后退出再进来的对话.bmp"))
+									if (!ClickSetup(hProWnd, "\\img\\jn-jk\\gdd\\qd.bmp"))
 										break;
-									Sleep(RAND(250,300));
+									Sleep(RAND(500, 600));
 									if (!ClickSetup(hProWnd, "\\img\\jn-jk\\gdd\\qd.bmp"))
 										break;
-									Sleep(RAND(100,300));
+									Sleep(RAND(600, 1300));
 									// 打6下;
 									for (size_t i = 0; i < 5; i++)
 									{
 										// 缚神诀的快捷键是:F6
 										GAssist::SendKey(hProWnd, VK_F6);
-										Sleep(RAND(1600,2500));
+										Sleep(RAND(2000, 3500));
 									}
 								}
 							}
+							else 
+							{
+								if (!ClickSetup(hProWnd, "\\img\\jn-jk\\gdd\\qd.bmp"))
+								{
+									Sleep(RAND(600, 1300));
+									if (!ClickSetup(hProWnd, "\\img\\gdd\\废话少说.bmp"))
+									{
+										// 打6下;
+										for (size_t i = 0; i < 5; i++)
+										{
+											// 缚神诀的快捷键是:F6
+											GAssist::SendKey(hProWnd, VK_F6);
+											Sleep(RAND(2000, 3500));
+										}
+									}
+								}
+								else if (!ClickSetup(hProWnd, "\\img\\gdd\\废话少说.bmp"))
+								{
+									Sleep(RAND(600, 1300));
+									// 打6下;
+									for (size_t i = 0; i < 5; i++)
+									{
+										// 缚神诀的快捷键是:F6
+										GAssist::SendKey(hProWnd, VK_F6);
+										Sleep(RAND(2000, 3500));
+									}
+								}
+								else if (GAssist::GetImgMatchtemplate(GAssist::g_strAppdir + _T("Game.bmp"), GAssist::g_strAppdir + _T("img\\gdd\\离开这里.bmp"), rc))
+								{// 右键;
+									GAssist::MouseRClick(hProWnd, CPoint((rc.right + rc.left) / 2, (rc.top + rc.bottom) / 2), TRUE);
+									continue;
+								}
+							}
 
 							break;
 						}
 						else
 						{
+							// 我要挑战 || 我要离开;
+
+							if ( _tcscmp(szName[i], _T("魂武独侠")) == 0 )
+							{
+							}
 
 						}
 					}