Jelajahi Sumber

移动函数

Jeff 4 tahun lalu
induk
melakukan
24174cc60d

+ 505 - 0
GameAssist/GameAssist/CAction.cpp

@@ -1,2 +1,507 @@
 #include "stdafx.h"
 #include "CAction.h"
+
+namespace GameAssist 
+{
+#define SETGAMEFOREGROUND AutoThreadSection ats(&m_ts);\
+if (!::IsWindow(m_hGameWnd)) return;\
+::ShowWindow(m_hGameWnd, SW_SHOWNORMAL);\
+::SetForegroundWindow(m_hGameWnd);
+
+	ThreadSection CAction::m_ts;
+	VOID DebugLog(CHAR* pszStr, ...)
+	{
+		char szData[MAX_PATH] = { 0 };
+		_stprintf_s(szData, _T("%s %s "), _T("[GameAssist] "), CTime::GetCurrentTime().Format(_T("%Y-%m-%d %H:%M:%S")).GetString());
+		int len = strlen(szData);
+		va_list args;
+		va_start(args, pszStr);
+		_vsnprintf_s(szData + len, MAX_PATH - len, MAX_PATH - len, pszStr, args);
+		va_end(args);
+		strcat_s(szData, "\n");
+		OutputDebugStringA(szData);
+	}
+
+	CAction::CAction(HWND hWnd) :m_hGameWnd(hWnd)
+	{
+	}
+
+	CAction::~CAction()
+	{
+	}
+
+	void CAction::MouseMove(POINT pt, bool bSetCurPos)
+	{
+		SETGAMEFOREGROUND;
+		GameAssist::GamePos2Screen(m_hGameWnd, pt);
+		GameAssist::MouseMove(pt);
+	}
+
+	void CAction::MouseClick()
+	{
+		SETGAMEFOREGROUND;
+		GameAssist::MouseClick();
+	}
+
+	void CAction::MouseClick(POINT pt)
+	{
+		SETGAMEFOREGROUND;
+		GameAssist::GamePos2Screen(m_hGameWnd, pt);
+		GameAssist::MouseClick(pt);
+	}
+
+	void CAction::MouseDbClick()
+	{
+		SETGAMEFOREGROUND;
+		GameAssist::MouseDbClick();
+	}
+
+	void CAction::MouseDbClick(POINT pt)
+	{
+		SETGAMEFOREGROUND;
+		GameAssist::GamePos2Screen(m_hGameWnd, pt);
+		GameAssist::MouseDbClick(pt);
+	}
+
+	void CAction::MouseRClick()
+	{
+		SETGAMEFOREGROUND;
+		GameAssist::MouseRClick();
+	}
+
+	void CAction::MouseRClick(POINT pt)
+	{
+		SETGAMEFOREGROUND;
+		GameAssist::GamePos2Screen(m_hGameWnd, pt);
+		GameAssist::MouseRClick(pt);
+	}
+
+	void CAction::MouseDrag(POINT pt)
+	{
+		SETGAMEFOREGROUND;
+		GameAssist::GamePos2Screen(m_hGameWnd, pt);
+		GameAssist::MouseDrag(pt);
+	}
+
+	void CAction::SendKey(DWORD key, BOOL bCtrl, BOOL bAtl, BOOL bShift)
+	{
+		SETGAMEFOREGROUND;
+		GameAssist::SendKey(key, bCtrl, bAtl, bShift);
+	}
+
+	void CAction::SetGameForeground()
+	{
+		AutoThreadSection ats(&m_ts);
+		if (!::IsWindow(m_hGameWnd)) return;
+		::ShowWindow(m_hGameWnd, SW_SHOWNORMAL);
+		::SetForegroundWindow(m_hGameWnd); // 窗口前置才能单击成功;
+	}
+
+	bool CAction::IsWalkStop()
+	{
+		if (!::IsWindow(m_hGameWnd))
+			return false;
+
+		// 将鼠标移走,不要在抠图区域;
+		// 截图,抠指定区域;
+		// 再截图,抠指定区域与上次抠图结果比较;
+		// 比较结果相同,表示停止走路;
+		//POINT pt1 = { 635, 20 }; 
+		//POINT pt2 = { 780, 38 };
+		CRect rc = { 630, 40, 800, 65 };
+		CRect rc2 = { 640, 45, 770, 63 };
+		for (int i = 0; i < 100; i++)
+		{
+			std::string strImg = GameGlobal::BuildImgPath(m_hGameWnd, "walk1");
+			std::string strImg2 = GameGlobal::BuildImgPath(m_hGameWnd, "walk2");
+			ImgAssist::CropPicture(m_hGameWnd, rc, strImg.c_str());
+			Sleep(600);
+			ImgAssist::CropPicture(m_hGameWnd, rc2, strImg2.c_str());
+			// 判断2张图片是否一样;
+			if (ImgAssist::IsSimilarPicture(strImg.c_str(), strImg2.c_str()))
+			{
+				DebugLog(_T("停止走路"));
+				return true;
+			}
+		}
+
+		return false;
+	}
+
+	bool CAction::IsBattle()
+	{
+		CRect rc;
+		SRAND(100, 200);
+		if (ImgAssist::IsMatchIcon(m_hGameWnd, GameGlobal::g_strAppdir + _T("img\\活动\\镜妖\\非战斗中.bmp"), { 630, 25, 805, 45 }, rc)) {
+			DebugLog(_T("Battle:非战斗中"));
+			return false;
+		}
+
+		DebugLog(_T("Battle:战斗中"));
+		return true;
+	}
+
+	CRect CAction::FindMatchIcon(LPCTSTR lpszTemplateImage)
+	{
+		CRect rc;
+		TCHAR szTemplateImage[MAX_PATH] = { 0 };
+		// 先截图;
+		DebugLog(_T("FindMatchIcon=%s"), lpszTemplateImage);
+		ImgAssist::CaptureGameWnd(m_hGameWnd); SRAND(200, 500);
+		_stprintf_s(szTemplateImage, _T("%s%s"), GameGlobal::g_strAppdir.c_str(), lpszTemplateImage);
+		if (ImgAssist::GetImgMatchtemplate(GameGlobal::BuildImgPath(m_hGameWnd, _T("Game")), szTemplateImage, rc)) {
+			// 找到匹配的模块;
+			DebugLog(_T("====> 找到匹配目标:%s"), lpszTemplateImage);
+			return rc;
+		}
+
+		rc.SetRectEmpty();
+		DebugLog(_T("<==== 没找到匹配目标:%s"), lpszTemplateImage);
+		return rc;
+	}
+
+	bool CAction::IsOnMap(LPCTSTR lpszTemplateImage)
+	{
+		CRect rc = FindMatchIcon(lpszTemplateImage);
+		if (rc.IsRectEmpty() || rc.IsRectNull())
+			return false;
+
+		return true;
+	}
+
+	void CAction::WorldMapPositioning(POINT ptMap)
+	{
+		CRect rc;
+		//// 打开世界地图;
+		SendKey(VK_TAB); SRAND(300, 500);
+		// 判断是否打开了地图;
+		if (!ImgAssist::GetImgMatchtemplate(m_hGameWnd, GAssist::g_strAppdir + _T("img\\世界地图.bmp"), rc))
+			return;
+
+		//// 单击寻路窗口;
+		MouseClick(ptMap); SRAND(300, 600);
+		//// 退出世界地址;
+		GameAssist::SendKey(VK_TAB); SRAND(200, 300);
+
+		IsWalkStop();
+	}
+
+	bool CAction::IsWattingAttack(int nAttackNPCType)
+	{
+		CRect rc;
+		BOOL bIsAttack = FALSE;
+		switch (nAttackNPCType)
+		{
+		case 0:
+		{	// 将鼠标移动到指定位置;
+			DebugLog(_T("IsWattingAttack:镜妖中……"));
+			POINT ptDest = { 20, 50 }; // 左上角;
+			MouseMove(ptDest);
+			if (ImgAssist::IsMatchIcon(m_hGameWnd, GameGlobal::g_strAppdir + _T("img\\我方攻击.bmp"), { 0, 50, 60, 115 }, rc)) {
+				DebugLog(_T("IsWattingAttack:我方攻击"));
+				bIsAttack = TRUE;
+			}
+			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;
+			}
+			break;
+		}
+		default:
+			break;
+		}
+
+		return bIsAttack;
+	}
+
+	bool CAction::ClickDlgSetup(LPCSTR lpszTemplateImage)
+	{
+		CRect rc = FindMatchIcon(lpszTemplateImage);
+		if (rc.IsRectEmpty() || rc.IsRectNull())
+			return false;
+
+		// 单击目标;
+		MouseClick(CPoint((rc.right + rc.left) / 2 + rand() % 3, (rc.top + rc.bottom) / 2 + rand() % 3));
+		// 单击后,系统切图可能要的时间会比较长;
+		SRAND(350, 600);
+		// 单击目标后,要往移走鼠标,防止下面匹配的时候被鼠标挡住;
+		MouseMove(CPoint(rc.top - RAND(5, 12), rc.left - RAND(5, 10))); // 移动到左上角;
+		SRAND(300, 500);
+
+		return true;
+	}
+
+	bool CAction::FindNPCByWorldMap(LPCTSTR lpszNPCName)
+	{
+		CRect rc;
+		//// 打开世界地图;
+		SendKey(VK_TAB); SRAND(500, 600);
+		if (!ImgAssist::GetImgMatchtemplate(m_hGameWnd, GameGlobal::g_strAppdir + _T("img\\寻路窗口.bmp"), rc))
+			return false;
+
+		//// 单击寻路窗口;
+		MouseClick( CPoint((rc.right + rc.left) / 2 + rand() % 2, (rc.top + rc.bottom) / 2 + rand() % 2)); SRAND(500, 800);
+		//// 设置剪切板:职业大挑战;
+		GameAssist::SetClipboardString(lpszNPCName); SRAND(200, 500);
+		//// Ctrl+V
+		SendKey(0x56, TRUE); SRAND(300, 500);
+		// 先移动到目标后,才能实现单击;
+		MouseMove(CPoint((rc.right + rc.left) / 2 + 5 + rand() % 2, (rc.top + rc.bottom) / 2 + 60 + rand() % 2)); SRAND(200, 300);
+		//// 寻路窗口往下50就是目标;
+		MouseDbClick(CPoint((rc.right + rc.left) / 2 + 5 + rand() % 2, (rc.top + rc.bottom) / 2 + 60 + rand() % 2)); SRAND(200, 300);
+		//// 退出世界地址;
+		SendKey(VK_TAB); SRAND(200, 300);
+
+		// 直到停止走动为止;
+		IsWalkStop();
+
+		// 遍历3次;
+		bool bFind = false;
+		for (int i = 0; i < 3; i++)
+		{
+			Sleep(600 - i * 150);
+			rc = FindMatchIcon(_T("img\\对话框关闭按钮.bmp"));
+			if (!rc.IsRectEmpty() && !rc.IsRectNull())
+			{
+				bFind = true;
+				break;
+			}
+		}
+
+		return bFind;
+	}
+
+	bool CAction::FindNPCByIcon(POINT ptMap, LPCTSTR lpszNPCName)
+	{
+		TCHAR szNPC[MAX_PATH] = { 0 };
+		_stprintf_s(szNPC, _T("img\\npc\\%s.bmp"), lpszNPCName);
+		CRect rc = FindMatchIcon(szNPC);
+		if (rc.IsRectEmpty() || rc.IsRectNull())
+		{
+			WorldMapPositioning(ptMap);
+			Sleep(600); // 有时走到目标点,NPC还未刷新出来;
+			rc = FindMatchIcon(szNPC);
+			if (rc.IsRectEmpty() || rc.IsRectNull())
+			{
+				// 可能还是未刷新出来,再次等待;
+				Sleep(300);
+				rc = FindMatchIcon(szNPC);
+				if (rc.IsRectEmpty() || rc.IsRectNull())
+				{
+					return false;
+				}
+			}
+		}
+
+		// 找到目标,单击;
+		MouseMove(CPoint(rc.left, rc.top));
+		// 单击:我要挑战他们;
+		MouseClick({ (rc.right + rc.left) / 2, (rc.top + rc.bottom) / 2 });
+		SRAND(900, 1300);// 等对话框出现;
+		// 移动鼠标:不要停留在人物身上;
+		MouseMove({ rc.left - rand() % 10, rc.top - rand() % 10 });
+
+		return true;
+	}
+
+	bool CAction::FindNPCByIconAndPos(LPCTSTR lpszNPCName, POINT ptMap, POINT ptNpc)
+	{
+		TCHAR szNPC[MAX_PATH] = { 0 };
+		_stprintf_s(szNPC, _T("img\\npc\\%s.bmp"), lpszNPCName);
+		CRect rc = FindMatchIcon(szNPC);
+		if (rc.IsRectEmpty() || rc.IsRectNull())
+		{
+			WorldMapPositioning(ptMap);
+			Sleep(600); // 有时走到目标点,NPC还未刷新出来;
+			rc = FindMatchIcon(szNPC);
+			if (rc.IsRectEmpty() || rc.IsRectNull())
+			{
+				// 可能还是未刷新出来,再次等待;
+				Sleep(300);
+				rc = FindMatchIcon(szNPC);
+				if (rc.IsRectEmpty() || rc.IsRectNull())
+				{
+					return false;
+				}
+			}
+		}
+
+		// 找到目标,单击;
+		MouseMove(CPoint(rc.left, rc.top));
+		// 单击:我要挑战他们;
+		MouseClick(ptNpc);
+
+		// 遍历3次;
+		bool bFind = false;
+		for (int i = 0; i < 3; i++)
+		{
+			Sleep(800 - i * 150);
+			CRect rc = FindMatchIcon("img\\对话框关闭按钮.bmp");
+			if (!rc.IsRectEmpty() && !rc.IsRectNull())
+			{
+				bFind = true;
+				break;
+			}
+		}
+
+		// 移动鼠标:不要停留在人物身上;
+		MouseMove({ ptNpc.x - rand() % 10, ptNpc.y - rand() % 10 });
+
+		return bFind;
+	}
+
+	void CAction::BattleJY(BOOL bHasSummoner, int nZJType, BOOL bAggressiveSkill)
+	{
+		BOOL bFirstAttack = TRUE;
+		while (IsBattle()) { // 是否在战斗中;
+			// 是否我方攻击;
+			while (IsWattingAttack(0)) { // Bug:如果被镜妖打死了,无法中断;
+				DebugLog(_T("BattleJY:我方攻击……"));
+				if (bFirstAttack)
+				{
+					SRAND(250, 300);
+					DebugLog(_T("BattleJY:第一次攻击……"));
+					// 根据角色选择技能;
+					SendKey(VK_F1);
+					SRAND(300, 350);
+					if (bAggressiveSkill) // 打镜妖喽罗;
+					{
+						MouseClick(CPoint(290 - 3, 140 - 20));
+						//GAssist::MouseMove(hWnd, CPoint(220 - 5, 180 - 10));// 打主镜妖;
+						SRAND(350, 500);
+					}
+
+					if (bHasSummoner) {
+						CRect rc;
+						// 召唤兽技能;
+						DebugLog(_T("BattleJY:召唤兽技能选择"));
+
+						// 选择重击;
+						if (nZJType) {
+							SRAND(150, 350);
+							SendKey(VK_S, FALSE, TRUE);
+							DebugLog(_T("BattleJY:召唤兽技能选择:%d"), nZJType);
+							if (ImgAssist::GetImgMatchtemplate(m_hGameWnd, nZJType == 1 ? GameGlobal::g_strAppdir + _T("img\\活动\\镜妖\\重击.bmp") : GameGlobal::g_strAppdir + _T("img\\活动\\镜妖\\重击2.bmp"), rc))
+							{
+								SRAND(150, 300);
+								MouseClick(CPoint((rc.right + rc.left) / 2 + rand() % 3, (rc.top + rc.bottom) / 2 + rand() % 3));
+							}
+						}
+
+						SRAND(300, 500);
+						MouseMove(CPoint(290 - 3, 140 - 15));
+						MouseClick(CPoint(290 - 3, 140 - 20));
+					}
+
+					bFirstAttack = FALSE;
+				}
+				else
+				{
+					DebugLog(_T("BattleJY:不是第一次攻击……"));
+					SendKey(VK_A, FALSE, TRUE);
+					SRAND(80, 100);
+					if (bFirstAttack) {
+						SendKey(VK_A, FALSE, TRUE);
+						SRAND(80, 120);
+					}
+				}
+			}
+
+			SRAND(500, 850);
+		}
+
+		// 非战斗中,是否在贫民房中;
+		if (!IsOnMap(_T("img\\地图\\贫民房.bmp"))) {
+			// 找小米;
+			CRect rc;
+			if (!FindNPCByWorldMap("臭美的小米"))
+				return;
+
+			// 选择进入;
+			BOOL bMatch = FALSE;
+			int trySize = 15;
+			// 我要挑战他们;
+			while (!(bMatch = ClickDlgSetup(_T("img\\活动\\镜妖\\1-我帮您抓.bmp")))) {
+				SRAND(800, 1200);
+				if (!trySize--) break;
+			}
+
+			if (bMatch) {
+				MouseMove(CPoint(rc.left, rc.top));
+				// 单击:我要挑战他们;
+				MouseClick(CPoint((rc.right + rc.left) / 2, (rc.top + rc.bottom) / 2));
+				SRAND(1000, 1500);// 等出图;
+
+				// 移动一下;
+				MouseMove(CPoint(rc.left, rc.top));
+				::SetCursorPos(rc.left + rand() % 6, rc.top + rand() % 8);
+
+				// 是否第一次进入地图;
+				if (ClickDlgSetup(_T("img\\活动\\镜妖\\2-我这就去.bmp")))
+				{
+					SRAND(600, 1200);
+					if (ClickDlgSetup(_T("img\\活动\\镜妖\\3-战意镜妖.bmp")))
+					{
+						SRAND(600, 1800);
+						if ((bMatch = ClickDlgSetup(_T("img\\活动\\镜妖\\4-我就选择它.bmp"))))
+						{
+							SRAND(800, 1800);
+						}
+					}
+				}
+			}
+		}
+		else
+		{
+			// 找到镜妖;
+			CRect rc;
+			POINT spt[4] = { { 250, 335 }, { 310,360}, { 385, 315}, { 280,295 } };
+			for (int i = 0; !ImgAssist::GetImgMatchtemplate(m_hGameWnd, GameGlobal::g_strAppdir + _T("img\\活动\\镜妖\\镜妖1.bmp"), rc); i++)
+			{
+				// 打开世界地图;
+				SendKey(VK_TAB); SRAND(200, 300);
+				// 选择坐标点;
+				MouseClick(spt[i % 4]);
+				// 退出世界地图;
+				SendKey(VK_TAB); SRAND(500, 900);
+				// 等待跑完成;
+				//SRAND(600, 800);
+				IsWalkStop();
+
+				if (i > 10) {
+					DebugLog(_T("未找到镜妖+10"));
+					break;
+				}
+			}
+
+			// 找到镜妖;
+			MouseMove(CPoint(rc.left + rand() % 10, rc.top + rand() % 10));
+			DebugLog(_T("移动鼠标"));
+			MouseClick(CPoint((rc.right + rc.left) / 2 + rand() % 3, (rc.top + rc.bottom) / 2 + rand() % 3));
+			SRAND(390, 600);
+			// 单击目标后,要往移走鼠标,防止下面匹配的时候被鼠标挡住;
+			MouseMove(CPoint(rc.right + RAND(10, 20), rc.bottom + RAND(10, 20)));
+			SRAND(300, 500);
+			DebugLog(_T("找到目标并单击成功:%s"));
+
+			// 我来抓你;
+			if (ImgAssist::GetImgMatchtemplate(m_hGameWnd, GameGlobal::g_strAppdir + _T("img\\活动\\镜妖\\我来抓您的.bmp"), rc)) {
+				// 找到匹配的模块;
+				SRAND(200, 300);
+				//GAssist::MouseMove(hWnd, CPoint(rc.left + rand() % 10, rc.top + rand() % 10));
+				DebugLog(_T("我来抓你:移动鼠标"));
+				MouseClick(CPoint((rc.right + rc.left) / 2 + rand() % 3, (rc.top + rc.bottom) / 2 + rand() % 3));
+				SRAND(1000, 1500);
+				DebugLog(_T("我来抓你:找到目标并单击成功:%s"));
+			}
+		}
+	}
+};

