Browse Source

修复坐标问题

Jeff Wang 1 year ago
parent
commit
0f40dbe4d8
2 changed files with 13 additions and 12 deletions
  1. 7 7
      GameAssist/GameAssist/CAction.cpp
  2. 6 5
      GameAssist/GameAssist/GameAssistDlg.cpp

+ 7 - 7
GameAssist/GameAssist/CAction.cpp

@@ -574,20 +574,20 @@ SRAND(80,120);
 			SRAND(500, 850);
 		}
 
-		if (IsSPBelowSafeValue(TRUE, TRUE, 15))
+		if (IsSPBelowSafeValue(TRUE, TRUE, 30))
 		{
 			GameGlobal::DebugLog(_T("低SP安全值"));
 			// 右键;
-			MouseMove({ (GameAssist::g_rcRoleIdleSP.right + GameAssist::g_rcRoleIdleSP.left) / 2 - 3, (GameAssist::g_rcRoleIdleSP.bottom + GameAssist::g_rcRoleIdleSP.top) / 2 - 20 });
-			MouseRClick({ (GameAssist::g_rcRoleIdleSP.right + GameAssist::g_rcRoleIdleSP.left) / 2 - 3, (GameAssist::g_rcRoleIdleSP.bottom + GameAssist::g_rcRoleIdleSP.top) / 2 - 20 });
+			MouseMove({ (GameAssist::g_rcRoleIdleSP.right + GameAssist::g_rcRoleIdleSP.left) / 2 , (GameAssist::g_rcRoleIdleSP.bottom + GameAssist::g_rcRoleIdleSP.top) / 2  });
+			MouseRClick({ (GameAssist::g_rcRoleIdleSP.right + GameAssist::g_rcRoleIdleSP.left) / 2 , (GameAssist::g_rcRoleIdleSP.bottom + GameAssist::g_rcRoleIdleSP.top) / 2 });
 		}
 
 		if (bHasSummoner && IsSPBelowSafeValue(FALSE, TRUE, 10))
 		{
 			GameGlobal::DebugLog(_T("低SP安全值"));
 			// 右键;
-			MouseMove({ (GameAssist::g_rcSummonerIdleSP.right + GameAssist::g_rcSummonerIdleSP.left) / 2 - 3, (GameAssist::g_rcSummonerIdleSP.bottom + GameAssist::g_rcSummonerIdleSP.top) / 2 - 20 });
-			MouseRClick({ (GameAssist::g_rcSummonerIdleSP.right + GameAssist::g_rcSummonerIdleSP.left) / 2 - 3, (GameAssist::g_rcSummonerIdleSP.bottom + GameAssist::g_rcSummonerIdleSP.top) / 2 - 20 });
+			MouseMove({ (GameAssist::g_rcSummonerIdleSP.right + GameAssist::g_rcSummonerIdleSP.left) / 2 , (GameAssist::g_rcSummonerIdleSP.bottom + GameAssist::g_rcSummonerIdleSP.top) / 2  });
+			MouseRClick({ (GameAssist::g_rcSummonerIdleSP.right + GameAssist::g_rcSummonerIdleSP.left) / 2 , (GameAssist::g_rcSummonerIdleSP.bottom + GameAssist::g_rcSummonerIdleSP.top) / 2  });
 		}
 
 		// 非战斗中,是否在贫民房中;
@@ -1148,8 +1148,8 @@ SRAND(80,120);
 		{
 			//DebugLog(_T("低SP安全值"));
 			// 右键;
-			MouseMove({ (GameAssist::g_rcRoleIdleSP.right + GameAssist::g_rcRoleIdleSP.left) / 2 - 3, (GameAssist::g_rcRoleIdleSP.bottom + GameAssist::g_rcRoleIdleSP.top) / 2 - 20 });
-			MouseRClick({ (GameAssist::g_rcRoleIdleSP.right + GameAssist::g_rcRoleIdleSP.left) / 2 - 3, (GameAssist::g_rcRoleIdleSP.bottom + GameAssist::g_rcRoleIdleSP.top) / 2 - 20 });
+			MouseMove({ (GameAssist::g_rcRoleIdleSP.right + GameAssist::g_rcRoleIdleSP.left) / 2 , (GameAssist::g_rcRoleIdleSP.bottom + GameAssist::g_rcRoleIdleSP.top) / 2 });
+			MouseRClick({ (GameAssist::g_rcRoleIdleSP.right + GameAssist::g_rcRoleIdleSP.left) / 2 , (GameAssist::g_rcRoleIdleSP.bottom + GameAssist::g_rcRoleIdleSP.top) / 2 });
 		}
 	}
 

+ 6 - 5
GameAssist/GameAssist/GameAssistDlg.cpp

@@ -378,17 +378,18 @@ void CGameAssistDlg::OnBnClickedButton2()  // 
 	INT nY2 = GetDlgItemInt(IDC_EDIT6);
 	BOOL bCropPicture = ((CButton*)GetDlgItem(IDC_CHECK5))->GetCheck();
 
-	TCHAR szImg[MAX_PATH] = {0};
 	if (bCropPicture)
 	{
-		_stprintf_s(szImg, _T("%s²Ã¼ô-%ld.bmp"), GameGlobal::g_szTempDir, GetTickCount64());
-		ImgAssist::CropPicture(hWnd, { nX, nY, nX2, nY2 }, szImg);
+		std::string strImg = GameGlobal::g_szTempDir;
+		strImg.append(_T("²Ã¼ô½á¹û.bmp"));
+		ImgAssist::CropPicture(hWnd, { nX, nY, nX2, nY2 }, strImg.c_str());
 	}
 	else
 	{
-		_stprintf_s(szImg, _T("%s½Øͼ-%ld.bmp"), GameGlobal::g_szTempDir, GetTickCount64());
+		std::string strImg = GameGlobal::g_szTempDir;
+		strImg.append(_T("½Øͼ½á¹û.bmp"));
 		cv::Mat srcImg = ImgAssist::CaptureWnd(hWnd);
-		cv::imwrite(szImg, srcImg);
+		cv::imwrite(strImg.c_str(), srcImg);
 	}
 }