diff --git a/MeoAssistance.sln b/MeoAssistance.sln index b8d8e99437..ebeccc1887 100644 --- a/MeoAssistance.sln +++ b/MeoAssistance.sln @@ -13,15 +13,22 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Sanity", "Tools\Sanity\Sanity.vcxproj", "{36BC08F3-71CF-429A-AE69-291BE8962CB2}" ProjectSection(ProjectDependencies) = postProject {362D1E30-F5AE-4279-9985-65C27B3BA300} = {362D1E30-F5AE-4279-9985-65C27B3BA300} - {9CC7838E-D5FB-4771-848D-5F83D638C5AD} = {9CC7838E-D5FB-4771-848D-5F83D638C5AD} EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MeoAsstGui", "MeoAsstGui\MeoAsstGui.csproj", "{FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}" ProjectSection(ProjectDependencies) = postProject {362D1E30-F5AE-4279-9985-65C27B3BA300} = {362D1E30-F5AE-4279-9985-65C27B3BA300} - {9CC7838E-D5FB-4771-848D-5F83D638C5AD} = {9CC7838E-D5FB-4771-848D-5F83D638C5AD} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Screenshot", "Tools\Screenshot\Screenshot.vcxproj", "{4AC1CFFF-D7B8-4FDA-BCFD-E4754275979B}" + ProjectSection(ProjectDependencies) = postProject + {362D1E30-F5AE-4279-9985-65C27B3BA300} = {362D1E30-F5AE-4279-9985-65C27B3BA300} + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{6C4B8D52-51D1-45F8-AAEC-808035443FD6}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "3rdPart", "3rdPart", "{402D9F27-234E-41A9-BEB1-1FC1FA3C8825}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -74,10 +81,25 @@ Global {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.Release|x64.Build.0 = Release|Any CPU {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.Release|x86.ActiveCfg = Release|Any CPU {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.Release|x86.Build.0 = Release|Any CPU + {4AC1CFFF-D7B8-4FDA-BCFD-E4754275979B}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {4AC1CFFF-D7B8-4FDA-BCFD-E4754275979B}.Debug|x64.ActiveCfg = Debug|x64 + {4AC1CFFF-D7B8-4FDA-BCFD-E4754275979B}.Debug|x64.Build.0 = Debug|x64 + {4AC1CFFF-D7B8-4FDA-BCFD-E4754275979B}.Debug|x86.ActiveCfg = Debug|Win32 + {4AC1CFFF-D7B8-4FDA-BCFD-E4754275979B}.Debug|x86.Build.0 = Debug|Win32 + {4AC1CFFF-D7B8-4FDA-BCFD-E4754275979B}.Release|Any CPU.ActiveCfg = Release|Win32 + {4AC1CFFF-D7B8-4FDA-BCFD-E4754275979B}.Release|x64.ActiveCfg = Release|x64 + {4AC1CFFF-D7B8-4FDA-BCFD-E4754275979B}.Release|x64.Build.0 = Release|x64 + {4AC1CFFF-D7B8-4FDA-BCFD-E4754275979B}.Release|x86.ActiveCfg = Release|Win32 + {4AC1CFFF-D7B8-4FDA-BCFD-E4754275979B}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {9CC7838E-D5FB-4771-848D-5F83D638C5AD} = {402D9F27-234E-41A9-BEB1-1FC1FA3C8825} + {36BC08F3-71CF-429A-AE69-291BE8962CB2} = {6C4B8D52-51D1-45F8-AAEC-808035443FD6} + {4AC1CFFF-D7B8-4FDA-BCFD-E4754275979B} = {6C4B8D52-51D1-45F8-AAEC-808035443FD6} + EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {4F2C0E4B-4FE9-47C6-A878-6BD2FAD8B9B2} EndGlobalSection diff --git a/MeoAssistance/src/Assistance.cpp b/MeoAssistance/src/Assistance.cpp index 44b34198a7..85697e6ca4 100644 --- a/MeoAssistance/src/Assistance.cpp +++ b/MeoAssistance/src/Assistance.cpp @@ -177,7 +177,7 @@ void Assistance::working_proc(Assistance* pThis) pThis->stop(false); continue; } - if (cur_image.cols < 100) { + if (cur_image.rows < 100) { DebugTraceInfo("Window Could not be minimized!!!"); pThis->m_pWindow->showWindow(); pThis->m_condvar.wait_for(lock, @@ -332,11 +332,6 @@ std::pair asst::Assistance::get_format_image() cv::Mat cropped(cur_image, cv::Rect(x_offset, y_offset, width, height)); -#ifdef _DEBUG - cv::imwrite("test.bmp", cur_image); -#endif // _DEBUG - - //// 调整尺寸,与资源中截图的标准尺寸一致 //cv::Mat dst; //cv::resize(cropped, dst, cv::Size(m_configer.DefaultWindowWidth, m_configer.DefaultWindowHeight)); diff --git a/MeoAssistance/src/Configer.cpp b/MeoAssistance/src/Configer.cpp index 649d1ae1bc..a59a89ce44 100644 --- a/MeoAssistance/src/Configer.cpp +++ b/MeoAssistance/src/Configer.cpp @@ -171,8 +171,6 @@ bool Configer::reload(const std::string& filename) emulator_info.adb.display = emulator_json["adb"]["display"].as_string(); emulator_info.adb.display_regex = emulator_json["adb"]["displayRegex"].as_string(); } - emulator_info.width = emulator_json["width"].as_integer(); - emulator_info.height = emulator_json["height"].as_integer(); emulator_info.x_offset = emulator_json["xOffset"].as_integer(); emulator_info.y_offset = emulator_json["yOffset"].as_integer(); if (emulator_json.exist("rightOffset")) { @@ -181,6 +179,8 @@ bool Configer::reload(const std::string& filename) if (emulator_json.exist("bottomOffset")) { emulator_info.bottom_offset = emulator_json["bottomOffset"].as_integer(); } + emulator_info.width = DefaultWindowWidth + emulator_info.x_offset + emulator_info.right_offset; + emulator_info.height = DefaultWindowHeight + emulator_info.y_offset + emulator_info.bottom_offset; temp.m_handles.emplace(name, emulator_info); } diff --git a/README.md b/README.md index 2f5861f70e..4f41a85fa1 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,7 @@ A game assistance for Arknights - [x] 鍩烘湰鍥惧舰鍖栫晫闈 - [ ] 鍥惧舰鍖栫晫闈㈣繘涓姝ュ畬鍠 - [ ] 鏃ュ織鎵撳嵃锛岄敊璇彁绀 + - [ ] 鍒峰畬鑷姩鍏虫満鍔熻兘 - [ ] ~~鎿嶄綔闅忔満寤舵椂鏀寔璁剧疆~~ - [ ] 鍒风悊鏅 - [x] 鏀寔鍓跨伃 diff --git a/Tools/Sanity/Sanity.vcxproj b/Tools/Sanity/Sanity.vcxproj index 5156e49ecb..2da2757eea 100644 --- a/Tools/Sanity/Sanity.vcxproj +++ b/Tools/Sanity/Sanity.vcxproj @@ -25,7 +25,7 @@ 16.0 Win32Proj {36bc08f3-71cf-429a-ae69-291be8962cb2} - Test + Tools 10.0 Sanity diff --git a/Tools/Screenshot/Screenshot.vcxproj b/Tools/Screenshot/Screenshot.vcxproj new file mode 100644 index 0000000000..6107270ef2 --- /dev/null +++ b/Tools/Screenshot/Screenshot.vcxproj @@ -0,0 +1,161 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + + + 16.0 + Win32Proj + {4AC1CFFF-D7B8-4FDA-BCFD-E4754275979B} + Tools + 10.0 + Screenshot + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + $(SolutionDir)meojson\include;$(SolutionDir)MeoAssistance\include;$(IncludePath) + $(TargetDir);$(LibraryPath) + + + false + $(SolutionDir)meojson\include;$(SolutionDir)MeoAssistance\include;$(IncludePath) + $(TargetDir);$(LibraryPath) + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + stdcpp17 + stdc11 + + + Console + true + MeoAssistance.lib;%(AdditionalDependencies) + $(TargetDir);%(AdditionalLibraryDirectories) + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + stdcpp17 + stdc11 + MultiThreaded + + + Console + true + true + true + MeoAssistance.lib;%(AdditionalDependencies) + $(TargetDir);%(AdditionalLibraryDirectories) + + + + + + \ No newline at end of file diff --git a/Tools/Screenshot/Screenshot.vcxproj.filters b/Tools/Screenshot/Screenshot.vcxproj.filters new file mode 100644 index 0000000000..65fa6d5ae5 --- /dev/null +++ b/Tools/Screenshot/Screenshot.vcxproj.filters @@ -0,0 +1,22 @@ +锘 + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + 婧愭枃浠 + + + \ No newline at end of file diff --git a/Tools/Screenshot/main.cpp b/Tools/Screenshot/main.cpp new file mode 100644 index 0000000000..8ab28aada2 --- /dev/null +++ b/Tools/Screenshot/main.cpp @@ -0,0 +1,30 @@ +#include "Assistance.h" +#include "AsstAux.h" +#include "Logger.hpp" + +int main(int argc, char** argv) +{ + using namespace asst; + + Assistance asst; + + auto ret = asst.set_emulator(); + if (!ret) { + DebugTraceError("Can't Find Emulator or Permission denied."); + getchar(); + return -1; + } + else { + DebugTraceInfo("Find Emulator:", ret.value()); + } + + char ch = 0; + while (ch != EOF) { + ch = getchar(); + auto time_str = StringReplaceAll(StringReplaceAll(GetFormatTimeString(), " ", "_"), ":", "-"); + std::string filename = GetCurrentDir() + "screenshot\\" + time_str + ".png"; + asst.print_window(filename); + } + + return 0; +} \ No newline at end of file diff --git a/resource/Friends.png b/resource/Friends.png index 8c82fe8dcc..0120048fa1 100644 Binary files a/resource/Friends.png and b/resource/Friends.png differ diff --git a/resource/Mall.png b/resource/Mall.png index 591dace744..19d7bac210 100644 Binary files a/resource/Mall.png and b/resource/Mall.png differ diff --git a/resource/PRTS.png b/resource/PRTS.png index 6d46794289..83386acd44 100644 Binary files a/resource/PRTS.png and b/resource/PRTS.png differ diff --git a/resource/Return.png b/resource/Return.png index 58c511622c..cd1f30f396 100644 Binary files a/resource/Return.png and b/resource/Return.png differ diff --git a/resource/StartButton1.png b/resource/StartButton1.png index 47d3bf633f..c35d85105c 100644 Binary files a/resource/StartButton1.png and b/resource/StartButton1.png differ diff --git a/resource/StartButton2.png b/resource/StartButton2.png index 00db0efc4c..0f17980b34 100644 Binary files a/resource/StartButton2.png and b/resource/StartButton2.png differ diff --git a/resource/StartToVisit.png b/resource/StartToVisit.png index dc4c526dff..4d05f19874 100644 Binary files a/resource/StartToVisit.png and b/resource/StartToVisit.png differ diff --git a/resource/UsePrts.png b/resource/UsePrts.png index d44a556d8c..97802b1f38 100644 Binary files a/resource/UsePrts.png and b/resource/UsePrts.png differ diff --git a/resource/VisitNext.png b/resource/VisitNext.png index c3e28872af..986a699660 100644 Binary files a/resource/VisitNext.png and b/resource/VisitNext.png differ diff --git a/resource/config.json b/resource/config.json index 4094567721..7747129db2 100644 --- a/resource/config.json +++ b/resource/config.json @@ -44,8 +44,6 @@ "window": "BlueStacks Android PluginAndroid" } ], - "width": 1302, - "height": 776, "xOffset": 11, "yOffset": 46, "rightOffset": 11, @@ -70,8 +68,6 @@ "window": "澶滅妯℃嫙鍣" } ], - "width": 1321, - "height": 768, "xOffset": 2, "yOffset": 39, "rightOffset": 39, @@ -101,8 +97,6 @@ "window": "TheRender" } ], - "width": 1280, - "height": 755, "xOffset": 0, "yOffset": 35 }, @@ -129,8 +123,6 @@ "window": "MainWindowWindow" } ], - "width": 1282, - "height": 769, "xOffset": 1, "yOffset": 48, "rightOffset": 1, @@ -159,8 +151,6 @@ "window": "AEngineRenderWindow" } ], - "width": 1282, - "height": 769, "xOffset": 1, "yOffset": 42 }, @@ -190,8 +180,6 @@ "display": " shell dumpsys window displays | grep init= | awk ' { print $3 } '", "displayRegex": "cur=%dx%d" }, - "width": 1280, - "height": 809, "xOffset": 0, "yOffset": 36 }, @@ -221,12 +209,10 @@ "display": " shell dumpsys window displays | grep init= | awk ' { print $3 } '", "displayRegex": "cur=%dx%d" }, - "width": 1280, - "height": 809, "xOffset": 0, "yOffset": 36, "rightOffset": 0, - "bottomOffset": 53 + "bottomOffset": 0 } }, "tasks_Doc": "涓嬮潰鐨勫拰浠诲姟闃熷垪鎵ц閫昏緫鏈夊叧锛屼笉闇瑕佷慨鏀", @@ -415,7 +401,6 @@ "VisitNext": { "filename": "VisitNext.png", "type": "clickSelf", - "threshold": 0.99, "maxTimes": 21, "exceededNext": [ "ReturnToMall" @@ -450,7 +435,7 @@ }, "CreditStore": { "filename": "CreditStore.png", - "threshold": 0.89, + "threshold": 0.85, "rearDelay": 1000, "type": "clickSelf", "next": [ @@ -467,6 +452,7 @@ }, "VisitLimited": { "filename": "VisitLimited.png", + "threshold": 1, "type": "doNothing", "next": [ "ReturnToMall"