+ 94 - 28
GameAssist/GameAssist/CAction.h

@@ -1,32 +1,98 @@
 #pragma once
 
+namespace GameAssist {
 
-typedef struct __GACTION__ {
-	byte			byActionType;			// 动作类型;
-	std::string		strActionName;			// 动作名称;
-	POINT			ptClick;
-	POINT			ptStart;
-	POINT			ptEnd;
-}GAction, *pGAction;
-
-// 单击:POINT
-// 右击:POINT
-// 双击:POINT
-// 移动:POINT、POINT
-// 拖动:POINT、POINT
-// 剪切板:字符串
-// 按键:CTRL/ALT/SHIFT + Key;粘贴CTRL+C:用于寻路NPC查找、物品查找
-// 地图
-// 战斗状态:
-// 健康状态:
-// 查找物品:
-// 查找NPC:
-// 查找宝藏:
-// 查找上古:
-// 查找资源堆:
-// 购买物品:
-
-class CAction
-{
-};
+	typedef struct __GACTION__ {
+		byte			byActionType;			// 动作类型;
+		std::string		strActionName;			// 动作名称;
+		POINT			ptClick;
+		POINT			ptStart;
+		POINT			ptEnd;
+	}GAction, * pGAction;
 
+	typedef struct POINT_NPC
+	{
+		POINT ptMap;	// npc所在地图坐标;
+		POINT ptNpc;	// npc具体坐标;
+	}PNPC, * pPNPC;
+
+	std::map<std::string, POINT> g_mapZYNPC;
+	std::map<std::string, PNPC> g_mapZYNPC2;
+
+	// 单击:POINT
+	// 右击:POINT
+	// 双击:POINT
+	// 移动:POINT、POINT
+	// 拖动:POINT、POINT
+	// 剪切板:字符串
+	// 按键:CTRL/ALT/SHIFT + Key;粘贴CTRL+C:用于寻路NPC查找、物品查找
+	// 地图
+	// 战斗状态:
+	// 健康状态:
+	// 查找物品:
+	// 查找NPC:
+	// 查找宝藏:
+	// 查找上古:
+	// 查找资源堆:
+	// 购买物品:
+
+	class CAction
+	{
+		HWND m_hGameWnd;
+		static ThreadSection m_ts;
+
+	private:
+		// 鼠标移动;
+		void MouseMove(POINT pt, bool bSetCurPos = true);
+		// 鼠标单击;
+		void MouseClick();
+		void MouseClick(POINT pt);
+		// 鼠标双击;
+		void MouseDbClick();
+		void MouseDbClick(POINT pt);
+		// 鼠标右击;
+		void MouseRClick();
+		void MouseRClick(POINT pt);
+		// 鼠标拖动;
+		void MouseDrag(POINT pt);
+
+		// 发送按键;
+		void SendKey(DWORD key, BOOL bCtrl = FALSE, BOOL bAtl = FALSE, BOOL bShift = FALSE);
+
+	public:
+		CAction(HWND hWnd);
+		~CAction();
+
+		// 窗口前置;
+		void SetGameForeground();
+		// 是否停止走路;
+		bool IsWalkStop();
+		// 是否在战斗中;
+		bool IsBattle();
+		// 在游戏窗口中查找匹配的图标;
+		CRect FindMatchIcon(LPCTSTR lpszTemplateImage);
+		// 是否在指定的地图上;
+		bool IsOnMap(LPCTSTR lpszTemplateImage);
+		// 世界地图地位;
+		void WorldMapPositioning(POINT ptMap);
+		// 是否等待攻击中;nAttackNPCType 0=镜妖; 1=职业挑战
+		bool IsWattingAttack(int nAttackNPCType);
+		// 单击游戏对话框里的选项;
+		bool ClickDlgSetup(LPCSTR lpszTemplateImage);
+
+		// 查找NPC:通过世界地图来寻路;
+		bool FindNPCByWorldMap(LPCTSTR lpszNPCName);
+		// 查找NPC:先定位大概位置,再通过图标查找;
+		bool FindNPCByIcon(POINT ptMap, LPCTSTR lpszNPCName);
+		// 查找NPC:定位指定位置后,再相对这个坐标后的位置单击NPC坐标;
+		bool FindNPCByIconAndPos(LPCTSTR lpszNPCName, POINT ptMap, POINT ptNpc);
+
+	public:
+		// 与镜妖战斗;
+		// bHasSummoner是否有召唤兽;
+		// nZJType:重击类型;
+		// bAggressiveSkill:人物攻击技能还是辅助技能;
+		void BattleJY(BOOL bHasSummoner, int nZJType, BOOL bAggressiveSkill);
+	};
+
+};

