fix: 保存截图加回来

[skip changelog]
This commit is contained in:
status102
2025-08-12 14:42:12 +08:00
parent 1e935aeda9
commit 066c735967

View File

@@ -61,7 +61,7 @@ bool asst::RoguelikeInvestTaskPlugin::_run()
if (auto wallet = get_wallet(image); *wallet && *wallet == 0) { // 手头没钱了
Log.info(__FUNCTION__, "手头没钱了, 退出投资");
retry = 0;
while (!need_exit() && retry++ < 20) {
while (!need_exit()) {
if (auto ocr = get_deposit(image); ocr) {
if (*ocr >= 0 && *ocr <= 999 && *ocr >= *deposit) {
count += *ocr - *deposit;
@@ -69,6 +69,11 @@ bool asst::RoguelikeInvestTaskPlugin::_run()
break;
}
}
if (retry++ > 5) {
Log.error(__FUNCTION__, "无法获取可投资状态下的存款");
save_img(utils::path("debug") / utils::path("roguelike") / utils::path("invest_system"));
break;
}
sleep(500);
image = ctrler()->get_image();
}