|
@@ -12,12 +12,12 @@
|
|
|
#define new DEBUG_NEW
|
|
|
#endif
|
|
|
|
|
|
-#define FIND_NPC(hWnd, NPC) \
|
|
|
+#define FIND_NPC(hWnd, NPC, rc) \
|
|
|
GAssist::SetClipboardString(NPC);\
|
|
|
-GAssist::SendKey(hWnd, VK_TAB); Sleep(100);\
|
|
|
-GAssist::MouseClick(hWnd, CPoint(600, 100)); Sleep(200);\
|
|
|
-GAssist::SendKey(hWnd, 0x56, TRUE); Sleep(200);\
|
|
|
-GAssist::MouseDbClick(hWnd, CPoint(485, 162)); Sleep(200);\
|
|
|
+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);
|
|
|
|
|
|
// 用于应用程序“关于”菜单项的 CAboutDlg 对话框
|
|
@@ -225,75 +225,6 @@ void CGameAssistDlg::OnBnClickedOpengame()
|
|
|
{
|
|
|
GAssist::SendKey(hProWnd, VK_TAB);
|
|
|
}
|
|
|
-
|
|
|
- if (1)
|
|
|
- {// 小窗口-职业挑战;
|
|
|
- //// 打开世界地图;
|
|
|
- //GAssist::SendKey(hProWnd, VK_TAB);Sleep(300);
|
|
|
- //// Click
|
|
|
- //GAssist::MouseClick(hProWnd, CPoint(600, 100));Sleep(200);
|
|
|
- //// 设置剪切板:职业大挑战;
|
|
|
- //GAssist::SetClipboardString("职业训导大师");Sleep(200);
|
|
|
- //// Ctrl+V
|
|
|
- //GAssist::SendKey(hProWnd, 0x56, TRUE);Sleep(300);
|
|
|
- //// DbClick
|
|
|
- //GAssist::MouseDbClick(hProWnd, CPoint(485, 162));Sleep(200);
|
|
|
- //// 退出世界地址;
|
|
|
- //GAssist::SendKey(hProWnd, VK_TAB);Sleep(200);
|
|
|
- FIND_NPC(hProWnd, _T("职业训导大师"));
|
|
|
-
|
|
|
- // 截图;
|
|
|
- GAssist::SaveHwndToBmpFile(hProWnd, GAssist::g_strAppdir + _T("Game.bmp"));
|
|
|
-
|
|
|
- // 选择进入;
|
|
|
- RECT rc;
|
|
|
- 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);
|
|
|
- // 截图;
|
|
|
- GAssist::SaveHwndToBmpFile(hProWnd, GAssist::g_strAppdir + _T("Game.bmp"));
|
|
|
- if (!trySize--) break;
|
|
|
- }
|
|
|
-
|
|
|
- if (bMatch) {
|
|
|
- TRACE2("坐标 x=%d,y=%d\n", rc.left, rc.top);
|
|
|
- TRACE2("坐标2 x=%d,y=%d\n", (rc.right + rc.left) / 2, (rc.top + rc.bottom) / 2);
|
|
|
- GAssist::MouseMove(hProWnd, CPoint(rc.left, rc.top));
|
|
|
- // 单击:我要挑战他们;
|
|
|
- GAssist::MouseClick(hProWnd, CPoint((rc.right + rc.left) / 2, (rc.top + rc.bottom) / 2), TRUE);
|
|
|
- Sleep(2300);// 等出图;
|
|
|
-
|
|
|
- // 再单击:我准备好了;
|
|
|
- GAssist::SaveHwndToBmpFile(hProWnd, GAssist::g_strAppdir + _T("Game.bmp"));
|
|
|
- if (GAssist::GetImgMatchtemplate(GAssist::g_strAppdir + _T("Game.bmp"), GAssist::g_strAppdir + _T("img\\zyxdds-zbhl.bmp"), rc)) {
|
|
|
- GAssist::MouseMove(hProWnd, CPoint(rc.left, rc.top));
|
|
|
- GAssist::MouseClick(hProWnd, CPoint((rc.right + rc.left) / 2, (rc.top + rc.bottom) / 2), TRUE);
|
|
|
-
|
|
|
- Sleep(1000);//等进入地图;
|
|
|
- if (1) {// 挑战医师;
|
|
|
- // 打开世界地图;
|
|
|
-// GAssist::SendKey(hProWnd, VK_TAB); Sleep(200);
|
|
|
-// // Click
|
|
|
-// GAssist::MouseClick(hProWnd, CPoint(600, 100)); Sleep(200);
|
|
|
-// // 设置剪切板:职业大挑战;
|
|
|
-// GAssist::SetClipboardString("医师独侠"); Sleep(200);
|
|
|
-// // Ctrl+V
|
|
|
-// GAssist::SendKey(hProWnd, 0x56, TRUE); Sleep(200);
|
|
|
-// // DbClick
|
|
|
-// GAssist::MouseDbClick(hProWnd, CPoint(485, 162)); Sleep(200);
|
|
|
-// // 退出世界地址;
|
|
|
-// GAssist::SendKey(hProWnd, VK_TAB); Sleep(200);
|
|
|
- FIND_NPC(hProWnd, _T("医师独侠"));
|
|
|
-
|
|
|
- // 截图;
|
|
|
- GAssist::SaveHwndToBmpFile(hProWnd, GAssist::g_strAppdir + _T("Game.bmp"));
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
//RECT rc = {0,0,500,500};
|
|
|
//HBITMAP hb = GAssist::CopyDC2Bitmap(hProWnd, &rc);
|
|
|
//GAssist::SaveBitmap(hb, "1.bmp");
|
|
@@ -647,45 +578,47 @@ void CGameAssistDlg::OnBnClickedButton6() // 职业
|
|
|
// 选择进入;
|
|
|
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(3000 + rand() % 500);
|
|
|
// 截图;
|
|
|
GAssist::SaveHwndToBmpFile(hProWnd, GAssist::g_strAppdir + _T("Game.bmp"));
|
|
|
+ GAssist::MouseMove(hProWnd, CPoint(rc.left + rand()%10, rc.top+rand()%10));
|
|
|
if (!trySize--) break;
|
|
|
}
|
|
|
|
|
|
if (bMatch) {
|
|
|
- TRACE2("坐标 x=%d,y=%d\n", rc.left, rc.top);
|
|
|
- TRACE2("坐标2 x=%d,y=%d\n", (rc.right + rc.left) / 2, (rc.top + rc.bottom) / 2);
|
|
|
GAssist::MouseMove(hProWnd, CPoint(rc.left, rc.top));
|
|
|
// 单击:我要挑战他们;
|
|
|
GAssist::MouseClick(hProWnd, CPoint((rc.right + rc.left) / 2, (rc.top + rc.bottom) / 2), TRUE);
|
|
|
- Sleep(2300);// 等出图;
|
|
|
+ Sleep(2000 + rand()%500 );// 等出图;
|
|
|
|
|
|
+ // 移动一下;
|
|
|
+ GAssist::MouseMove(hProWnd, CPoint(rc.left, rc.top));
|
|
|
+ ::SetCursorPos(rc.left + rand()%6, rc.top + rand()%8);
|
|
|
+
|
|
|
+ trySize = 5;
|
|
|
+ bMatch = FALSE;
|
|
|
// 再单击:我准备好了;
|
|
|
GAssist::SaveHwndToBmpFile(hProWnd, GAssist::g_strAppdir + _T("Game.bmp"));
|
|
|
- if (GAssist::GetImgMatchtemplate(GAssist::g_strAppdir + _T("Game.bmp"), GAssist::g_strAppdir + _T("img\\zyxdds-zbhl.bmp"), rc)) {
|
|
|
- GAssist::MouseMove(hProWnd, CPoint(rc.left, rc.top));
|
|
|
- GAssist::MouseClick(hProWnd, CPoint((rc.right + rc.left) / 2, (rc.top + rc.bottom) / 2), TRUE);
|
|
|
-
|
|
|
- Sleep(1000);//等进入地图;
|
|
|
- if (1) {// 挑战医师;
|
|
|
- // 打开世界地图;
|
|
|
-// GAssist::SendKey(hProWnd, VK_TAB); Sleep(200);
|
|
|
-// // Click
|
|
|
-// GAssist::MouseClick(hProWnd, CPoint(600, 100)); Sleep(200);
|
|
|
-// // 设置剪切板:职业大挑战;
|
|
|
-// GAssist::SetClipboardString("医师独侠"); Sleep(200);
|
|
|
-// // Ctrl+V
|
|
|
-// GAssist::SendKey(hProWnd, 0x56, TRUE); Sleep(200);
|
|
|
-// // DbClick
|
|
|
-// GAssist::MouseDbClick(hProWnd, CPoint(485, 162)); Sleep(200);
|
|
|
-// // 退出世界地址;
|
|
|
-// GAssist::SendKey(hProWnd, VK_TAB); Sleep(200);
|
|
|
- FIND_NPC(hProWnd, _T("医师独侠"));
|
|
|
-
|
|
|
- // 截图;
|
|
|
- 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);//等进入地图;
|
|
|
+ if (!trySize--) break;
|
|
|
+ }
|
|
|
+
|
|
|
+ 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);
|
|
|
+
|
|
|
+ // 判断是否在孤独洞;
|
|
|
+ GAssist::SaveHwndToBmpFile(hProWnd, GAssist::g_strAppdir + _T("Game.bmp"));
|
|
|
+ if (GAssist::GetImgMatchtemplate(GAssist::g_strAppdir + _T("Game.bmp"), GAssist::g_strAppdir + _T("img\\gdd\\name.bmp"), rc)) {
|
|
|
+ char szName[11][32] = { "医师独侠","术士独侠","道士独侠","武师独侠","浪子独侠","剑客独侠","弓手独侠","禁卫独侠","墨者独侠","巫煞独侠","魂武独侠" };
|
|
|
+ for (int i = 0; i < 10; i++)
|
|
|
+ {
|
|
|
+ FIND_NPC(hProWnd, szName[i], rc);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|