+ 20 - 20
GameAssist/GameAssist/GameAssist.vcxproj.filters

@@ -21,9 +21,6 @@
     </Filter>
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="Assist.cpp">
-      <Filter>源文件</Filter>
-    </ClCompile>
     <ClCompile Include="GameAssist.cpp">
       <Filter>源文件</Filter>
     </ClCompile>
@@ -39,23 +36,23 @@
     <ClCompile Include="VideoDXGICaptor.cpp">
       <Filter>源文件</Filter>
     </ClCompile>
-    <ClCompile Include="CAction.cpp">
-      <Filter>源文件</Filter>
-    </ClCompile>
-    <ClCompile Include="CTask.cpp">
-      <Filter>源文件</Filter>
-    </ClCompile>
     <ClCompile Include="MouseAssist.cpp">
       <Filter>Assist</Filter>
     </ClCompile>
     <ClCompile Include="DXGICaptor.cpp">
       <Filter>源文件</Filter>
     </ClCompile>
+    <ClCompile Include="Assist.cpp">
+      <Filter>Assist</Filter>
+    </ClCompile>
+    <ClCompile Include="CTask.cpp">
+      <Filter>Assist</Filter>
+    </ClCompile>
+    <ClCompile Include="CAction.cpp">
+      <Filter>Assist</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
-    <ClInclude Include="Assist.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
     <ClInclude Include="GameAssist.h">
       <Filter>头文件</Filter>
     </ClInclude>
