1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759 |
- // GameAssistDlg.cpp : 实现文件
- //
- #include "stdafx.h"
- #include "GameAssist.h"
- #include "GameAssistDlg.h"
- //#include "VideoDXGICaptor.h"
- #include "MouseAssist.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #endif
- #define RAND(a,b) (rand()%(b-a)+a)
- #define SRAND(a,b) (Sleep(rand()%(b-a)+a))
- BOOL IsWalkStop(HWND hWnd);
- CRect FindMatchIcon(HWND hWnd, LPCSTR lpszTemplateImage);
- void WorldMapPositioning(HWND hWnd, POINT ptMap);
- 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);
- }
- BOOL FindNPC(HWND hWnd, LPCSTR lpszNPC)
- {
- CRect rc;
- //// 打开世界地图;
- GAssist::SendKey(hWnd, VK_TAB); SRAND(500, 600);
- 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)); SRAND(500, 800);
- //// 设置剪切板:职业大挑战;
- GAssist::SetClipboardString(lpszNPC); SRAND(200, 500);
- //// Ctrl+V
- GAssist::SendKey(hWnd, 0x56, TRUE); SRAND(300, 500);
- // 先移动到目标后,才能实现单击;
- GAssist::MouseMove(hWnd, CPoint((rc.right + rc.left) / 2 + 5 + rand() % 2, (rc.top + rc.bottom) / 2 + 60 + rand() % 2)); SRAND(200, 300);
- //// 寻路窗口往下50就是目标;
- GAssist::MouseDbClick(hWnd, CPoint((rc.right + rc.left) / 2 + 5 + rand() % 2, (rc.top + rc.bottom) / 2 + 60 + rand() % 2)); SRAND(200, 300);
- //// 退出世界地址;
- GAssist::SendKey(hWnd, VK_TAB); SRAND(200, 300);
- // 直到停止走动为止;
- IsWalkStop(hWnd);
- // 遍历3次;
- BOOL bFind = FALSE;
- for (int i = 0; i < 3; i++)
- {
- Sleep(600);
- rc = FindMatchIcon(hWnd, "img\\对话框关闭按钮.bmp");
- if (!rc.IsRectEmpty() && !rc.IsRectNull())
- {
- bFind = TRUE;
- break;
- }
- }
- return bFind;
- }
- BOOL FindNPC(HWND hWnd, POINT ptMap, LPCTSTR lpszTemplate)
- {
- WorldMapPositioning(hWnd, ptMap);
- CRect rc = FindMatchIcon(hWnd, lpszTemplate);
- if (rc.IsRectEmpty() || rc.IsRectNull())
- return FALSE;
- // 找到目标,单击;
- GAssist::MouseMove(hWnd, CPoint(rc.left, rc.top));
- // 单击:我要挑战他们;
- GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2, (rc.top + rc.bottom) / 2), TRUE);
- SRAND(900, 1500);// 等对话框出现;
- return TRUE;
- }
- // 单击对话框里的步骤;
- BOOL ClickDlgSetup(HWND hWnd, LPCSTR lpszTemplateImage)
- {
- CRect rc = FindMatchIcon(hWnd, lpszTemplateImage);
- if (rc.IsRectEmpty() || rc.IsRectNull())
- return FALSE;
-
- // 单击目标;
- GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2 + rand() % 3, (rc.top + rc.bottom) / 2 + rand() % 3), TRUE);
- SRAND(200, 300);
- // 单击目标后,要往移走鼠标,防止下面匹配的时候被鼠标挡住;
- GAssist::MouseMove(hWnd, CPoint(rc.top - RAND(5, 12), rc.left - RAND(5, 10))); // 移动到左上角;
- SRAND(300, 500);
- return TRUE;
- }
- CRect FindMatchIcon(HWND hWnd, LPCSTR lpszTemplateImage)
- {
- CRect rc;
- TCHAR szTemplateImage[MAX_PATH] = { 0 };
- ::ShowWindow(hWnd, SW_SHOWNORMAL);
- ::SetForegroundWindow(hWnd);
- // 先截图;
- DebugLog(_T("FindMatchIcon=%s"), lpszTemplateImage);
- GAssist::SaveHwndToBmpFile(hWnd, GAssist::g_strAppdir + _T("Game.bmp")); SRAND(200, 500);
- _stprintf_s(szTemplateImage, _T("%s%s"), GAssist::g_strAppdir.c_str(), lpszTemplateImage);
- if (GAssist::GetImgMatchtemplate(GAssist::g_strAppdir + _T("Game.bmp"), szTemplateImage, rc)) {
- // 找到匹配的模块;
- DebugLog(_T("====> 找到匹配目标:%s"), lpszTemplateImage);
- return rc;
- }
- rc.SetRectEmpty();
- DebugLog(_T("<==== 没找到匹配目标:%s"), lpszTemplateImage);
- return rc;
- }
- BOOL IsOnMap(HWND hWnd, LPCSTR lpszTemplateImage)
- {
- CRect rc = FindMatchIcon(hWnd, lpszTemplateImage);
- if (rc.IsRectEmpty() || rc.IsRectNull())
- return FALSE;
- return TRUE;
- }
- BOOL IsBattle(HWND hWnd)
- {
- CRect rc;
- BOOL bBattle = FALSE;
- SRAND(100, 200);
- if (GAssist::IsMatchIcon(hWnd, GAssist::g_strAppdir + _T("img\\活动\\镜妖\\非战斗中.bmp"), { 630, 25, 805, 45 }, rc)) {
- DebugLog(_T("Battle:非战斗中"));
- return FALSE;
- }
- DebugLog(_T("Battle:战斗中"));
- return TRUE;
- }
- // nAttackNPCType 0=镜妖; 1=职业挑战
- //
- BOOL IsWattingAttack(HWND hWnd, int nAttackNPCType)
- {
- CRect rc;
- BOOL bIsAttack = FALSE;
- switch (nAttackNPCType)
- {
- case 0:
- { // 将鼠标移动到指定位置;
- DebugLog(_T("IsWattingAttack:镜妖中……"));
- POINT ptDest = { 20, 50 }; // 左上角;
- GAssist::MouseMove(hWnd, ptDest);
- if (GAssist::IsMatchIcon(hWnd, GAssist::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 (!GAssist::IsMatchIcon(hWnd, GAssist::g_strAppdir + _T("img\\战斗中.bmp"), { 600, 25, 655, 80 }, rc)) {
- DebugLog(_T("IsWattingAttack:我方攻击"));
- bIsAttack = TRUE;
- }
- break;
- }
- default:
- break;
- }
- return bIsAttack;
- }
- void BattleOnece(HWND hWnd, BOOL bHasSummoner)
- {
- BOOL bBattle = FALSE;
- if (IsBattle(hWnd))
- {
- SRAND(300, 500);
- // 是否我方攻击;
- if (IsWattingAttack(hWnd, 0)) {
- // 人物固定F1
- // 根据角色选择技能;
- GAssist::SendKey(hWnd, VK_F1);
- SRAND(200, 300);
- // 打镜妖喽罗;
- GAssist::MouseClick(hWnd, CPoint(290 - 3, 140 - 20));
- //GAssist::MouseMove(hWnd, CPoint(220 - 5, 180 - 10));// 打主镜妖;
- SRAND(100, 200);
- }
- }
- else
- {
- // 非战斗中,是否在贫民房中;
- if (!IsOnMap(hWnd, _T("img\\地图\\贫民房.bmp")))
- {
- // 找小米;
- CRect rc;
- if (!FindNPC(hWnd, "臭美的小米"))
- return;
- // 选择进入;
- BOOL bMatch = FALSE;
- int trySize = 20;
- // 我要挑战他们;
- while (!(bMatch = ClickDlgSetup(hWnd, _T("img\\活动\\镜妖\\1-我帮您抓.bmp")))) {
- SRAND(800, 1200);
- if (!trySize--) break;
- }
- if (bMatch) {
- GAssist::MouseMove(hWnd, CPoint(rc.left, rc.top));
- // 单击:我要挑战他们;
- GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2, (rc.top + rc.bottom) / 2), TRUE);
- SRAND(1000, 1500);// 等出图;
- // 移动一下;
- GAssist::MouseMove(hWnd, CPoint(rc.left, rc.top));
- ::SetCursorPos(rc.left + rand() % 6, rc.top + rand() % 8);
- // 是否第一次进入地图;
- if (ClickDlgSetup(hWnd, _T("img\\活动\\镜妖\\2-我这就去.bmp")))
- {
- SRAND(600, 1200);
- if (ClickDlgSetup(hWnd, _T("img\\活动\\镜妖\\3-战意镜妖.bmp")))
- {
- SRAND(600, 1800);
- if ((bMatch = ClickDlgSetup(hWnd, _T("img\\活动\\镜妖\\4-我就选择它.bmp"))))
- {
- SRAND(800, 1800);
- }
- }
- }
- }
- }
- else
- {
- // 找到镜妖;
- CRect rc;
- POINT spt[4] = { { 260, 360 }, { 300,390}, { 390, 350}, { 280,300 } };
- for (int i = 0; !GAssist::GetImgMatchtemplate(hWnd, GAssist::g_strAppdir + _T("img\\活动\\镜妖\\镜妖3.bmp"), rc); i++)
- {
- // 打开世界地图;
- GAssist::SendKey(hWnd, VK_TAB); SRAND(200, 300);
- // 选择坐标点;
- GAssist::MouseClick(hWnd, spt[i % 4]);
- // 退出世界地图;
- GAssist::SendKey(hWnd, VK_TAB); SRAND(500, 900);
- if (i > 10) {
- DebugLog(_T("未找到镜妖+10"));
- break;
- }
- }
- // 找到镜妖;
- GAssist::MouseMove(hWnd, CPoint(rc.left + rand() % 10, rc.top + rand() % 10));
- DebugLog(_T("移动鼠标"));
- GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2 + rand() % 3, (rc.top + rc.bottom) / 2 + rand() % 3), TRUE);
- SRAND(300, 600);
- // 单击目标后,要往移走鼠标,防止下面匹配的时候被鼠标挡住;
- GAssist::MouseMove(hWnd, CPoint(rc.right + RAND(5, 12), rc.bottom + RAND(5, 10)));
- SRAND(200, 500);
- DebugLog(_T("找到目标并单击成功:%s"));
- // 我来抓你;
- if (GAssist::GetImgMatchtemplate(hWnd, GAssist::g_strAppdir + _T("img\\活动\\镜妖\\我来抓您的.bmp"), rc)) {
- // 找到匹配的模块;
- GAssist::MouseMove(hWnd, CPoint(rc.left + rand() % 10, rc.top + rand() % 10));
- DebugLog(_T("我来抓你:移动鼠标"));
- GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2 + rand() % 3, (rc.top + rc.bottom) / 2 + rand() % 3), TRUE);
- SRAND(800, 1500);
- DebugLog(_T("我来抓你:找到目标并单击成功:%s"));
- }
- }
- }
- }
- // 与镜妖战斗;
- void BattleJY(HWND hWnd, BOOL bHasSummoner, int nZJType, BOOL bAggressiveSkill)
- {
- BOOL bFirstAttack = TRUE;
- while (IsBattle(hWnd)) { // 是否在战斗中;
- // 是否我方攻击;
- while (IsWattingAttack(hWnd, 0)) { // Bug:如果被镜妖打死了,无法中断;
- DebugLog(_T("BattleJY:我方攻击……"));
- if (bFirstAttack)
- {
- SRAND(250, 300);
- DebugLog(_T("BattleJY:第一次攻击……"));
- // 根据角色选择技能;
- GAssist::SendKey(hWnd, VK_F1);
- SRAND(300, 350);
- if (bAggressiveSkill) // 打镜妖喽罗;
- {
- GAssist::MouseClick(hWnd, 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);
- GAssist::SendKey(hWnd, VK_S, FALSE, TRUE);
- DebugLog(_T("BattleJY:召唤兽技能选择:%d"), nZJType);
- if (GAssist::GetImgMatchtemplate(hWnd, nZJType == 1 ? GAssist::g_strAppdir + _T("img\\活动\\镜妖\\重击.bmp") : GAssist::g_strAppdir + _T("img\\活动\\镜妖\\重击2.bmp"), rc))
- {
- SRAND(150, 300);
- GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2 + rand() % 3, (rc.top + rc.bottom) / 2 + rand() % 3), TRUE);
- }
- }
- SRAND(300, 500);
- GAssist::MouseMove(hWnd, CPoint(290 - 3, 140 - 15));
- GAssist::MouseClick(hWnd, CPoint(290 - 3, 140 - 20));
- }
- bFirstAttack = FALSE;
- }
- else
- {
- DebugLog(_T("BattleJY:不是第一次攻击……"));
- GAssist::SendKey(hWnd, VK_A, FALSE, TRUE);
- SRAND(80, 100);
- if (bFirstAttack) {
- GAssist::SendKey(hWnd, VK_A, FALSE, TRUE);
- SRAND(80, 120);
- }
- }
- }
- SRAND(500, 850);
- }
- // 非战斗中,是否在贫民房中;
- if (!IsOnMap(hWnd, _T("img\\地图\\贫民房.bmp"))) {
- // 找小米;
- CRect rc;
- if (!FindNPC(hWnd, "臭美的小米"))
- return;
- // 选择进入;
- BOOL bMatch = FALSE;
- int trySize = 15;
- // 我要挑战他们;
- while (!(bMatch = ClickDlgSetup(hWnd, _T("img\\活动\\镜妖\\1-我帮您抓.bmp")))) {
- SRAND(800, 1200);
- if (!trySize--) break;
- }
- if (bMatch) {
- GAssist::MouseMove(hWnd, CPoint(rc.left, rc.top));
- // 单击:我要挑战他们;
- GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2, (rc.top + rc.bottom) / 2), TRUE);
- SRAND(1000, 1500);// 等出图;
- // 移动一下;
- GAssist::MouseMove(hWnd, CPoint(rc.left, rc.top));
- ::SetCursorPos(rc.left + rand() % 6, rc.top + rand() % 8);
- // 是否第一次进入地图;
- if (ClickDlgSetup(hWnd, _T("img\\活动\\镜妖\\2-我这就去.bmp")))
- {
- SRAND(600, 1200);
- if (ClickDlgSetup(hWnd, _T("img\\活动\\镜妖\\3-战意镜妖.bmp")))
- {
- SRAND(600, 1800);
- if ((bMatch = ClickDlgSetup(hWnd, _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; !GAssist::GetImgMatchtemplate(hWnd, GAssist::g_strAppdir + _T("img\\活动\\镜妖\\镜妖1.bmp"), rc); i++)
- {
- // 打开世界地图;
- GAssist::SendKey(hWnd, VK_TAB); SRAND(200, 300);
- // 选择坐标点;
- GAssist::MouseClick(hWnd, spt[i % 4]);
- // 退出世界地图;
- GAssist::SendKey(hWnd, VK_TAB); SRAND(500, 900);
- // 等待跑完成;
- //SRAND(600, 800);
- IsWalkStop(hWnd);
- if (i > 10) {
- DebugLog(_T("未找到镜妖+10"));
- break;
- }
- }
- // 找到镜妖;
- GAssist::MouseMove(hWnd, CPoint(rc.left + rand() % 10, rc.top + rand() % 10));
- DebugLog(_T("移动鼠标"));
- GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2 + rand() % 3, (rc.top + rc.bottom) / 2 + rand() % 3), TRUE);
- SRAND(390, 600);
- // 单击目标后,要往移走鼠标,防止下面匹配的时候被鼠标挡住;
- GAssist::MouseMove(hWnd, CPoint(rc.right + RAND(10, 20), rc.bottom + RAND(10, 20)));
- SRAND(300, 500);
- DebugLog(_T("找到目标并单击成功:%s"));
- // 我来抓你;
- if (GAssist::GetImgMatchtemplate(hWnd, GAssist::g_strAppdir + _T("img\\活动\\镜妖\\我来抓您的.bmp"), rc)) {
- // 找到匹配的模块;
- SRAND(200, 300);
- //GAssist::MouseMove(hWnd, CPoint(rc.left + rand() % 10, rc.top + rand() % 10));
- DebugLog(_T("我来抓你:移动鼠标"));
- GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2 + rand() % 3, (rc.top + rc.bottom) / 2 + rand() % 3), TRUE);
- SRAND(1000, 1500);
- DebugLog(_T("我来抓你:找到目标并单击成功:%s"));
- }
- }
- }
- void BattleJY2(HWND hWnd, BOOL bSummoner)
- {
- if (!IsOnMap(hWnd, _T("img\\地图\\贫民房.bmp"))) {
- // 找小米;
- CRect rc;
- if (!FindNPC(hWnd, "臭美的小米"))
- return;
- // 选择进入;
- BOOL bMatch = FALSE;
- int trySize = 20;
- // 我要挑战他们;
- while (!(bMatch = ClickDlgSetup(hWnd, _T("img\\活动\\镜妖\\1-我帮您抓.bmp")))) {
- SRAND(800, 1200);
- if (!trySize--) break;
- }
- if (bMatch) {
- GAssist::MouseMove(hWnd, CPoint(rc.left, rc.top));
- // 单击:我要挑战他们;
- GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2, (rc.top + rc.bottom) / 2), TRUE);
- SRAND(1000, 1500);// 等出图;
- // 移动一下;
- GAssist::MouseMove(hWnd, CPoint(rc.left, rc.top));
- ::SetCursorPos(rc.left + rand() % 6, rc.top + rand() % 8);
- // 是否第一次进入地图;
- if (ClickDlgSetup(hWnd, _T("img\\活动\\镜妖\\2-我这就去.bmp")))
- {
- SRAND(600, 1200);
- if (ClickDlgSetup(hWnd, _T("img\\活动\\镜妖\\3-战意镜妖.bmp")))
- {
- SRAND(600, 1800);
- if ((bMatch = ClickDlgSetup(hWnd, _T("img\\活动\\镜妖\\4-我就选择它.bmp"))))
- {
- SRAND(800, 1800);
- }
- }
- }
- }
- return;
- }
- CRect rc;
- //POINT spt[4] = { { 175, 280 }, { 225,305 }, { 300, 266 }, { 225,305 } };
- POINT spt[4] = { { 260, 360 }, { 300,390}, { 390, 350}, { 280,300 } };
- for (int i = 0; !GAssist::GetImgMatchtemplate(hWnd, GAssist::g_strAppdir + _T("img\\活动\\镜妖\\镜妖3.bmp"), rc); i++)
- {
- // 打开世界地图;
- GAssist::SendKey(hWnd, VK_TAB); SRAND(200, 300);
- // 选择坐标点;
- GAssist::MouseClick(hWnd, spt[i % 4]);
- // 退出世界地图;
- GAssist::SendKey(hWnd, VK_TAB); SRAND(500, 900);
- if (i > 10) {
- DebugLog(_T("未找到镜妖+10"));
- break;
- }
- }
- // 找到镜妖;
- GAssist::MouseMove(hWnd, CPoint(rc.left + rand() % 10, rc.top + rand() % 10));
- DebugLog(_T("移动鼠标"));
- GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2 + rand() % 3, (rc.top + rc.bottom) / 2 + rand() % 3), TRUE);
- SRAND(300, 600);
- // 单击目标后,要往移走鼠标,防止下面匹配的时候被鼠标挡住;
- GAssist::MouseMove(hWnd, CPoint(rc.right + RAND(5, 12), rc.bottom + RAND(5, 10)));
- SRAND(300, 500);
- DebugLog(_T("找到目标并单击成功:%s"));
- // 我来抓你;
- if (GAssist::GetImgMatchtemplate(hWnd, GAssist::g_strAppdir + _T("img\\活动\\镜妖\\我来抓您的.bmp"), rc)) {
- // 找到匹配的模块;
- GAssist::MouseMove(hWnd, CPoint(rc.left + rand() % 10, rc.top + rand() % 10));
- DebugLog(_T("我来抓你:移动鼠标"));
- GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2 + rand() % 3, (rc.top + rc.bottom) / 2 + rand() % 3), TRUE);
- SRAND(800, 1500);
- DebugLog(_T("我来抓你:找到目标并单击成功:%s"));
- BOOL bBattle = FALSE;
- //while (GAssist::GetImgMatchtemplate(hWnd, GAssist::g_strAppdir + _T("img\\活动\\镜妖\\战斗中.bmp"), rc))
- while (IsBattle(hWnd))
- {
- DebugLog(_T("BattleJY:战斗中"));
- //while (GAssist::GetImgMatchtemplate(hWnd, GAssist::g_strAppdir + _T("img\\活动\\镜妖\\技能选择.bmp"), rc))
- while (IsWattingAttack(hWnd, 0))
- {
- DebugLog(_T("BattleJY:我方攻击……"));
- if (!bBattle)
- {
- // 根据角色选择技能;
- GAssist::SendKey(hWnd, VK_F1);
- SRAND(200, 300);
- // 打镜妖喽罗;
- GAssist::MouseClick(hWnd, CPoint(290 - 3, 140 - 20));
- //GAssist::MouseMove(hWnd, CPoint(220 - 5, 180 - 10));// 打主镜妖;
- SRAND(200, 300);
- if (bSummoner) {
- // 召唤兽技能;
- if (GAssist::GetImgMatchtemplate(hWnd, GAssist::g_strAppdir + _T("img\\活动\\镜妖\\召唤兽技能选择.bmp"), rc))
- {
- SRAND(200, 500);
- GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2 + rand() % 3, (rc.top + rc.bottom) / 2 + rand() % 3), TRUE);
- DebugLog(_T("BattleJY:召唤兽技能选择"));
- // 选择重击;
- SRAND(300, 800);
- if (GAssist::GetImgMatchtemplate(hWnd, GAssist::g_strAppdir + _T("img\\活动\\镜妖\\重击.bmp"), rc))
- {
- GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2 + rand() % 3, (rc.top + rc.bottom) / 2 + rand() % 3), TRUE);
- }
- SRAND(200, 500);
- GAssist::MouseMove(hWnd, CPoint(290 - 3, 140 - 15));
- GAssist::MouseClick(hWnd, CPoint(290 - 3, 140 - 20));
- }
- }
- else
- {
- GAssist::SendKey(hWnd, VK_A, FALSE, TRUE);
- SRAND(600, 900);
- }
- bBattle = TRUE;
- }
- else
- {
- GAssist::SendKey(hWnd, VK_A, FALSE, TRUE);
- SRAND(50, 100);
- GAssist::SendKey(hWnd, VK_A, FALSE, TRUE);
- SRAND(600, 900);
- }
- SRAND(300, 550);
- }
- // 战斗中等待;
- SRAND(800, 1200);
- }
- }
- }
- // 是否停止走路;
- BOOL IsWalkStop(HWND hWnd)
- {
- // 将鼠标移走,不要在抠图区域;
- // 截图,抠指定区域;
- // 再截图,抠指定区域与上次抠图结果比较;
- // 比较结果相同,表示停止走路;
- //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++)
- {
- GAssist::CropPicture(hWnd, rc, _T("walk1.bmp"));
- Sleep(600);
- GAssist::CropPicture(hWnd, rc2, _T("walk2.bmp"));
- // 判断2张图片是否一样;
- if (GAssist::IsSimilarPicture(_T("walk1.bmp"), _T("walk2.bmp")))
- {
- DebugLog(_T("停止走路"));
- return TRUE;
- }
- }
- return FALSE;
- }
- // 世界地图定位;
- void WorldMapPositioning(HWND hWnd, POINT ptMap)
- {
- CRect rc;
- //// 打开世界地图;
- GAssist::SendKey(hWnd, VK_TAB); SRAND(300, 500);
- // 判断是否打开了地图;
- if (!GAssist::GetImgMatchtemplate(hWnd, GAssist::g_strAppdir + _T("img\\世界地图.bmp"), rc))
- return;
- //// 单击寻路窗口;
- GAssist::MouseClick(hWnd, ptMap); SRAND(300, 600);
- //// 退出世界地址;
- GAssist::SendKey(hWnd, VK_TAB); SRAND(200, 300);
- IsWalkStop(hWnd);
- }
- // 使用快捷键来处理:读取配置文件
- auto FindJNShortCut = [](LPCTSTR lpSkillName, int& nKeyValue, int& nSkilltime)->BOOL {
- // 读取文件:jnmap.bin
- // 格式:技能=快捷键的键值;
- std::string line;
- std::ifstream ifJN("img\\jnmap.bin");
- if (ifJN)
- {
- TCHAR szKeyValue[MAX_PATH] = { 0 };
- TCHAR szSkillName[MAX_PATH] = { 0 };
- TCHAR szSkillTime[MAX_PATH] = { 0 };
- while (std::getline(ifJN, line))
- {
- int nRet = _stscanf_s(line.c_str(), _T("%[^;];%[^;];%s"), szSkillName, MAX_PATH, szKeyValue, MAX_PATH, szSkillTime, MAX_PATH);
- if (nRet == 3 && _tcsicmp(lpSkillName, szSkillName) == 0) {
- // 将快捷键值
- nKeyValue = atol(szKeyValue);
- nSkilltime = atol(szSkillTime);
- return TRUE;
- }
- }
- }
- // 没有找到jnmap.bin文件;
- return FALSE;
- };
- // 挑战医师;
- void BattleYS(HWND hWnd, const char* lpszJN)
- {
- CRect rc;
- BOOL bBattle = FALSE;
- if (!FindNPC(hWnd, "医师独侠"))
- return;
- // 废话少说:表示这个没打过;
- rc = FindMatchIcon(hWnd, _T("img\\gdd\\废话少说.bmp"));
- if (!rc.IsRectEmpty() && !rc.IsRectNull())
- {
- // 确定
- bBattle = TRUE;
- GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2, (rc.top + rc.bottom) / 2), TRUE);
- SRAND(230, 350);
- GAssist::MouseMoveEx(hWnd, { rc.left, rc.top }, { rc.right + rand() % 10, rc.bottom + rand() % 10 });
- SRAND(20, 60);
- ClickDlgSetup(hWnd, _T("img\\确定.bmp"));
- }
- else
- {
- rc = FindMatchIcon(hWnd, _T("img\\gdd\\离开这里.bmp"));
- if (!rc.IsRectEmpty() && !rc.IsRectNull())
- {
- SRAND(150, 250);
- // 只有离开这里:已经打过,右键并退出 ;
- DebugLog("只有离开这里:已经打过,右键并退出");
- GAssist::MouseRClick(hWnd);
- }
- else
- {
- // 找下一页的技能:没有下一页返回-1,找到返回0,没找到返回1;
- auto FindNextPageJZ = [&](TCHAR* pJN)->int {
- // 没有在当前页找到目标,看看是否在下一页;
- rc = FindMatchIcon(hWnd, _T("img\\jn-jk\\gdd\\xyy.bmp"));
- if (rc.IsRectEmpty() || rc.IsRectNull())
- {
- // 没有下一页,右键退出;
- GAssist::MouseRClick(hWnd);
- return -1;
- }
- GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2, (rc.top + rc.bottom) / 2), TRUE);
- SRAND(300, 350);
- // 下一页中查看;
- rc = FindMatchIcon(hWnd, pJN);
- if (!rc.IsRectEmpty() && !rc.IsRectNull())
- {
- // 找到目标,单击;
- GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2, (rc.top + rc.bottom) / 2), TRUE);
- SRAND(300, 500);
- // 移动下,防止高亮识别失败;
- GAssist::MouseMoveEx(hWnd, { rc.left, rc.top }, { rc.right + rand() % 10, rc.bottom + rand() % 10 });
- SRAND(250, 300);
- ClickDlgSetup(hWnd, _T("img\\确定.bmp"));
- SRAND(250, 300);
- rc = FindMatchIcon(hWnd, _T("img\\gdd\\接受挑战.bmp"));
- if (!rc.IsRectEmpty() && !rc.IsRectNull())
- {// 第二次开始都会多这个;
- // 找到目标,单击;
- GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2, (rc.top + rc.bottom) / 2), TRUE);
- SRAND(300, 500);
- // 移动下,防止高亮识别失败;
- GAssist::MouseMoveEx(hWnd, { rc.left, rc.top }, { rc.right + rand() % 20, rc.bottom + rand() % 20 });
- SRAND(50,150);
- }
- ClickDlgSetup(hWnd, _T("img\\确定.bmp"));
- SRAND(250, 300);
- // 战斗;
- return 0;
- }
- return 1;
- };
- TCHAR szJN[MAX_PATH] = { 0 };
- _stprintf_s(szJN, _T("img\\jn-jk\\gdd\\%s.bmp"), lpszJN);
- rc = FindMatchIcon(hWnd, szJN);
- if (rc.IsRectEmpty() || rc.IsRectNull())
- {
- // 最多只有三页;
- for (int i = 0; i < 3; i++)
- {
- // 没有在当前页找到目标,看看是否在下一页;
- int nRet = FindNextPageJZ(szJN);
- if (nRet == 1)
- {
- // 没有找到技能;
- continue;
- }
- if (nRet == 0)
- {
- // 找到了;
- bBattle = TRUE;
- }
- break; // 没有下一页也直接break;
- }
- }
- else
- {
- bBattle = TRUE;
- // 找到目标,单击;
- GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2, (rc.top + rc.bottom) / 2), TRUE);
- SRAND(300, 500);
- // 战斗;
- ClickDlgSetup(hWnd, _T("img\\确定.bmp"));
- SRAND(200, 300);
- }
- }
- }
- int KeyValue, SkillTime;
- // 进入战斗;
- if (bBattle)
- {
- // 人物:Alt+S显示技能,双击选择技能,单击怪物发动技能;
- // 注:有的人物技能太多,导致会有滚动条:这是有难点;
- BOOL bRet = FindJNShortCut(lpszJN, KeyValue, SkillTime);
- DebugLog("快捷键值=%ld", KeyValue);
- // 快捷键;
- GAssist::SendKey(hWnd, KeyValue);
- SRAND(350, 650);
- // 单击指定位置;
- GAssist::MouseClick(hWnd, 230, 170);
- SRAND(260, 380);
- // 将鼠标移动到指定位置;
- POINT ptDest = { 625, 28 }; // 左上角;
- GAssist::MouseMove(hWnd, ptDest);
- while (IsBattle(hWnd))
- {
- // 判断是否我方攻击;
- if (IsWattingAttack(hWnd, 1))
- {
- GAssist::SendKey(hWnd, VK_A, FALSE, TRUE);
- }
- SRAND(500, 900);
- }
- }
- // 右键退出;
- SRAND(300, 500); //必要的等待时间;
- do
- {
- rc = FindMatchIcon(hWnd, "img\\对话框关闭按钮.bmp");
- Sleep(900);
- } while (rc.IsRectEmpty() || rc.IsRectNull());
- GAssist::MouseRClick(hWnd);
- }
- void BattleOthers(HWND hWnd, const char* lpszName, const char* lpszSkillName)
- {
- CRect rc;
- BOOL bBattle = FALSE;
- if (!_tcsicmp("浪子独侠", lpszName))
- {
- // 有时会寻路失败;
- GAssist::SendKey(hWnd, VK_TAB); SRAND(300, 600);
- // 单击指定坐标;
- GAssist::MouseClick(hWnd, { 140,430 });
- // 关闭地图;
- GAssist::SendKey(hWnd, VK_TAB); SRAND(100, 300);
- }
-
- if (!FindNPC(hWnd, lpszName))
- return;
- // 废话少说:表示这个没打过;
- rc = FindMatchIcon(hWnd, _T("img\\gdd\\废话少说.bmp"));
- if (!rc.IsRectEmpty() && !rc.IsRectNull())
- {
- GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2, (rc.top + rc.bottom) / 2), TRUE);
- SRAND(330, 550);
- GAssist::MouseMoveEx(hWnd, { rc.left, rc.top }, { rc.right + rand() % 10, rc.bottom + rand() % 10 });
- // 确定
- bBattle = TRUE;
- ClickDlgSetup(hWnd, _T("img\\确定.bmp"));
- SRAND(250, 350);
- }
- else
- {
- rc = FindMatchIcon(hWnd, _T("img\\gdd\\离开这里.bmp"));
- }
- int KeyValue, SkillTime;
- if (bBattle) {
- BOOL bRet = FindJNShortCut(lpszSkillName, KeyValue, SkillTime);
- // 将鼠标移动到指定位置;
- POINT ptDest = { 625, 28 }; // 左上角;
- GAssist::MouseMove(hWnd, ptDest);
- while (IsBattle(hWnd))
- {
- // 判断是否我方攻击;
- if (IsWattingAttack(hWnd, 1))
- {
- GAssist::SendKey(hWnd, VK_A, FALSE, TRUE);
- }
- SRAND(500, 750);
- }
- }
- // 右键退出;
- if (_tcsicmp(lpszName, _T("魂武独侠")))
- {
- SRAND(300, 500);
- do
- {
- rc = FindMatchIcon(hWnd, "img\\对话框关闭按钮.bmp");
- Sleep(900);
- } while (rc.IsRectEmpty() || rc.IsRectNull());
- GAssist::MouseRClick(hWnd);
- }
- else
- {
- // 回到应天府;
- GAssist::MouseMoveEx(hWnd, { rc.left, rc.top }, { rc.right + rand() % 10, rc.bottom + rand() % 10 });
- ClickDlgSetup(hWnd, _T("\\img\\gdd\\送我回应天府.bmp"));
- }
- }
- // 用于应用程序“关于”菜单项的 CAboutDlg 对话框
- class CAboutDlg : public CDialog
- {
- public:
- CAboutDlg();
- // 对话框数据
- enum { IDD = IDD_ABOUTBOX };
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
- // 实现
- protected:
- DECLARE_MESSAGE_MAP()
- };
- CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
- {
- }
- void CAboutDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- }
- BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
- END_MESSAGE_MAP()
- // CGameAssistDlg 对话框
- CGameAssistDlg::CGameAssistDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CGameAssistDlg::IDD, pParent)
- {
- m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
- }
- void CGameAssistDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- DDX_Control(pDX, IDC_CHECK1, m_cbSummoner);
- DDX_Control(pDX, IDC_CHECK2, m_cbZJ);
- DDX_Control(pDX, IDC_CHECK3, m_cbZJ2);
- DDX_Control(pDX, IDC_CHECK6, m_cbAggressiveSkill);
- DDX_Control(pDX, IDC_COMBO1, m_cbGameRole);
- }
- BEGIN_MESSAGE_MAP(CGameAssistDlg, CDialog)
- ON_WM_SYSCOMMAND()
- ON_WM_PAINT()
- ON_WM_QUERYDRAGICON()
- //}}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)
- ON_BN_CLICKED(IDC_BUTTON5, &CGameAssistDlg::OnBnClickedButton5)
- ON_BN_CLICKED(IDC_BUTTON6, &CGameAssistDlg::OnBnClickedButton6)
- ON_BN_CLICKED(IDC_BUTTON7, &CGameAssistDlg::OnBnClickedButton7)
- ON_BN_CLICKED(IDC_BUTTON8, &CGameAssistDlg::OnBnClickedButton8)
- ON_BN_CLICKED(IDC_BUTTON9, &CGameAssistDlg::OnBnClickedButton9)
- ON_BN_CLICKED(IDC_BUTTON10, &CGameAssistDlg::OnBnClickedButton10)
- ON_BN_CLICKED(IDC_BUTTON11, &CGameAssistDlg::OnBnClickedButton11)
- ON_BN_CLICKED(IDC_BUTTON12, &CGameAssistDlg::OnBnClickedButton12)
- END_MESSAGE_MAP()
- // CGameAssistDlg 消息处理程序
- BOOL CGameAssistDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
- // 将“关于...”菜单项添加到系统菜单中。
- // IDM_ABOUTBOX 必须在系统命令范围内。
- ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
- ASSERT(IDM_ABOUTBOX < 0xF000);
- CMenu* pSysMenu = GetSystemMenu(FALSE);
- if (pSysMenu != NULL)
- {
- BOOL bNameValid;
- CString strAboutMenu;
- bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX);
- ASSERT(bNameValid);
- if (!strAboutMenu.IsEmpty())
- {
- pSysMenu->AppendMenu(MF_SEPARATOR);
- pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
- }
- }
- // 设置此对话框的图标。当应用程序主窗口不是对话框时,框架将自动
- // 执行此操作
- SetIcon(m_hIcon, TRUE); // 设置大图标
- SetIcon(m_hIcon, FALSE); // 设置小图标
- // TODO: 在此添加额外的初始化代码
- GAssist::Init();
- return TRUE; // 除非将焦点设置到控件,否则返回 TRUE
- }
- void CGameAssistDlg::OnSysCommand(UINT nID, LPARAM lParam)
- {
- if ((nID & 0xFFF0) == IDM_ABOUTBOX)
- {
- CAboutDlg dlgAbout;
- dlgAbout.DoModal();
- }
- else
- {
- CDialog::OnSysCommand(nID, lParam);
- }
- }
- // 如果向对话框添加最小化按钮,则需要下面的代码
- // 来绘制该图标。对于使用文档/视图模型的 MFC 应用程序,
- // 这将由框架自动完成。
- void CGameAssistDlg::OnPaint()
- {
- if (IsIconic())
- {
- CPaintDC dc(this); // 用于绘制的设备上下文
- SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);
- // 使图标在工作区矩形中居中
- int cxIcon = GetSystemMetrics(SM_CXICON);
- int cyIcon = GetSystemMetrics(SM_CYICON);
- CRect rect;
- GetClientRect(&rect);
- int x = (rect.Width() - cxIcon + 1) / 2;
- int y = (rect.Height() - cyIcon + 1) / 2;
- // 绘制图标
- dc.DrawIcon(x, y, m_hIcon);
- }
- else
- {
- CDialog::OnPaint();
- }
- }
- //当用户拖动最小化窗口时系统调用此函数取得光标
- //显示。
- HCURSOR CGameAssistDlg::OnQueryDragIcon()
- {
- return static_cast<HCURSOR>(m_hIcon);
- }
- void CGameAssistDlg::OnBnClickedOpengame()
- {
- #if 1 // 获取游戏标题;
- DWORD dwPid = GAssist::GetProcessId();
- HWND hProWnd = GAssist::GetProMainHwnd(dwPid);
- //HWND hProWnd = GAssist::GetProMainHwnd(5824);
- TCHAR szWinText[MAX_PATH] = { 0 };
- ::GetWindowText(hProWnd, szWinText, MAX_PATH);
- #if 1
- Sleep(1000);
- m_mouseAssist.BindWnd(hProWnd, PT_TYPE::WINDOW_POINT);
- m_mouseAssist.MoveTo(205, 150);
- Sleep(1000);
- m_mouseAssist.MoveTo(250, 250);
- Sleep(1000);
- m_mouseAssist.MoveTo(350, 350);
- Sleep(1000);
- m_mouseAssist.MoveTo(10, 470);
- m_mouseAssist.LeftClick();
- /*GAssist::MouseMove(hProWnd, CPoint(205,150));
- Sleep(2000);
- GAssist::MouseMove(hProWnd, CPoint(100,100), CPoint(250,250));
- Sleep(2000);
- GAssist::MouseMove(hProWnd, CPoint(100,100), CPoint(350,350));*/
- return;
- #endif
- if (0)
- {
- Sleep(1000);
- GAssist::MouseClick(hProWnd, CPoint(205, 150));
- Sleep(1000);
- GAssist::MouseClick(hProWnd, CPoint(235, 150));
- Sleep(1000);
- GAssist::MouseClick(hProWnd, CPoint(275, 150));
- }
- if (0)
- {
- Sleep(1000);
- ::SetForegroundWindow(hProWnd);
- GAssist::DragMouse(hProWnd, CPoint(173, 192), CPoint(295, 190));
- }
- if (0) {
- GAssist::MouseDbClick(hProWnd, CPoint(476, 158));
- }
- if (0)
- {
- GAssist::SendKey(hProWnd, VK_TAB);
- }
- //RECT rc = {0,0,500,500};
- //HBITMAP hb = GAssist::CopyDC2Bitmap(hProWnd, &rc);
- //GAssist::SaveBitmap(hb, "1.bmp");
- //GAssist::SaveHwndToBmpFile(hProWnd, "2.bmp");
- return;
- #endif
- // TODO: 在此添加控件通知处理程序代码
- if (!PathFileExists(GAssist::g_szGameApp))
- {
- MessageBox("游戏程序不存在", "温馨提示");
- return;
- }
- // 设置辅助程序工作目录为游戏目录;
- //SetCurrentDirectory(_T("E:\\dhsh\\shdata\\"));
- SetCurrentDirectory(_T("D:\\tools\\dhsh\\shdata\\"));
- #if 1
- ShellExecute(NULL, "open", GAssist::g_szGameApp, NULL, NULL, SW_SHOWNORMAL);//SW_HIDE无用,因为会自动结;
- Sleep(500); // Main.exe设置了陷阱(自己再开启了一个进程,结束上一个进程),需要等5秒;
- #else
- SHELLEXECUTEINFO stuExecInfo = { 0 };
- DWORD dwExitCode = STILL_ACTIVE;
- //CString strCommandLine = _T("open");
- stuExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
- stuExecInfo.lpFile = GAssist::g_szGamePath;
- stuExecInfo.lpParameters = "open";
- stuExecInfo.nShow = SW_SHOWNORMAL;
- stuExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS | SEE_MASK_FLAG_NO_UI;
- if (!ShellExecuteEx(&stuExecInfo))
- {
- DWORD dwError = GetLastError();
- CString strError = _T("");
- strError.Format(_T("执行ShellExecuteEx失败,错误码:%d"), dwError);
- AfxMessageBox(strError);
- return;
- }
- HANDLE hProcess = stuExecInfo.hProcess;
- if (hProcess != NULL)
- {
- WaitForSingleObject(hProcess, INFINITE);
- CloseHandle(hProcess);
- }
- #endif
- DWORD dwPID = GAssist::FindProcess(_T("Main.exe"));
- #if 1
- EnumWindows(GAssist::EnumChildWindowCallBack, dwPID);
- if (GAssist::g_vtGameHwnd.size())
- {
- GAssist::GameHwnd* gp = NULL;
- GAssist::GameHwnd* gbmin = NULL;
- GAssist::GameHwnd* gbentry = NULL;
- for (std::vector<GAssist::GameHwnd>::iterator it = GAssist::g_vtGameHwnd.begin(); it != GAssist::g_vtGameHwnd.end(); it++)
- {
- if (_tcsicmp(it->strWinText.c_str(), _T("最小化")) == 0)
- {
- gbmin = &*it;
- }
- if (_tcsicmp(it->strWinText.c_str(), _T("大话水浒")) == 0)
- {
- gp = &*it;
- }
- if (_tcsicmp(it->strWinText.c_str(), _T("进入游戏")) == 0)
- {
- gbentry = &*it;
- }
- }
- if (gp && gbentry && gbmin)
- {
- //::SendMessage(gp->hwnd, WM_LBUTTONDOWN, (WPARAM)gb->dwId, 0);
- //::SendMessage(gp->hwnd, WM_LBUTTONUP, (WPARAM)gb->dwId, 0);
- // 发送点击事件;
- // 先最小化;
- ::SendMessage(gp->hwnd, WM_COMMAND, gbmin->dwId, NULL);
- // 再进入;
- ::SendMessage(gp->hwnd, WM_COMMAND, gbentry->dwId, NULL);
- Sleep(1500);
- dwPID = GAssist::GetProcessId();
- if (dwPID)
- {
- GAssist::g_vtGameHwnd.clear();
- EnumWindows(GAssist::EnumChildWindowCallBack, dwPID);
- HWND hwnd = GAssist::GetProMainHwnd(dwPID);
- if (hwnd)
- {
- TCHAR szName[MAX_PATH] = { 0 };
- ::GetWindowText(hwnd, szName, MAX_PATH);
- CRect rc;
- ::GetWindowRect(hwnd, &rc);
- TCHAR szLogMsg[MAX_PATH] = { 0 };
- _stprintf_s(szLogMsg, _T("窗口标题:%s, [%d,%d, %d,%d], width=%d, height=%d\n"), szName, rc.top, rc.left, rc.right, rc.bottom, rc.Width(), rc.Height());
- OutputDebugString(szLogMsg);
- if (1)
- { // 800x600
- // 发送按钮消息;进入游戏;
- GAssist::MouseClick(hwnd, 585, 116);
- // 发送按钮消息;下一步;
- GAssist::MouseClick(hwnd, 536, 481);
- // 发送按钮消息;电信一区;
- GAssist::MouseClick(hwnd, 229, 342);
- // 发送按钮消息;忘忧谷;
- GAssist::MouseClick(hwnd, 335, 244);
- // 发送按钮消息;下一步;
- GAssist::MouseClick(hwnd, 559, 516);
- }
- else
- {
- // 640x480
- // 发送按钮消息;进入游戏;
- GAssist::MouseClick(hwnd, 440, 75);
- // 发送按钮消息;下一步;
- GAssist::MouseClick(hwnd, 468, 454);
- // 发送按钮消息;电信一区;
- GAssist::MouseClick(hwnd, 165, 241);
- // 发送按钮消息;忘忧谷;
- GAssist::MouseClick(hwnd, 289, 195);
- // 发送按钮消息;下一步;
- GAssist::MouseClick(hwnd, 494, 469);
- }
- }
- }
- }
- }
- #endif
- }
- void CGameAssistDlg::OnBnClickedButton2() // 截图;
- {
- // TODO: 在此添加控件通知处理程序代码
- HWND hWnd = GAssist::GetProcessMainWnd();
- UpdateData();
- INT nX = GetDlgItemInt(IDC_EDIT3);
- INT nY = GetDlgItemInt(IDC_EDIT4);
- INT nX2 = GetDlgItemInt(IDC_EDIT5);
- INT nY2 = GetDlgItemInt(IDC_EDIT6);
- BOOL bCropPicture = ((CButton*)GetDlgItem(IDC_CHECK5))->GetCheck();
- if (bCropPicture)
- {
- GAssist::CropPicture(hWnd, { nX, nY, nX2, nY2 }, _T("裁剪结果.bmp"));
- }
- else
- {
- CString strImg;
- strImg = CTime::GetCurrentTime().Format("%H%M%S-Game.bmp");
- GAssist::SaveHwndToBmpFile(hWnd, strImg.GetString());
- }
- #if 0
- HWND hWnd = GAssist::GetProcessMainWnd();
- #if 1
- // 快捷键;
- //GAssist::SendKey(hProWnd, VK_F3);
- //SRAND(350, 650);
- //// 单击指定位置;
- //GAssist::MouseClick(hProWnd, 230, 170);
- //SRAND(260, 380);
- //// 将鼠标移动到指定位置;
- //POINT ptDest = { 625, 28 }; // 左上角;
- //GAssist::MouseMove(hProWnd, ptDest);
- // 有时会寻路失败;
- GAssist::SendKey(hWnd, VK_TAB); SRAND(300, 600);
- // 单击指定坐标;
- //GAssist::MouseClick(hWnd, { 80,500 });
- GAssist::MouseMove(hWnd, { 80, 580 });
- // 关闭地图;
- GAssist::SendKey(hWnd, VK_TAB); SRAND(100, 300);
- #else
- //IsWattingAttack(hProWnd, 1);
- //BattleYS(hProWnd, "缚神诀");
- char szName[10][32] = { "术士独侠","道士独侠","武师独侠","浪子独侠",
- "剑客独侠","弓手独侠","禁卫独侠","墨者独侠","巫煞独侠","魂武独侠" };
- BattleOthers(hProWnd, szName[9], _T("缚神诀"));
- #endif
- // auto FindJNShortCut = [](LPCTSTR lpSkillName)->int {
- // // 读取文件:jnmap.bin
- // // 格式:技能=快捷键的键值;
- // std::string line;
- // std::ifstream ifJN("..\\img\\jnmap.bin");
- // if (ifJN)
- // {
- // TCHAR szKeyValue[MAX_PATH] = { 0 };
- // TCHAR szSkillName[MAX_PATH] = { 0 };
- // while (std::getline(ifJN, line))
- // {
- // int nRet = _stscanf_s(line.c_str(), _T("%[^=]%s"), szSkillName, MAX_PATH, szKeyValue, MAX_PATH);
- // if (nRet == 2 && _tcsicmp(lpSkillName, szSkillName) == 0) {
- // // 将快捷键值
- // return atol(szKeyValue);
- // }
- // }
- //}
- //
- // // 没有找到jnmap.bin文件;
- // return -1;
- // };
- //
- //int KeyValue, SkillTime;
- //FindJNShortCut("缚神诀", KeyValue, SkillTime);
- #endif
- #if 0
- CRect rc;
- HWND hProWnd = GAssist::GetProcessMainWnd();
- // POINT spt= { 20, 555 }; // 左下角;
- //POINT spt = { 20, 50 }; // 左上角
- POINT spt = { 625, 28 }; // 战斗时的右上角
- // 选择坐标点;
- GAssist::MouseMove(hProWnd, spt);
- CString strImg;
- //strImg = CTime::GetCurrentTime().Format("%Y-%m-%d %H:%M:%S %W-%A");
- strImg = CTime::GetCurrentTime().Format("%H%M%S-Game.bmp");
- GAssist::SaveHwndToBmpFile(hProWnd, strImg.GetString());
- #endif
- #if 0
- CRect rc;
- HWND hProWnd = GAssist::GetProcessMainWnd();
- POINT spt[4] = { { 250, 335 }, { 310,360}, { 385, 315}, { 280,295 } };
- static int i = 2;
- if (i < 4)
- {
- // 打开世界地图;
- GAssist::SendKey(hProWnd, VK_TAB); SRAND(200, 300);
- // 选择坐标点;
- GAssist::MouseClick(hProWnd, spt[i % 4]);
- // 退出世界地图;
- GAssist::SendKey(hProWnd, VK_TAB); SRAND(500, 900);
- DebugLog(_T("%d = [x,y] = (%d, %d)"), i, spt[i].x, spt[i].y);
- i++;
- }
- else
- {
- i = 0;
- }
- #endif
- // GAssist::MouseMove(hProWnd, CPoint(290 - 5, 140 - 20));
- //
- // Sleep(5000);
- // GAssist::MouseMove(hProWnd, CPoint(220 - 5, 180 - 10));
- }
- void CGameAssistDlg::OnBnClickedButton3() // 镜妖;
- {
- UpdateData();
- /*
- -- 是否在星秀村
- -- 是否在贫民房
- |-- 否:我帮您抓
- |-- -- 是否进入过贫民房
- | |-- 否:我这就去
- | | |-- 选择:幸运镜妖
- | | |-- 我就选择它
- | |-- 是:直接进入贫民房
- |-- 是:找到镜妖NPC
- | |-- 我来抓您的
- | |
- | |
- |
- |
- */
- CRect rc;
- HWND hProWnd = GAssist::GetProcessMainWnd();
- int nZJType = 0;
- if (m_cbZJ.GetCheck() || m_cbZJ2.GetCheck())
- {
- if (m_cbZJ.GetCheck())
- nZJType = 1;
- if (m_cbZJ2.GetCheck())
- nZJType = 2;
- }
- for (int i = 0; i < 100; i++)
- {
- UpdateData(FALSE);
- DebugLog(_T("start.打镜妖 %d----------------------------"), i);
- BattleJY(hProWnd, m_cbSummoner.GetCheck(), nZJType, m_cbAggressiveSkill.GetCheck());
- DebugLog(_T("end.打镜妖 %d----------------------------\n"), i);
- }
- }
- void CGameAssistDlg::OnBnClickedButton4() // 周六领礼物
- {
- // TODO: 在此添加控件通知处理程序代码
- // 星秀村:送礼协会会长丙
- // 【星】铜钱怪
- HWND hWnd = GAssist::GetProcessMainWnd();
- FindNPC(hWnd, _T("送礼协会会长丙"));
- IsWalkStop(hWnd);
- if (ClickDlgSetup(hWnd, _T("img\\活动\\周六礼物\\我来领取礼物.bmp")))
- {
- if (ClickDlgSetup(hWnd, _T("img\\活动\\周六礼物\\好的.bmp")))
- {
- FindNPC(hWnd, _T("【星】铜钱怪"));
- IsWalkStop(hWnd);
- CRect rc;
- //铜钱怪:好的,要问些什么问题呢?
- struct MyStruct
- {
- BOOL bDone = FALSE;
- TCHAR szQuestion[MAX_PATH] = { 0 };
- };
- if (ClickDlgSetup(hWnd, _T("img\\活动\\周六礼物\\铜钱怪:好的,要问些什么问题呢?.bmp")))
- {
- // 第一次回答;
- std::vector<MyStruct> vtMyst1 = { {FALSE, _T("img\\活动\\周六礼物\\铜钱怪:帮派就象个大家庭.bmp")},
- {FALSE, _T("img\\活动\\周六礼物\\铜钱怪:交流的场所.bmp")},
- {FALSE, _T("img\\活动\\周六礼物\\铜钱怪:能够认识很多.bmp")},
- {FALSE, _T("img\\活动\\周六礼物\\铜钱怪:我希望能够.bmp")},
- {FALSE, _T("img\\活动\\周六礼物\\铜钱怪:由系统定时发布.bmp")},
- {FALSE, _T("img\\活动\\周六礼物\\铜钱怪:好的,快点问吧.bmp")}
- };
- for (; vtMyst1.size();)
- {
- for (std::vector<MyStruct>::iterator it = vtMyst1.begin(); it != vtMyst1.end(); it++)
- {
- rc = FindMatchIcon(hWnd, it->szQuestion);
- if (!rc.IsRectEmpty() && !rc.IsRectNull())
- {
- // 单击目标回答;
- GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2 + rand() % 3, (rc.top + rc.bottom) / 2 + rand() % 5));
- // 再移动下鼠标,防止高亮影响下次的判断;
- GAssist::MouseMove(hWnd, CPoint(rc.right + RAND(6, 20), rc.bottom + RAND(6, 20)));
- // 等待下一个问题出现;
- SRAND(200, 300);
- it = vtMyst1.erase(it);
- break;
- }
- }
- }
- // 第二次回答;
- std::vector<MyStruct> vtMyst2 = { {FALSE, _T("img\\活动\\周六礼物\\铜钱怪:帮派就象个大家庭.bmp")},
- {FALSE, _T("img\\活动\\周六礼物\\铜钱怪:交流的场所.bmp")},
- {FALSE, _T("img\\活动\\周六礼物\\铜钱怪:能够认识很多.bmp")},
- {FALSE, _T("img\\活动\\周六礼物\\铜钱怪:我希望能够.bmp")},
- {FALSE, _T("img\\活动\\周六礼物\\铜钱怪:由系统定时发布.bmp")}
- };
- for (; vtMyst2.size();)
- {
- for (std::vector<MyStruct>::iterator it = vtMyst2.begin(); it != vtMyst2.end(); it++)
- {
- rc = FindMatchIcon(hWnd, it->szQuestion);
- if (!rc.IsRectEmpty() && !rc.IsRectNull())
- {
- // 单击目标回答;
- GAssist::MouseClick(hWnd, CPoint((rc.right + rc.left) / 2 + rand() % 3, (rc.top + rc.bottom) / 2 + rand() % 5));
- // 再移动下鼠标,防止高亮影响下次的判断;
- GAssist::MouseMove(hWnd, CPoint(rc.right + RAND(6, 20), rc.bottom + RAND(6, 20)));
- // 等待下一个问题出现;
- SRAND(200, 300);
- it = vtMyst2.erase(it);
- break;
- }
- }
- }
- // 回答完所有问题,右键退出;
- SRAND(200, 300);
- GAssist::MouseRClick(hWnd);
- }
- // 再次回到送礼协会会长;
- FindNPC(hWnd, _T("送礼协会会长丙"));
- IsWalkStop(hWnd);
- // 再右键一次;
- SRAND(200, 300);
- GAssist::MouseRClick(hWnd);
- FindNPC(hWnd, _T("送礼协会会长丙"));
- if (ClickDlgSetup(hWnd, _T("img\\活动\\周六礼物\\好,现在就去.bmp")))
- {
- // 等待切换地图;
- SRAND(800, 900);
- }
- }
- }
- if (IsOnMap(hWnd, _T("img\\地图\\汴京城.bmp")))
- {
- // 找送礼协会会长丁
- FindNPC(hWnd, _T("送礼协会会长丁"));
- IsWalkStop(hWnd);
- SRAND(300, 500); // 等对话框出现;
- if (ClickDlgSetup(hWnd, _T("img\\活动\\周六礼物\\我来领取礼物.bmp")))
- {
- if (ClickDlgSetup(hWnd, _T("img\\活动\\周六礼物\\好的.bmp")))
- {
- // 找铜钱怪;
- FindNPC(hWnd, _T("【汴】铜钱怪"));
- IsWalkStop(hWnd);
- SRAND(300, 500);
- if (ClickDlgSetup(hWnd, _T("img\\活动\\周六礼物\\铜钱怪:进入战斗.bmp")))
- {
- // 将鼠标移动到指定位置;
- POINT ptDest = { 625, 28 }; // 左上角;
- GAssist::MouseMove(hWnd, ptDest);
- while (IsBattle(hWnd))
- {
- // 判断是否我方攻击;
- if (IsWattingAttack(hWnd, 1))
- {
- GAssist::SendKey(hWnd, VK_A, FALSE, TRUE);
- }
- SRAND(500, 750);
- }
- // 送礼协会会长乙;
- FindNPC(hWnd, _T("送礼协会会长乙"));
- IsWalkStop(hWnd);
- // 再右键一次;
- SRAND(200, 300);
- GAssist::MouseRClick(hWnd);
- FindNPC(hWnd, _T("送礼协会会长丙")); SRAND(200, 300);
- if (ClickDlgSetup(hWnd, _T("img\\活动\\周六礼物\\好,现在就去.bmp")))
- {
- // 等待切换地图;
- SRAND(800, 900);
- }
- }
- }
- }
- }
- if (IsOnMap(hWnd, _T("img\\地图\\应天府.bmp")))
- {
- // 找送礼协会会长丁
- FindNPC(hWnd, _T("送礼协会会长甲"));
- IsWalkStop(hWnd);
- SRAND(300, 500); // 等对话框出现;
- if (ClickDlgSetup(hWnd, _T("img\\活动\\周六礼物\\我来领取礼物.bmp")))
- {
- if (ClickDlgSetup(hWnd, _T("img\\活动\\周六礼物\\好的.bmp")))
- {
- // 找铜钱怪;
- FindNPC(hWnd, _T("【应】铜钱怪"));
- IsWalkStop(hWnd);
- SRAND(300, 500);
- if (ClickDlgSetup(hWnd, _T("img\\活动\\周六礼物\\铜钱怪:进入战斗.bmp")))
- {
- // 将鼠标移动到指定位置;
- POINT ptDest = { 625, 28 }; // 左上角;
- GAssist::MouseMove(hWnd, ptDest);
- while (IsBattle(hWnd))
- {
- // 判断是否我方攻击;
- if (IsWattingAttack(hWnd, 1))
- {
- GAssist::SendKey(hWnd, VK_A, FALSE, TRUE);
- }
- SRAND(500, 750);
- }
- // 送礼协会会长乙;
- FindNPC(hWnd, _T("送礼协会会长甲"));
- IsWalkStop(hWnd);
- SRAND(1000, 2000);
- GAssist::MouseRClick(hWnd);
- }
- }
- }
- }
- }
- void CGameAssistDlg::OnBnClickedButton5() // 开宝箱;
- {
- HWND hProcessMainWnd = GAssist::GetProcessMainWnd();
- if (GAssist::nGameWndType == GAssist::GW_SMALL)
- {
- CRect rc;
- MouseAssist mouseAssist;
- mouseAssist.BindWnd(hProcessMainWnd, PT_TYPE::SCREEN_POINT);
- for (int i = 0; i < 50; i++)
- {
- if (!GAssist::GetImgMatchtemplate(hProcessMainWnd, GAssist::g_strAppdir + _T("img\\开宝箱\\应天府铁匠.bmp"), rc))
- {
- // 没找到,要将鼠标从目标中移走;并且要右击一次将目标的高亮状态取消;
- mouseAssist.SetCursorPos(rc.top + rand() % 5, rc.left + rand() % 5);
- mouseAssist.MoveTo(rc.top - rand() % 5, rc.left - rand() % 5);
- mouseAssist.RightClick();
- }
- else
- {
- GAssist::MouseClick(hProcessMainWnd, CPoint((rc.right + rc.left) / 2 + rand() % 3, (rc.top + rc.bottom) / 2 + rand() % 5));
- Sleep(600 + rand() % 30);
- // 再移动下,会更高精度;
- mouseAssist.MoveTo(rc.top - rand() % 15, rc.left - rand() % 15);
- // 判断是否还有对话,如果没有的话表明不是第一次进入;
- if (GAssist::GetImgMatchtemplate(hProcessMainWnd, GAssist::g_strAppdir + _T("img\\开宝箱\\开宝箱.bmp"), rc)) {
- GAssist::MouseClick(hProcessMainWnd, CPoint((rc.right + rc.left) / 2 + rand() % 2, (rc.top + rc.bottom) / 2 + rand() % 2));
- Sleep(rand() % 200 + 190);
- // 然后移动出去;
- //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.MoveToEx(rc.top, rc.left, rc.Width(), rc.Height());
- }
- }
- Sleep(600 + rand() % 300);
- }
- }
- }
- void CGameAssistDlg::OnBnClickedButton6() // 职业挑战;
- {
- CRect rc;
- DebugLog(_T("进入孤独洞========="));
- HWND hProWnd = GAssist::GetProcessMainWnd();
- if (!FindNPC(hProWnd, "职业训导大师"))
- return;
- // 选择进入;
- BOOL bMatch = FALSE;
- int trySize = 20;
- // 我要挑战他们;
- while (!(bMatch = ClickDlgSetup(hProWnd, _T("img\\zyxdds-wytztm.bmp")))) {
- SRAND(1200, 2200);
- if (!trySize--) break;
- }
- // 准备好了
- if (ClickDlgSetup(hProWnd, _T("img\\zyxdds-zbhl.bmp")))
- {
- // 地图切换,等出图;
- SRAND(2000, 2500);
- if (IsOnMap(hProWnd, _T("img\\gdd\\name.bmp")))
- {
- DebugLog(_T("进入孤独洞"));
- char szName[10][32] = { "术士独侠","道士独侠","武师独侠","浪子独侠","剑客独侠","弓手独侠","禁卫独侠","墨者独侠","巫煞独侠","魂武独侠" };
- BattleYS(hProWnd, "缚神诀");
- for (int i = 0; i < 10; i++)
- {
- BattleOthers(hProWnd, szName[i], "缚神诀");
- }
- }
- }
- }
- void CGameAssistDlg::OnBnClickedButton7() // 家园任务;
- {
- // TODO: 在此添加控件通知处理程序代码
- }
- void CGameAssistDlg::OnBnClickedButton8() // 职业挑战2;
- {
- // TODO: 在此添加控件通知处理程序代码
- CRect rc;
- DebugLog(_T("进入孤独洞========="));
- HWND hProWnd = GAssist::GetProcessMainWnd();
- DebugLog(_T("进入孤独洞"));
- char szName[10][32] = { "术士独侠","道士独侠","武师独侠","浪子独侠","剑客独侠","弓手独侠","禁卫独侠","墨者独侠","巫煞独侠","魂武独侠" };
- for (int i = 0; i < 10; i++)
- {
- BattleOthers(hProWnd, szName[i], "缚神诀");
- }
- }
- void CGameAssistDlg::OnBnClickedButton9() // 移动到目标点
- {
- // TODO: 在此添加控件通知处理程序代码
- HWND hWnd = GAssist::GetProcessMainWnd();
- UpdateData();
- INT nX = GetDlgItemInt(IDC_EDIT1);
- INT nY = GetDlgItemInt(IDC_EDIT2);
- BOOL bOpenMap = ((CButton*)GetDlgItem(IDC_CHECK4))->GetCheck();
- if (bOpenMap)
- WorldMapPositioning(hWnd, { nX, nY });
- else
- GAssist::MouseMove(hWnd, { nX, nY });
- }
- void CGameAssistDlg::OnBnClickedButton10()
- {
- // TODO: 在此添加控件通知处理程序代码
- CRect rc;
- HWND hProWnd = GAssist::GetProcessMainWnd();
- int nZJType = 0;
- if (m_cbZJ.GetCheck() || m_cbZJ2.GetCheck())
- {
- if (m_cbZJ.GetCheck())
- nZJType = 1;
- if (m_cbZJ2.GetCheck())
- nZJType = 2;
- }
- UpdateData(FALSE);
- DebugLog(_T("start.打镜妖 %d----------------------------"));
- BattleJY(hProWnd, m_cbSummoner.GetCheck(), nZJType, m_cbAggressiveSkill.GetCheck());
- DebugLog(_T("end.打镜妖 %d----------------------------\n"));
- }
- void CGameAssistDlg::OnBnClickedButton11()
- {
- // TODO: 在此添加控件通知处理程序代码
- }
- void CGameAssistDlg::OnBnClickedButton12()
- {
- // TODO: 在此添加控件通知处理程序代码
- HWND hWnd = GAssist::GetProcessMainWnd();
- while ( true )
- {
- while (IsBattle(hWnd))
- {
- if ( IsWattingAttack(hWnd,1) )
- {
- GAssist::SendKey(hWnd, VK_A, FALSE, TRUE);
- }
- Sleep(900);
- }
- Sleep(600);
- }
- }
|