|
@@ -73,6 +73,8 @@ BEGIN_MESSAGE_MAP(CGameAssistDlg, CDialog)
|
|
|
//}}AFX_MSG_MAP
|
|
|
ON_BN_CLICKED(BTN_OPENGAME, &CGameAssistDlg::OnBnClickedOpengame)
|
|
|
ON_BN_CLICKED(IDC_BUTTON2, &CGameAssistDlg::OnBnClickedButton2)
|
|
|
+ ON_BN_CLICKED(IDC_BUTTON3, &CGameAssistDlg::OnBnClickedButton3)
|
|
|
+ ON_BN_CLICKED(IDC_BUTTON4, &CGameAssistDlg::OnBnClickedButton4)
|
|
|
END_MESSAGE_MAP()
|
|
|
|
|
|
|
|
@@ -285,7 +287,7 @@ void CGameAssistDlg::OnBnClickedOpengame()
|
|
|
#endif
|
|
|
|
|
|
// TODO: 在此添加控件通知处理程序代码
|
|
|
- if ( !PathFileExists(GAssist::g_szGamePath) )
|
|
|
+ if ( !PathFileExists(GAssist::g_szGameApp) )
|
|
|
{
|
|
|
MessageBox("游戏程序不存在", "温馨提示");
|
|
|
return;
|
|
@@ -295,7 +297,7 @@ void CGameAssistDlg::OnBnClickedOpengame()
|
|
|
//SetCurrentDirectory(_T("E:\\dhsh\\shdata\\"));
|
|
|
SetCurrentDirectory(_T("D:\\tools\\dhsh\\shdata\\"));
|
|
|
#if 1
|
|
|
- ShellExecute(NULL, "open", GAssist::g_szGamePath, NULL, NULL, SW_SHOWNORMAL);//SW_HIDE无用,因为会自动结;
|
|
|
+ ShellExecute(NULL, "open", GAssist::g_szGameApp, NULL, NULL, SW_SHOWNORMAL);//SW_HIDE无用,因为会自动结;
|
|
|
Sleep(500); // Main.exe设置了陷阱(自己再开启了一个进程,结束上一个进程),需要等5秒;
|
|
|
#else
|
|
|
SHELLEXECUTEINFO stuExecInfo = { 0 };
|
|
@@ -431,3 +433,131 @@ void CGameAssistDlg::OnBnClickedButton2()
|
|
|
// 截图;
|
|
|
GAssist::SaveHwndToBmpFile(hProWnd, "Game.bmp");
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+void CGameAssistDlg::OnBnClickedButton3()
|
|
|
+{
|
|
|
+ // 获取进程句柄;
|
|
|
+ DWORD dwPid = GAssist::FindProcess(_T("Game.exe"));
|
|
|
+ HWND hProWnd = GAssist::GetProMainHwnd(dwPid);
|
|
|
+
|
|
|
+
|
|
|
+ if ( GAssist::nGameWndType == GAssist::GW_SMALL )
|
|
|
+ {
|
|
|
+ //// 地图区域;
|
|
|
+ //CRect rc(469,25,635,65);
|
|
|
+ //// 判断当前地图;
|
|
|
+ //if (GAssist::SaveBitmap(GAssist::CopyDC2Bitmap(hProWnd, rc), GAssist::g_strAppdir + _T("Game.bmp")))
|
|
|
+ //{
|
|
|
+ // if (GAssist::GetImgMatchtemplate(GAssist::g_strAppdir + _T("Game.bmp"), GAssist::g_strAppdir + _T("img\\地图\\应天府.bmp"), rc))
|
|
|
+ // {
|
|
|
+
|
|
|
+ // }
|
|
|
+ // else if (GAssist::GetImgMatchtemplate(GAssist::g_strAppdir + _T("Game.bmp"), GAssist::g_strAppdir + _T("img\\地图\\应天府.bmp"), rc))
|
|
|
+ // {
|
|
|
+
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+
|
|
|
+ CRect rc;
|
|
|
+ FIND_NPC(hProWnd, _T("臭美的小米"));
|
|
|
+ Sleep(3000);
|
|
|
+ // 与小米对话;
|
|
|
+ if (!GAssist::GetImgMatchtemplate(hProWnd, GAssist::g_strAppdir + _T("img\\活动\\镜妖\\1-我帮您抓.bmp"), rc)) {
|
|
|
+ GAssist::MouseClick(hProWnd, CPoint((rc.right + rc.left) / 2, (rc.top + rc.bottom) / 2));
|
|
|
+ Sleep(200);
|
|
|
+ // 判断是否还有对话,如果没有的话表明不是第一次进入;
|
|
|
+ if (GAssist::GetImgMatchtemplate(hProWnd, GAssist::g_strAppdir + _T("img\\活动\\镜妖\\2-我这就去.bmp"), rc)) {
|
|
|
+ GAssist::MouseClick(hProWnd, CPoint((rc.right + rc.left) / 2, (rc.top + rc.bottom) / 2));
|
|
|
+ Sleep(200);
|
|
|
+ // 2次对话;
|
|
|
+ if (GAssist::GetImgMatchtemplate(hProWnd, GAssist::g_strAppdir + _T("img\\活动\\镜妖\\3-幸运镜妖.bmp"), rc)) {
|
|
|
+ GAssist::MouseClick(hProWnd, CPoint((rc.right + rc.left) / 2, (rc.top + rc.bottom) / 2));
|
|
|
+ Sleep(200);
|
|
|
+ // 3次对话;
|
|
|
+ if (GAssist::GetImgMatchtemplate(hProWnd, GAssist::g_strAppdir + _T("img\\活动\\镜妖\\3-我就选择它.bmp"), rc)) {
|
|
|
+ GAssist::MouseClick(hProWnd, CPoint((rc.right + rc.left) / 2, (rc.top + rc.bottom) / 2));
|
|
|
+ Sleep(200);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int i = 0 ; i < 20; i++ )
|
|
|
+ {
|
|
|
+ // 进入贫民房;
|
|
|
+ if (GAssist::GetImgMatchtemplate(hProWnd, GAssist::g_strAppdir + _T("img\\活动\\镜妖\\镜妖1.bmp"), rc)) {
|
|
|
+ GAssist::MouseMove(hProWnd, CPoint((rc.right + rc.left) / 2, (rc.top + rc.bottom) / 2));
|
|
|
+ GAssist::MouseMove(hProWnd, CPoint((rc.right + rc.left) / 2 -1, (rc.top + rc.bottom) / 2 -1));
|
|
|
+ GAssist::MouseMove(hProWnd, CPoint((rc.right + rc.left) / 2, (rc.top + rc.bottom) / 2));
|
|
|
+ Sleep(100);
|
|
|
+ if (GAssist::GetImgMatchtemplate(hProWnd, GAssist::g_strAppdir + _T("img\\活动\\镜妖\\定位镜妖.bmp"), rc)) {
|
|
|
+ GAssist::MouseClick(hProWnd, CPoint((rc.right + rc.left) / 2, (rc.top + rc.bottom) / 2));
|
|
|
+ Sleep(500);
|
|
|
+
|
|
|
+ // 选择我要打你;
|
|
|
+ if (GAssist::GetImgMatchtemplate(hProWnd, GAssist::g_strAppdir + _T("img\\活动\\镜妖\\我来抓您的.bmp"), rc)) {
|
|
|
+ GAssist::MouseClick(hProWnd, CPoint((rc.right + rc.left) / 2, (rc.top + rc.bottom) / 2));
|
|
|
+ Sleep(500);
|
|
|
+
|
|
|
+ // 判断是否在战斗中;
|
|
|
+ while (GAssist::GetImgMatchtemplate(hProWnd, GAssist::g_strAppdir + _T("img\\头像.bmp"), rc)) {
|
|
|
+ if (rc.left > 60)
|
|
|
+ {
|
|
|
+ GAssist::ShowLog(_T("战斗中"));
|
|
|
+ GAssist::SendKey(hProWnd, 0x41, FALSE, TRUE);
|
|
|
+ Sleep(3000);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ GAssist::ShowLog(_T("非战斗"));
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ static int i = 0;
|
|
|
+ if (i == 0)
|
|
|
+ {
|
|
|
+ GAssist::SendKey(hProWnd, VK_TAB); Sleep(500);
|
|
|
+ GAssist::MouseClick(hProWnd, CPoint(225, 305));
|
|
|
+ GAssist::SendKey(hProWnd, VK_TAB); Sleep(100);
|
|
|
+ i++;
|
|
|
+ }
|
|
|
+ else if ( i == 1)
|
|
|
+ {
|
|
|
+ GAssist::SendKey(hProWnd, VK_TAB); Sleep(500);
|
|
|
+ GAssist::MouseClick(hProWnd, CPoint(300, 266));
|
|
|
+ GAssist::SendKey(hProWnd, VK_TAB); Sleep(100);
|
|
|
+ i++;
|
|
|
+ }
|
|
|
+ else if (i == 2)
|
|
|
+ {
|
|
|
+ GAssist::SendKey(hProWnd, VK_TAB); Sleep(500);
|
|
|
+ GAssist::MouseClick(hProWnd, CPoint(175, 280));
|
|
|
+ GAssist::SendKey(hProWnd, VK_TAB); Sleep(100);
|
|
|
+ i = 0;
|
|
|
+ }
|
|
|
+ Sleep(2000);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ else if (GAssist::nGameWndType == GAssist::GW_LARGE)
|
|
|
+ {
|
|
|
+ CRect rc(630, 25, 800, 65);
|
|
|
+ if (GAssist::SaveBitmap(GAssist::CopyDC2Bitmap(hProWnd, rc), GAssist::g_strAppdir + _T("dt.bmp")))
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+void CGameAssistDlg::OnBnClickedButton4()
|
|
|
+{
|
|
|
+ // TODO: 在此添加控件通知处理程序代码
|
|
|
+}
|