|
@@ -34,6 +34,33 @@ 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;
|
|
|
+ //// 打开世界地图;
|
|
|
+ GAssist::SendKey(hWnd, VK_TAB); Sleep(500 + rand() % 200);
|
|
|
+ if (!GAssist::GetImgMatchtemplate(hWnd, GAssist::g_strAppdir + _T("img\\寻路窗口.bmp"), rc))
|
|
|
+ return FALSE;
|
|
|
+
|
|
|
+ //// 单击寻路窗口;
|
|
|
+ GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2 + rand() % 2, (rc.top + rc.bottom) / 2 + rand() % 2)); Sleep(500 + rand() % 200);
|
|
|
+ //// 设置剪切板:职业大挑战;
|
|
|
+ GAssist::SetClipboardString(lpszNPC); Sleep(200 + rand() % 200);
|
|
|
+ //// Ctrl+V
|
|
|
+ GAssist::SendKey(hWnd, 0x56, TRUE); Sleep(300 + rand() % 200);
|
|
|
+ // 先移动到目标后,才能实现单击;
|
|
|
+ GAssist::MouseMove(hWnd, CPoint((rc.right + rc.left) / 2 + 5 + rand() % 2, (rc.top + rc.bottom) / 2 + 60 + rand() % 2)); Sleep(200 + rand() % 100);
|
|
|
+ //// 寻路窗口往下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::SendKey(hWnd, VK_TAB); Sleep(200 + rand() % 50);
|
|
|
+
|
|
|
+ // 问题:返回TRUE并不表示到寻路到NPC;
|
|
|
+ // 是否成功寻路到NPC要对NPC人物进向模板匹配或与NPC对话框模板匹配
|
|
|
+
|
|
|
+ return TRUE;
|
|
|
+}
|
|
|
+
|
|
|
// 用于应用程序“关于”菜单项的 CAboutDlg 对话框
|
|
|
|
|
|
class CAboutDlg : public CDialog
|
|
@@ -395,7 +422,7 @@ void CGameAssistDlg::OnBnClickedButton2()
|
|
|
}
|
|
|
|
|
|
|
|
|
-void CGameAssistDlg::OnBnClickedButton3()
|
|
|
+void CGameAssistDlg::OnBnClickedButton3() // 镜妖;
|
|
|
{
|
|
|
// 获取进程句柄;
|
|
|
DWORD dwPid = GAssist::GetProcessId();
|
|
@@ -519,7 +546,7 @@ void CGameAssistDlg::OnBnClickedButton3()
|
|
|
}
|
|
|
|
|
|
|
|
|
-void CGameAssistDlg::OnBnClickedButton4()
|
|
|
+void CGameAssistDlg::OnBnClickedButton4() // 周六领礼物
|
|
|
{
|
|
|
// TODO: 在此添加控件通知处理程序代码
|
|
|
}
|
|
@@ -547,7 +574,7 @@ void CGameAssistDlg::OnBnClickedButton5() //
|
|
|
GAssist::MouseClick(hProcessMainWnd, CPoint((rc.right + rc.left) / 2 + rand() % 3, (rc.top + rc.bottom) / 2 + rand() % 5));
|
|
|
Sleep(600 + rand() % 30);
|
|
|
// 再移动下,会更高精度;
|
|
|
- // moveto();
|
|
|
+ mouseAssist.MoveTo(rc.top - rand() % 15, rc.left - rand() % 15);
|
|
|
// 判断是否还有对话,如果没有的话表明不是第一次进入;
|
|
|
if (GAssist::GetImgMatchtemplate(hProcessMainWnd, GAssist::g_strAppdir + _T("img\\开宝箱\\开宝箱.bmp"), rc)) {
|
|
|
|
|
@@ -556,7 +583,6 @@ void CGameAssistDlg::OnBnClickedButton5() //
|
|
|
// 然后移动出去;
|
|
|
//GAssist::MouseMove(hProcessMainWnd, CPoint(rc.top - 50 - rand()%20, rc.left - 50 - rand() % 20));
|
|
|
mouseAssist.SetCursorPos(rc.top + rand() % 5, rc.left + rand() % 5);
|
|
|
- //mouseAssist.GetCursorPos();
|
|
|
mouseAssist.MoveToEx(rc.top, rc.left, rc.Width(), rc.Height());
|
|
|
}
|
|
|
}
|
|
@@ -634,7 +660,17 @@ void CGameAssistDlg::OnBnClickedButton6() // 职业
|
|
|
char szName[11][32] = { "医师独侠","术士独侠","道士独侠","武师独侠","浪子独侠","剑客独侠","弓手独侠","禁卫独侠","墨者独侠","巫煞独侠","魂武独侠" };
|
|
|
for (int i = 0; i < 10; i++)
|
|
|
{
|
|
|
- FIND_NPC(hProWnd, szName[i], rc);
|
|
|
+ if (FindNPC(hProWnd, szName[i]))
|
|
|
+ {
|
|
|
+ if (_tcscmp(szName[i], _T("医师独侠")) == 0)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
Sleep(200 + rand()%300);
|
|
|
DebugLog(_T("进入孤独洞2:%s"), szName[i]);
|
|
|
}
|