|
@@ -12,6 +12,20 @@
|
|
#define new DEBUG_NEW
|
|
#define new DEBUG_NEW
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+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);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
#define FIND_NPC(hWnd, NPC, rc) \
|
|
#define FIND_NPC(hWnd, NPC, rc) \
|
|
GAssist::SetClipboardString(NPC);\
|
|
GAssist::SetClipboardString(NPC);\
|
|
GAssist::SendKey(hWnd, VK_TAB); Sleep(100+rand()%100);\
|
|
GAssist::SendKey(hWnd, VK_TAB); Sleep(100+rand()%100);\
|
|
@@ -556,6 +570,7 @@ void CGameAssistDlg::OnBnClickedButton5() //
|
|
void CGameAssistDlg::OnBnClickedButton6() // 职业挑战;
|
|
void CGameAssistDlg::OnBnClickedButton6() // 职业挑战;
|
|
{
|
|
{
|
|
CRect rc;
|
|
CRect rc;
|
|
|
|
+ DebugLog(_T("进入孤独洞========="));
|
|
HWND hProWnd = GAssist::GetProcessMainWnd();
|
|
HWND hProWnd = GAssist::GetProcessMainWnd();
|
|
//// 打开世界地图;
|
|
//// 打开世界地图;
|
|
GAssist::SendKey(hProWnd, VK_TAB); Sleep(500 + rand() % 200);
|
|
GAssist::SendKey(hProWnd, VK_TAB); Sleep(500 + rand() % 200);
|
|
@@ -610,14 +625,18 @@ void CGameAssistDlg::OnBnClickedButton6() // 职业
|
|
if ( bMatch ) {
|
|
if ( bMatch ) {
|
|
GAssist::MouseMove(hProWnd, CPoint(rc.left + rand() % 10, rc.top + rand() % 10));
|
|
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::MouseClick(hProWnd, CPoint((rc.right + rc.left) / 2 + rand() % 3, (rc.top + rc.bottom) / 2 + rand() % 3), TRUE);
|
|
-
|
|
|
|
|
|
+ Sleep(1500 + rand()%300);// 进入孤独洞要时间切换地图;
|
|
|
|
+ DebugLog(_T("进入孤独洞1"));
|
|
// 判断是否在孤独洞;
|
|
// 判断是否在孤独洞;
|
|
GAssist::SaveHwndToBmpFile(hProWnd, GAssist::g_strAppdir + _T("Game.bmp"));
|
|
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)) {
|
|
if (GAssist::GetImgMatchtemplate(GAssist::g_strAppdir + _T("Game.bmp"), GAssist::g_strAppdir + _T("img\\gdd\\name.bmp"), rc)) {
|
|
|
|
+ DebugLog(_T("进入孤独洞2"));
|
|
char szName[11][32] = { "医师独侠","术士独侠","道士独侠","武师独侠","浪子独侠","剑客独侠","弓手独侠","禁卫独侠","墨者独侠","巫煞独侠","魂武独侠" };
|
|
char szName[11][32] = { "医师独侠","术士独侠","道士独侠","武师独侠","浪子独侠","剑客独侠","弓手独侠","禁卫独侠","墨者独侠","巫煞独侠","魂武独侠" };
|
|
for (int i = 0; i < 10; i++)
|
|
for (int i = 0; i < 10; i++)
|
|
{
|
|
{
|
|
FIND_NPC(hProWnd, szName[i], rc);
|
|
FIND_NPC(hProWnd, szName[i], rc);
|
|
|
|
+ Sleep(200 + rand()%300);
|
|
|
|
+ DebugLog(_T("进入孤独洞2:%s"), szName[i]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|