Merge branch 'master' into dev

This commit is contained in:
MistEO
2021-10-30 01:56:49 +08:00
5 changed files with 61 additions and 8 deletions

View File

@@ -1,8 +1,23 @@
# MeoAssistance
<div>
<img alt="C++" src="https://img.shields.io/badge/c++-17-%2300599C?logo=cplusplus">
<img alt="VS" src="https://img.shields.io/badge/VisualStudio-19-%235C2D91?logo=visualstudio">
</div>
<div>
<img alt="platform" src="https://img.shields.io/badge/platform-Windows%2064bit-%230078D6?logo=windows">
</div>
<div>
<img alt="license" src="https://img.shields.io/github/license/MistEO/MeoAssistance-Arknights">
<img alt="commit" src="https://img.shields.io/github/commit-activity/m/MistEO/MeoAssistance-Arknights?color=%23ff69b4">
<img alt="stars" src="https://img.shields.io/github/stars/MistEO/MeoAssistance-Arknights?style=social">
</div>
<br>
A game assistance for Arknights
一款明日方舟的游戏辅助供PC端安卓模拟器使用也勉强兼容安卓手机龟速开发中……
一款明日方舟的游戏辅助供PC端安卓模拟器使用也勉强兼容安卓手机绝赞开发中……
<br>
![界面截图](images/gui.png)
![公招截图](images/openRecruit.png)
@@ -15,8 +30,8 @@ A game assistance for Arknights
## 功能介绍
- 自动刷理智
- **新功能:支持刷完自动上传[企鹅物流数据统计](https://penguin-stats.cn/)**(测试版)
- **新功能:界面支持统计掉落数量**(测试版)
- **新功能:支持刷完自动上传[企鹅物流数据统计](https://penguin-stats.cn/)**
- **新功能:界面支持统计掉落数量**
- 可设置是否吃完理智药及数量
- 可设置是否吃石头及数量
- 可设置刷的次数(用来刷剿灭啥的)
@@ -157,8 +172,8 @@ A game assistance for Arknights
- [x] 支持所有主流模拟器
- [ ] 基建智能换班功能
- [ ] 图形化界面
- [x] 干员及精英化识别
- [ ] 干员识别准确率提高到100%
- [x] 干员技能识别
- [x] 干员识别准确率提高到100%
- [x] 宿舍心情识别及入驻
- [x] 制造站、贸易站智能换班
- [x] 发电站、办公室换班

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View File

@@ -197,6 +197,39 @@ bool Controller::try_capture(const EmulatorInfo& info, bool without_handle)
m_emulator_info = info;
adb_dir = '"' + utils::string_replace_all(m_emulator_info.adb.path, "[ExecDir]", utils::get_cur_dir()) + '"';
}
// 针对雷电模拟器连接问题的专用补丁
if (m_emulator_info.handle.class_name == "LDPlayerMainFrame") {
log.trace("LDPlayer Connection Patch Activated.");
std::string connect_cmd = utils::string_replace_all("[Adb] devices", "[Adb]", adb_dir);
auto devices_result = call_command(connect_cmd);
std::string devices_list(
std::make_move_iterator(devices_result.begin()),
std::make_move_iterator(devices_result.end()));
// 查找连接的所有设备
std::string device = {};
if (devices_list.find("emulator") != devices_list.npos) {
device = devices_list.substr(devices_list.find("emulator"), 13);
m_emulator_info.adb.connect = "";
}
else if (devices_list.find("127") != devices_list.npos) {
device = devices_list.substr(devices_list.find("127"), 14);
}
if (device.empty()) {
log.trace("no device detected.");
return false;
}
log.trace("device detected: ", device);
m_emulator_info.adb.connect = utils::string_replace_all(m_emulator_info.adb.connect, "127.0.0.1:5555", device);
m_emulator_info.adb.click = utils::string_replace_all(m_emulator_info.adb.click, "-e", "-s " + device);
m_emulator_info.adb.swipe = utils::string_replace_all(m_emulator_info.adb.swipe, "-e", "-s " + device);
m_emulator_info.adb.display = utils::string_replace_all(m_emulator_info.adb.display, "-e", "-s " + device);
m_emulator_info.adb.screencap = utils::string_replace_all(m_emulator_info.adb.screencap, "-e", "-s " + device);
}
std::string connect_cmd = utils::string_replace_all(m_emulator_info.adb.connect, "[Adb]", adb_dir);
auto&& [connect_ret, connect_result] = call_command(connect_cmd);

View File

@@ -85,8 +85,8 @@ bool asst::MatchImageAnalyzer::match_templ(const cv::Mat& templ)
bool asst::MatchImageAnalyzer::comp_hist(const cv::Mat& hist, const cv::Rect roi)
{
cv::Mat roi_image = m_image(utils::make_rect<cv::Rect>(m_roi))(roi);
double score = 1.0 - cv::compareHist(to_hist(roi_image), hist, cv::HISTCMP_BHATTACHARYYA);
cv::Mat image_roi = m_image(utils::make_rect<cv::Rect>(m_roi))(roi);
double score = 1.0 - cv::compareHist(to_hist(image_roi), hist, cv::HISTCMP_BHATTACHARYYA);
if (score > 0.7) { // 得分太低的肯定不对,没必要打印
log.trace("comp_hist |", m_templ_name, "score:", score);

View File

@@ -9,7 +9,7 @@ namespace MeoAsstGui
public class ViewStatusStorage
{
private static string _configFilename = System.Environment.CurrentDirectory + "\\gui.json";
private static JObject _viewStatus;
private static JObject _viewStatus = new JObject();
public static string Get(string key, string defalut_value)
{
@@ -36,6 +36,11 @@ namespace MeoAsstGui
{
string jsonStr = sr.ReadToEnd();
_viewStatus = (JObject)JsonConvert.DeserializeObject(jsonStr);
// 文件存在但为空会读出来一个null感觉c#这库有bug
if (_viewStatus == null)
{
_viewStatus = new JObject();
}
}
}
catch (Exception)