|
@@ -158,7 +158,7 @@ BOOL IsWattingAttack(HWND hWnd)
|
|
|
for (; it != contours.end(); it++)
|
|
|
{
|
|
|
length = arcLength(*it, true); area = contourArea(*it);
|
|
|
- if (length > 80.0 && area > 180.0)
|
|
|
+ if (length > 130 && area > 550.0)
|
|
|
{
|
|
|
DebugLog(_T("当前周长和面积:%lf, %lf"), length, area);
|
|
|
bIsAttack = TRUE;
|
|
@@ -180,14 +180,14 @@ BOOL IsWattingAttack(HWND hWnd)
|
|
|
return bIsAttack;
|
|
|
}
|
|
|
|
|
|
-void BattleOnece(HWND hWnd)
|
|
|
+void BattleOnece(HWND hWnd, BOOL bHasSummoner)
|
|
|
{
|
|
|
+ BOOL bBattle = FALSE;
|
|
|
if ( IsBattle(hWnd) )
|
|
|
{
|
|
|
SRAND(300, 500);
|
|
|
// 是否我方攻击;
|
|
|
- if (IsWattingAttack(hWnd))
|
|
|
- {
|
|
|
+ if (IsWattingAttack(hWnd)) {
|
|
|
// 人物固定F1
|
|
|
// 根据角色选择技能;
|
|
|
GAssist::SendKey(hWnd, VK_F1);
|
|
@@ -196,6 +196,8 @@ void BattleOnece(HWND hWnd)
|
|
|
GAssist::MouseClick(hWnd, CPoint(290 - 3, 140 - 20));
|
|
|
//GAssist::MouseMove(hWnd, CPoint(220 - 5, 180 - 10));// 打主镜妖;
|
|
|
SRAND(100, 200);
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -284,7 +286,157 @@ void BattleOnece(HWND hWnd)
|
|
|
}
|
|
|
|
|
|
// 与镜妖战斗;
|
|
|
-void BattleJY(HWND hWnd, BOOL bSummoner)
|
|
|
+void BattleJY(HWND hWnd, BOOL bHasSummoner)
|
|
|
+{
|
|
|
+ if (IsBattle(hWnd)) { // 是否在战斗中;
|
|
|
+ SRAND(300, 500);
|
|
|
+ // 是否我方攻击;
|
|
|
+ BOOL bFirstAttack = FALSE;
|
|
|
+ while (IsWattingAttack(hWnd)) {
|
|
|
+ // 人物固定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);
|
|
|
+
|
|
|
+ DebugLog(_T("BattleJY:我方攻击……"));
|
|
|
+ if (!bFirstAttack)
|
|
|
+ {
|
|
|
+ // 根据角色选择技能;
|
|
|
+ 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 (bHasSummoner) {
|
|
|
+ CRect rc;
|
|
|
+ // 召唤兽技能;
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+
|
|
|
+ bFirstAttack = 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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ // 非战斗中,是否在贫民房中;
|
|
|
+ if (!IsOnMap(hWnd, _T("img\\地图\\贫民房.bmp"))) {
|
|
|
+ // 找小米;
|
|
|
+ CRect rc = FindNPC(hWnd, "臭美的小米");
|
|
|
+
|
|
|
+ // 选择进入;
|
|
|
+ BOOL bMatch = FALSE;
|
|
|
+ int trySize = 15;
|
|
|
+ // 我要挑战他们;
|
|
|
+ while (!(bMatch = ClickSetup(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 (ClickSetup(hWnd, _T("img\\活动\\镜妖\\2-我这就去.bmp")))
|
|
|
+ {
|
|
|
+ SRAND(600, 1200);
|
|
|
+ if (ClickSetup(hWnd, _T("img\\活动\\镜妖\\3-战意镜妖.bmp")))
|
|
|
+ {
|
|
|
+ SRAND(600, 1800);
|
|
|
+ if ((bMatch = ClickSetup(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 BattleJY2(HWND hWnd, BOOL bSummoner)
|
|
|
{
|
|
|
if (!IsOnMap(hWnd, _T("img\\地图\\贫民房.bmp"))) {
|
|
|
// 找小米;
|
|
@@ -351,7 +503,7 @@ void BattleJY(HWND hWnd, BOOL bSummoner)
|
|
|
SRAND(300, 600);
|
|
|
// 单击目标后,要往移走鼠标,防止下面匹配的时候被鼠标挡住;
|
|
|
GAssist::MouseMove(hWnd, CPoint(rc.right + RAND(5, 12), rc.bottom + RAND(5, 10)));
|
|
|
- SRAND(200, 500);
|
|
|
+ SRAND(300, 500);
|
|
|
DebugLog(_T("找到目标并单击成功:%s"));
|
|
|
|
|
|
// 我来抓你;
|
|
@@ -405,7 +557,7 @@ void BattleJY(HWND hWnd, BOOL bSummoner)
|
|
|
else
|
|
|
{
|
|
|
GAssist::SendKey(hWnd, VK_A, FALSE, TRUE);
|
|
|
- SRAND(200, 300);
|
|
|
+ SRAND(600, 900);
|
|
|
}
|
|
|
|
|
|
bBattle = TRUE;
|
|
@@ -415,10 +567,10 @@ void BattleJY(HWND hWnd, BOOL bSummoner)
|
|
|
GAssist::SendKey(hWnd, VK_A, FALSE, TRUE);
|
|
|
SRAND(50, 100);
|
|
|
GAssist::SendKey(hWnd, VK_A, FALSE, TRUE);
|
|
|
- SRAND(60, 100);
|
|
|
+ SRAND(600, 900);
|
|
|
}
|
|
|
|
|
|
- //SRAND(300, 550);
|
|
|
+ SRAND(300, 550);
|
|
|
}
|
|
|
|
|
|
// 战斗中等待;
|
|
@@ -487,6 +639,7 @@ BEGIN_MESSAGE_MAP(CGameAssistDlg, CDialog)
|
|
|
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)
|
|
|
END_MESSAGE_MAP()
|
|
|
|
|
|
|
|
@@ -1192,3 +1345,9 @@ void CGameAssistDlg::OnBnClickedButton6() // 职业
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+void CGameAssistDlg::OnBnClickedButton7() // 家园任务;
|
|
|
+{
|
|
|
+ // TODO: 在此添加控件通知处理程序代码
|
|
|
+}
|