@@ -77,23 +74,26 @@
     <ClInclude Include="VideoDXGICaptor.h">
       <Filter>头文件</Filter>
     </ClInclude>
-    <ClInclude Include="CAction.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
-    <ClInclude Include="CTask.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
     <ClInclude Include="MouseAssist.h">
       <Filter>Assist</Filter>
     </ClInclude>
     <ClInclude Include="DXGICaptor.h">
       <Filter>头文件</Filter>
     </ClInclude>
+    <ClInclude Include="Assist.h">
+      <Filter>Assist</Filter>
+    </ClInclude>
     <ClInclude Include="VirturalKey.h">
-      <Filter>头文件</Filter>
+      <Filter>Assist</Filter>
     </ClInclude>
     <ClInclude Include="CritSection.h">
-      <Filter>头文件</Filter>
+      <Filter>Assist</Filter>
+    </ClInclude>
+    <ClInclude Include="CTask.h">
+      <Filter>Assist</Filter>
+    </ClInclude>
+    <ClInclude Include="CAction.h">
+      <Filter>Assist</Filter>
     </ClInclude>
   </ItemGroup>
   <ItemGroup>

+ 0 - 3
GameAssist/GameAssist/GameAssistDlg.cpp

@@ -12,9 +12,6 @@
 #define new DEBUG_NEW
 #endif
 
-#define RAND(a,b) (rand()%(b-a)+a)
-#define SRAND(a,b) (Sleep(rand()%(b-a)+a))
-
 typedef struct POINT_NPC
 {
 	POINT ptMap;

+ 4 - 1
GameAssist/GameAssist/stdafx.h

@@ -68,6 +68,8 @@
 #endif
 #endif
 
+#define RAND(a,b) (rand()%(b-a)+a)
+#define SRAND(a,b) (Sleep(rand()%(b-a)+a))
 
 #include <vector>
 #include <string>
@@ -75,4 +77,5 @@
 #pragma comment(lib,"Shlwapi.lib") /*需要加上此行才可以正确link,VC6.0*/
 #include <tlhelp32.h>
 #include "VirturalKey.h"
-#include "Assist.h"
+#include "Assist.h"
+#include "CritSection.h"