mirror of
https://github.com/0O0o0oOoO00/Alas.git
synced 2026-05-14 13:39:25 +08:00
Merge branch 'dev' into feature/more
This commit is contained in:
15
alas.py
15
alas.py
@@ -45,7 +45,22 @@ class AzurLaneAutoScript:
|
|||||||
AutoRestart_AttemptsToRestart = 0
|
AutoRestart_AttemptsToRestart = 0
|
||||||
AutoRestart_NotifyWhenAutoRestart = False
|
AutoRestart_NotifyWhenAutoRestart = False
|
||||||
|
|
||||||
|
def pre_init(self):
|
||||||
|
from PIL import Image
|
||||||
|
Image.init()
|
||||||
|
|
||||||
|
# Manually register PngImagePlugin
|
||||||
|
from PIL import PngImagePlugin
|
||||||
|
Image.register_open(PngImagePlugin.PngImageFile.format, PngImagePlugin.PngImageFile, PngImagePlugin._accept)
|
||||||
|
Image.register_save(PngImagePlugin.PngImageFile.format, PngImagePlugin._save)
|
||||||
|
Image.register_save_all(PngImagePlugin.PngImageFile.format, PngImagePlugin._save_all)
|
||||||
|
|
||||||
|
Image.register_extensions(PngImagePlugin.PngImageFile.format, [".png", ".apng"])
|
||||||
|
|
||||||
|
Image.register_mime(PngImagePlugin.PngImageFile.format, "image/png")
|
||||||
|
|
||||||
def __init__(self, config_name='alas'):
|
def __init__(self, config_name='alas'):
|
||||||
|
self.pre_init()
|
||||||
logger.hr('Start', level=0)
|
logger.hr('Start', level=0)
|
||||||
self.config_name = config_name
|
self.config_name = config_name
|
||||||
# Skip first restart
|
# Skip first restart
|
||||||
|
|||||||
90
bin/Lua/SpeedUp.lua
Normal file
90
bin/Lua/SpeedUp.lua
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
function Main1()
|
||||||
|
SN = gg.choice({
|
||||||
|
"设置倍速",
|
||||||
|
"还原倍速",
|
||||||
|
"退出",
|
||||||
|
}, nil, "倍速面板")
|
||||||
|
if SN==1 then
|
||||||
|
HS9()
|
||||||
|
end
|
||||||
|
if SN==2 then
|
||||||
|
HS666()
|
||||||
|
end
|
||||||
|
if SN==3 then
|
||||||
|
exit()
|
||||||
|
end
|
||||||
|
FX=false
|
||||||
|
end
|
||||||
|
|
||||||
|
function HS9()
|
||||||
|
x = gg.prompt({"倍速(默认5倍)"},{"5.0"},{number})
|
||||||
|
n = x[1]
|
||||||
|
-- 清除
|
||||||
|
gg.clearResults()
|
||||||
|
gg.setRanges(32)
|
||||||
|
-- 第一次搜索
|
||||||
|
gg.searchNumber("1.0;0.33333334327;0.02999999933::9", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1, 0)
|
||||||
|
gg.refineNumber("1.0", gg.TYPE_AUTO, false, gg.SIGN_EQUAL, 0, -1, 0)
|
||||||
|
results=gg.getResultCount()
|
||||||
|
gg.getResults(100)
|
||||||
|
gg.editAll(n, gg.TYPE_FLOAT)
|
||||||
|
-- 判断
|
||||||
|
if results==0 then
|
||||||
|
-- 清除
|
||||||
|
gg.clearResults()
|
||||||
|
gg.setRanges(32)
|
||||||
|
-- 第二次搜索
|
||||||
|
gg.searchNumber("1.0;0.33333334327;0.02999999933::9", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
|
||||||
|
gg.refineNumber("1.0", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
|
||||||
|
gg.getResults(100)
|
||||||
|
gg.editAll(n, gg.TYPE_DWORD)
|
||||||
|
end
|
||||||
|
-- 清除
|
||||||
|
gg.clearResults()
|
||||||
|
gg.toast("修改成功")
|
||||||
|
end
|
||||||
|
|
||||||
|
function HS666()
|
||||||
|
x = gg.prompt({"还原倍速(默认5倍)"},{"5.0"},{number})
|
||||||
|
n = x[1]
|
||||||
|
-- 清除
|
||||||
|
gg.clearResults()
|
||||||
|
gg.setRanges(32)
|
||||||
|
-- 第一次搜索
|
||||||
|
gg.searchNumber(n..";0.33333334327;0.02999999933::9", gg.TYPE_DOUBLE, false, gg.SIGN_EQUAL, 0, -1, 0)
|
||||||
|
gg.refineNumber(n, gg.TYPE_DOUBLE, false, gg.SIGN_EQUAL, 0, -1, 0)
|
||||||
|
gg.getResults(100)
|
||||||
|
gg.editAll("1", gg.TYPE_DOUBLE)
|
||||||
|
gg.getResultCount(results)
|
||||||
|
-- 判断
|
||||||
|
if results==nil then
|
||||||
|
-- 清除
|
||||||
|
gg.clearResults()
|
||||||
|
gg.setRanges(32)
|
||||||
|
-- 第二次搜索
|
||||||
|
gg.searchNumber(n..";0.33333334327;0.02999999933::9", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
|
||||||
|
gg.refineNumber(n, gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
|
||||||
|
gg.getResults(100)
|
||||||
|
gg.editAll("1", gg.TYPE_DWORD)
|
||||||
|
end
|
||||||
|
-- 清除
|
||||||
|
gg.clearResults()
|
||||||
|
gg.toast("还原成功")
|
||||||
|
end
|
||||||
|
|
||||||
|
function exit()
|
||||||
|
gg.alert("退出成功")
|
||||||
|
os.exit()
|
||||||
|
end
|
||||||
|
|
||||||
|
-- 循环
|
||||||
|
-- while true do
|
||||||
|
-- if gg.isVisible(true) then
|
||||||
|
-- FX=true
|
||||||
|
-- gg.setVisible(false)
|
||||||
|
-- end
|
||||||
|
gg.clearResults()
|
||||||
|
-- if FX==true then
|
||||||
|
Main1()
|
||||||
|
-- end
|
||||||
|
-- end
|
||||||
@@ -6,6 +6,35 @@
|
|||||||
#include <sol/sol.hpp>
|
#include <sol/sol.hpp>
|
||||||
|
|
||||||
#include "utils.hpp"
|
#include "utils.hpp"
|
||||||
|
#include "il2cpp.hpp"
|
||||||
|
|
||||||
|
using fnset_TimeScaleT = void(*)(float);
|
||||||
|
|
||||||
|
static fnset_TimeScaleT get_Time_set_timeScale() {
|
||||||
|
Il2CppDomain* domain = il2cpp_domain_get();
|
||||||
|
size_t assembly_count = 0;
|
||||||
|
Il2CppAssembly** assemblies = il2cpp_domain_get_assemblies(domain, &assembly_count);
|
||||||
|
|
||||||
|
Il2CppClass* cls = nullptr;
|
||||||
|
for (size_t i = 0; i < assembly_count; ++i) {
|
||||||
|
Il2CppImage* image = il2cpp_assembly_get_image(assemblies[i]);
|
||||||
|
Il2CppClass* klass = il2cpp_class_from_name(image, "UnityEngine", "Time");
|
||||||
|
if (klass != nullptr) {
|
||||||
|
cls = klass;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (cls != nullptr) {
|
||||||
|
MethodInfo* method_info = il2cpp_class_get_method_from_name(cls, "set_timeScale", 1);
|
||||||
|
if (method_info != nullptr) {
|
||||||
|
auto method = reinterpret_cast<fnset_TimeScaleT>(method_info->methodPointer);
|
||||||
|
SPDLOG_INFO("Found Time.set_timeScale at {}", (void*)method_info->methodPointer);
|
||||||
|
return method;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SPDLOG_ERROR("Failed to get Time.set_timeScale");
|
||||||
|
throw std::runtime_error("Failed to get Time.set_timeScale");
|
||||||
|
}
|
||||||
|
|
||||||
#define IS_ENABLED(n) \
|
#define IS_ENABLED(n) \
|
||||||
if (is_enabled(n)) { \
|
if (is_enabled(n)) { \
|
||||||
@@ -211,6 +240,19 @@ void Cracker::disable_all() {
|
|||||||
disable_no_emotion_warning();
|
disable_no_emotion_warning();
|
||||||
disable_opsi_fast_move();
|
disable_opsi_fast_move();
|
||||||
disable_gg_factor();
|
disable_gg_factor();
|
||||||
|
disable_global_speedup();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Cracker::enable_global_speedup(float rate) {
|
||||||
|
// IS_ENABLED(GLOBAL_SPEEDUP)
|
||||||
|
get_Time_set_timeScale()(rate);
|
||||||
|
ENABLE(GLOBAL_SPEEDUP)
|
||||||
|
}
|
||||||
|
|
||||||
|
void Cracker::disable_global_speedup() {
|
||||||
|
// IS_DISABLED(GLOBAL_SPEEDUP)
|
||||||
|
get_Time_set_timeScale()(1.0);
|
||||||
|
DISABLE(GLOBAL_SPEEDUP)
|
||||||
}
|
}
|
||||||
|
|
||||||
void Cracker::enable_gg_factor() {
|
void Cracker::enable_gg_factor() {
|
||||||
@@ -261,14 +303,13 @@ void Cracker::update_gg_factor(double factor) {
|
|||||||
|
|
||||||
void Cracker::enable_opsi_fast_move() {
|
void Cracker::enable_opsi_fast_move() {
|
||||||
IS_ENABLED(OPSI_FAST_MOVE)
|
IS_ENABLED(OPSI_FAST_MOVE)
|
||||||
m_original.WorldConst_BaseMoveDuration = m_state["WorldConst"]["BaseMoveDuration"];
|
|
||||||
m_state["WorldConst"]["BaseMoveDuration"] = 0.0;
|
m_state["WorldConst"]["BaseMoveDuration"] = 0.0;
|
||||||
ENABLE(OPSI_FAST_MOVE)
|
ENABLE(OPSI_FAST_MOVE)
|
||||||
}
|
}
|
||||||
|
|
||||||
void Cracker::disable_opsi_fast_move() {
|
void Cracker::disable_opsi_fast_move() {
|
||||||
IS_DISABLED(OPSI_FAST_MOVE)
|
IS_DISABLED(OPSI_FAST_MOVE)
|
||||||
m_state["WorldConst"]["BaseMoveDuration"] = m_original.WorldConst_BaseMoveDuration;
|
m_state["WorldConst"]["BaseMoveDuration"] = 0.35;
|
||||||
ENABLE(OPSI_FAST_MOVE)
|
ENABLE(OPSI_FAST_MOVE)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -405,9 +446,6 @@ void Cracker::disable_remove_hard_mode_ship_properties_limit() {
|
|||||||
void Cracker::enable_fast_stage_move() {
|
void Cracker::enable_fast_stage_move() {
|
||||||
IS_ENABLED(FAST_STAGE_MOVE_CRACK)
|
IS_ENABLED(FAST_STAGE_MOVE_CRACK)
|
||||||
|
|
||||||
m_original.ChapterConst_ShipStepDuration = m_state["ChapterConst"]["ShipStepDuration"];
|
|
||||||
m_original.ChapterConst_ShipStepQuickPlayScale = m_state["ChapterConst"]["ShipStepQuickPlayScale"];
|
|
||||||
|
|
||||||
m_state["ChapterConst"]["ShipStepDuration"] = 0.0;
|
m_state["ChapterConst"]["ShipStepDuration"] = 0.0;
|
||||||
m_state["ChapterConst"]["ShipStepQuickPlayScale"] = 0.0;
|
m_state["ChapterConst"]["ShipStepQuickPlayScale"] = 0.0;
|
||||||
|
|
||||||
@@ -417,8 +455,8 @@ void Cracker::enable_fast_stage_move() {
|
|||||||
void Cracker::disable_fast_stage_move() {
|
void Cracker::disable_fast_stage_move() {
|
||||||
IS_DISABLED(FAST_STAGE_MOVE_CRACK)
|
IS_DISABLED(FAST_STAGE_MOVE_CRACK)
|
||||||
|
|
||||||
m_state["ChapterConst"]["ShipStepDuration"] = m_original.ChapterConst_ShipStepDuration;
|
m_state["ChapterConst"]["ShipStepDuration"] = 0.5;
|
||||||
m_state["ChapterConst"]["ShipStepQuickPlayScale"] = m_original.ChapterConst_ShipStepQuickPlayScale;
|
m_state["ChapterConst"]["ShipStepQuickPlayScale"] = 0.5;
|
||||||
|
|
||||||
ENABLE(FAST_STAGE_MOVE_CRACK)
|
ENABLE(FAST_STAGE_MOVE_CRACK)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ enum {
|
|||||||
NO_EMOTION_WARNING,
|
NO_EMOTION_WARNING,
|
||||||
OPSI_FAST_MOVE,
|
OPSI_FAST_MOVE,
|
||||||
GG_FACTOR,
|
GG_FACTOR,
|
||||||
|
GLOBAL_SPEEDUP,
|
||||||
};
|
};
|
||||||
|
|
||||||
class Cracker {
|
class Cracker {
|
||||||
@@ -103,6 +104,9 @@ public:
|
|||||||
|
|
||||||
void disable_all();
|
void disable_all();
|
||||||
|
|
||||||
|
void enable_global_speedup(float rate);
|
||||||
|
void disable_global_speedup();
|
||||||
|
|
||||||
void enable_gg_factor();
|
void enable_gg_factor();
|
||||||
void disable_gg_factor();
|
void disable_gg_factor();
|
||||||
void update_gg_factor(double factor);
|
void update_gg_factor(double factor);
|
||||||
@@ -156,8 +160,6 @@ private:
|
|||||||
sol::state_view m_state;
|
sol::state_view m_state;
|
||||||
struct {
|
struct {
|
||||||
Lua::Function Ship_getShipProperties;
|
Lua::Function Ship_getShipProperties;
|
||||||
double ChapterConst_ShipStepDuration;
|
|
||||||
double ChapterConst_ShipStepQuickPlayScale;
|
|
||||||
Lua::Function WorldFleetSelectLayer_CheckValid;
|
Lua::Function WorldFleetSelectLayer_CheckValid;
|
||||||
Lua::Function BossSingleBattleFleetSelectSubPanel_CheckValid;
|
Lua::Function BossSingleBattleFleetSelectSubPanel_CheckValid;
|
||||||
Lua::Function Chapter_IsEliteFleetLegal;
|
Lua::Function Chapter_IsEliteFleetLegal;
|
||||||
@@ -166,7 +168,6 @@ private:
|
|||||||
Lua::Function ys_Battle_BattleManualWeaponAutoBot_SetActive;
|
Lua::Function ys_Battle_BattleManualWeaponAutoBot_SetActive;
|
||||||
Lua::Function Ship_cosumeEnergy;
|
Lua::Function Ship_cosumeEnergy;
|
||||||
Lua::Function Ship_getEnergy;
|
Lua::Function Ship_getEnergy;
|
||||||
double WorldConst_BaseMoveDuration;
|
|
||||||
Lua::Function Ship_intimacyAdditions;
|
Lua::Function Ship_intimacyAdditions;
|
||||||
} m_original;
|
} m_original;
|
||||||
struct {
|
struct {
|
||||||
|
|||||||
@@ -9,7 +9,9 @@ struct UnityEngine_Component_Fields : UnityEngine_Object_Fields {};
|
|||||||
|
|
||||||
struct UnityEngine_Behaviour_Fields : UnityEngine_Component_Fields {};
|
struct UnityEngine_Behaviour_Fields : UnityEngine_Component_Fields {};
|
||||||
|
|
||||||
struct UnityEngine_MonoBehaviour_Fields : UnityEngine_Behaviour_Fields {};
|
struct UnityEngine_MonoBehaviour_Fields : UnityEngine_Behaviour_Fields {
|
||||||
|
void* m_CancellationTokenSource; // struct System_Threading_CancellationTokenSource_o* m_CancellationTokenSource;
|
||||||
|
};
|
||||||
|
|
||||||
struct LuaInterface_LuaStatePtr_Fields {
|
struct LuaInterface_LuaStatePtr_Fields {
|
||||||
intptr_t L;
|
intptr_t L;
|
||||||
|
|||||||
@@ -603,6 +603,34 @@ CrackerServer::CrackerServer() {
|
|||||||
res.status = 200;
|
res.status = 200;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Post("/enable_global_speedup", [](const httplib::Request& req, httplib::Response& res) {
|
||||||
|
try {
|
||||||
|
Json::Reader reader;
|
||||||
|
Json::Value j;
|
||||||
|
reader.parse(req.body, j);
|
||||||
|
Cracker::Instance().enable_global_speedup(j["rate"].asFloat());
|
||||||
|
} catch (std::exception& e) {
|
||||||
|
SPDLOG_ERROR("Enable global speedup failed: {}", e.what());
|
||||||
|
res.status = 500;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
res.status = 200;
|
||||||
|
});
|
||||||
|
|
||||||
|
Post("/disable_global_speedup", [](const httplib::Request& req, httplib::Response& res) {
|
||||||
|
try {
|
||||||
|
Json::Reader reader;
|
||||||
|
Json::Value j;
|
||||||
|
reader.parse(req.body, j);
|
||||||
|
Cracker::Instance().disable_global_speedup();
|
||||||
|
} catch (std::exception& e) {
|
||||||
|
SPDLOG_ERROR("Disable global speedup failed: {}", e.what());
|
||||||
|
res.status = 500;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
res.status = 200;
|
||||||
|
});
|
||||||
|
|
||||||
std::thread([this] {
|
std::thread([this] {
|
||||||
SPDLOG_INFO("Start server on port 23897");
|
SPDLOG_INFO("Start server on port 23897");
|
||||||
listen("0.0.0.0", 23897);
|
listen("0.0.0.0", 23897);
|
||||||
|
|||||||
@@ -89,5 +89,15 @@ POST http://127.0.0.1:23897/enable_opsi_fast_move
|
|||||||
###
|
###
|
||||||
POST http://127.0.0.1:23897/disable_opsi_fast_move
|
POST http://127.0.0.1:23897/disable_opsi_fast_move
|
||||||
|
|
||||||
|
###
|
||||||
|
POST http://127.0.0.1:23897/enable_global_speedup
|
||||||
|
|
||||||
|
{
|
||||||
|
"rate": 10.0
|
||||||
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
POST http://127.0.0.1:23897/disable_global_speedup
|
||||||
|
|
||||||
###
|
###
|
||||||
POST http://127.0.0.1:23897/is_alive
|
POST http://127.0.0.1:23897/is_alive
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
if (NOT DEFINED ENV{NDK_ROOT})
|
if (NOT DEFINED NDK_ROOT)
|
||||||
message(FATAL_ERROR "NDK_ROOT is not defined. Please set it to the root directory of your Android NDK.")
|
message(FATAL_ERROR "NDK_ROOT is not defined. Please set it to the root directory of your Android NDK.")
|
||||||
endif ()
|
endif ()
|
||||||
message(STATUS "Using Android NDK: $ENV{NDK_ROOT}")
|
message(STATUS "Using Android NDK: ${NDK_ROOT}")
|
||||||
if (NOT DEFINED ANDROID_ABI)
|
if (NOT DEFINED ANDROID_ABI)
|
||||||
message("ANDROID_ABI is not defined. Defaulting to x86")
|
message("ANDROID_ABI is not defined. Defaulting to x86")
|
||||||
set(ANDROID_ABI x86)
|
set(ANDROID_ABI x86)
|
||||||
endif ()
|
endif ()
|
||||||
set(CMAKE_TOOLCHAIN_FILE $ENV{NDK_ROOT}/build/cmake/android.toolchain.cmake)
|
set(CMAKE_TOOLCHAIN_FILE ${NDK_ROOT}/build/cmake/android.toolchain.cmake)
|
||||||
@@ -1,4 +1,89 @@
|
|||||||
{
|
{
|
||||||
|
"Dashboard": {
|
||||||
|
"Oil": {
|
||||||
|
"Value": 0,
|
||||||
|
"Limit": 0,
|
||||||
|
"Color": "^000000",
|
||||||
|
"Record": "2020-01-01 00:00:00"
|
||||||
|
},
|
||||||
|
"Coin": {
|
||||||
|
"Value": 0,
|
||||||
|
"Limit": 0,
|
||||||
|
"Color": "^FFAA33",
|
||||||
|
"Record": "2020-01-01 00:00:00"
|
||||||
|
},
|
||||||
|
"Gem": {
|
||||||
|
"Value": 0,
|
||||||
|
"Color": "^FF3333",
|
||||||
|
"Record": "2020-01-01 00:00:00"
|
||||||
|
},
|
||||||
|
"Pt": {
|
||||||
|
"Value": 0,
|
||||||
|
"Color": "^00BFFF",
|
||||||
|
"Record": "2020-01-01 00:00:00"
|
||||||
|
},
|
||||||
|
"Cube": {
|
||||||
|
"Value": 0,
|
||||||
|
"Color": "^33FFFF",
|
||||||
|
"Record": "2020-01-01 00:00:00"
|
||||||
|
},
|
||||||
|
"ActionPoint": {
|
||||||
|
"Value": 0,
|
||||||
|
"Total": 0,
|
||||||
|
"Color": "^0000FF",
|
||||||
|
"Record": "2020-01-01 00:00:00"
|
||||||
|
},
|
||||||
|
"YellowCoin": {
|
||||||
|
"Value": 0,
|
||||||
|
"Color": "^FF8800",
|
||||||
|
"Record": "2020-01-01 00:00:00"
|
||||||
|
},
|
||||||
|
"PurpleCoin": {
|
||||||
|
"Value": 0,
|
||||||
|
"Color": "^7700BB",
|
||||||
|
"Record": "2020-01-01 00:00:00"
|
||||||
|
},
|
||||||
|
"Core": {
|
||||||
|
"Value": 0,
|
||||||
|
"Color": "^AAAAAA",
|
||||||
|
"Record": "2020-01-01 00:00:00"
|
||||||
|
},
|
||||||
|
"Medal": {
|
||||||
|
"Value": 0,
|
||||||
|
"Color": "^FFDD00",
|
||||||
|
"Record": "2020-01-01 00:00:00"
|
||||||
|
},
|
||||||
|
"Merit": {
|
||||||
|
"Value": 0,
|
||||||
|
"Color": "^FFFF00",
|
||||||
|
"Record": "2020-01-01 00:00:00"
|
||||||
|
},
|
||||||
|
"GuildCoin": {
|
||||||
|
"Value": 0,
|
||||||
|
"Color": "^AAAAAA",
|
||||||
|
"Record": "2020-01-01 00:00:00"
|
||||||
|
},
|
||||||
|
"ResearchPercent": {
|
||||||
|
"Value": 0,
|
||||||
|
"Limit": 100,
|
||||||
|
"Color": "^00AA00",
|
||||||
|
"Record": "2020-01-01 00:00:00"
|
||||||
|
},
|
||||||
|
"PlayerLevel": {
|
||||||
|
"Value": 0,
|
||||||
|
"Color": "^FFAA33",
|
||||||
|
"Record": "2020-01-01 00:00:00"
|
||||||
|
},
|
||||||
|
"PlayerExp": {
|
||||||
|
"Value": 0,
|
||||||
|
"Limit": 0,
|
||||||
|
"Color": "^FFAA33",
|
||||||
|
"Record": "2020-01-01 00:00:00"
|
||||||
|
},
|
||||||
|
"Storage": {
|
||||||
|
"Storage": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
"Alas": {
|
"Alas": {
|
||||||
"Emulator": {
|
"Emulator": {
|
||||||
"Serial": "auto",
|
"Serial": "auto",
|
||||||
@@ -137,6 +222,7 @@
|
|||||||
"GameLibDir": null
|
"GameLibDir": null
|
||||||
},
|
},
|
||||||
"Misc": {
|
"Misc": {
|
||||||
|
"GlobalSpeedup": 1.0,
|
||||||
"ChapterMove": false,
|
"ChapterMove": false,
|
||||||
"OpsiMove": false,
|
"OpsiMove": false,
|
||||||
"RemoveHardMapLimit": "disable",
|
"RemoveHardMapLimit": "disable",
|
||||||
@@ -3137,6 +3223,12 @@
|
|||||||
"Raid": 16500,
|
"Raid": 16500,
|
||||||
"Ash": 16500
|
"Ash": 16500
|
||||||
},
|
},
|
||||||
|
"SpeedUp": {
|
||||||
|
"Enable": false,
|
||||||
|
"PushLua": false,
|
||||||
|
"Timeout": 600,
|
||||||
|
"Rate": 5
|
||||||
|
},
|
||||||
"ChangeShip": {
|
"ChangeShip": {
|
||||||
"Enable": false,
|
"Enable": false,
|
||||||
"PushLua": false,
|
"PushLua": false,
|
||||||
|
|||||||
@@ -270,41 +270,55 @@ class CampaignUI(MapOperation, CampaignEvent, CampaignOcr):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def campaign_set_chapter_20241219(self, chapter, stage, mode='combat'):
|
def campaign_set_chapter_20241219(self, chapter, stage, mode='combat'):
|
||||||
if not self.config.MAP_CHAPTER_SWITCH_20241219:
|
if self.config.MAP_CHAPTER_SWITCH_20241219:
|
||||||
return False
|
if self._campaign_name_is_hard(f'{chapter}{stage}'):
|
||||||
|
self.config.override(Campaign_Mode='hard')
|
||||||
if self._campaign_name_is_hard(f'{chapter}{stage}'):
|
# part1, part2, sp, ex
|
||||||
self.config.override(Campaign_Mode='hard')
|
if mode == 'story':
|
||||||
|
self.campaign_ensure_mode_20241219('story')
|
||||||
if mode == 'story':
|
return True
|
||||||
self.campaign_ensure_mode_20241219('story')
|
if chapter in ['a', 'c', 't']:
|
||||||
return True
|
self.ui_goto_event()
|
||||||
if chapter in ['a', 'c', 't']:
|
self.campaign_ensure_mode_20241219('combat')
|
||||||
self.ui_goto_event()
|
self.campaign_ensure_aside_20241219('part1')
|
||||||
self.campaign_ensure_mode_20241219('combat')
|
self.campaign_ensure_chapter(chapter)
|
||||||
self.campaign_ensure_aside_20241219('part1')
|
return True
|
||||||
self.campaign_ensure_chapter(chapter)
|
if chapter in ['b', 'd', 'ttl']:
|
||||||
return True
|
self.ui_goto_event()
|
||||||
if chapter in ['b', 'd', 'ttl']:
|
self.campaign_ensure_mode_20241219('combat')
|
||||||
self.ui_goto_event()
|
self.campaign_ensure_aside_20241219('part2')
|
||||||
self.campaign_ensure_mode_20241219('combat')
|
self.campaign_ensure_chapter(chapter)
|
||||||
self.campaign_ensure_aside_20241219('part2')
|
return True
|
||||||
self.campaign_ensure_chapter(chapter)
|
if chapter in ['ex_sp']:
|
||||||
return True
|
self.ui_goto_event()
|
||||||
if chapter in ['ex_sp']:
|
self.campaign_ensure_mode_20241219('combat')
|
||||||
self.ui_goto_event()
|
self.campaign_ensure_aside_20241219('sp')
|
||||||
self.campaign_ensure_mode_20241219('combat')
|
self.campaign_ensure_chapter(chapter)
|
||||||
self.campaign_ensure_aside_20241219('sp')
|
return True
|
||||||
self.campaign_ensure_chapter(chapter)
|
if chapter in ['ex_ex']:
|
||||||
return True
|
self.ui_goto_event()
|
||||||
if chapter in ['ex_ex']:
|
self.campaign_ensure_mode_20241219('combat')
|
||||||
self.ui_goto_event()
|
self.campaign_ensure_aside_20241219('ex')
|
||||||
self.campaign_ensure_mode_20241219('combat')
|
self.campaign_ensure_chapter(chapter)
|
||||||
self.campaign_ensure_aside_20241219('ex')
|
return True
|
||||||
self.campaign_ensure_chapter(chapter)
|
if self.config.MAP_CHAPTER_SWITCH_20241219_SP:
|
||||||
return True
|
if self._campaign_name_is_hard(f'{chapter}{stage}'):
|
||||||
else:
|
self.config.override(Campaign_Mode='hard')
|
||||||
return False
|
# (empty), normal, sp, (empty)
|
||||||
|
if chapter in ['sp', 't', 'ht']:
|
||||||
|
self.ui_goto_event()
|
||||||
|
self.campaign_ensure_mode_20241219('combat')
|
||||||
|
# normal is on the position of part2
|
||||||
|
self.campaign_ensure_aside_20241219('part2')
|
||||||
|
self.campaign_ensure_chapter(chapter)
|
||||||
|
return True
|
||||||
|
if chapter in ['ex_sp']:
|
||||||
|
self.ui_goto_event()
|
||||||
|
self.campaign_ensure_mode_20241219('combat')
|
||||||
|
self.campaign_ensure_aside_20241219('sp')
|
||||||
|
self.campaign_ensure_chapter(chapter)
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def campaign_set_chapter(self, name, mode='normal'):
|
def campaign_set_chapter(self, name, mode='normal'):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -265,6 +265,7 @@ class CampaignRun(CampaignEvent, ShopStatus):
|
|||||||
'event_20240829_cn',
|
'event_20240829_cn',
|
||||||
'event_20241024_cn',
|
'event_20241024_cn',
|
||||||
'event_20241121_cn',
|
'event_20241121_cn',
|
||||||
|
'event_20250424_cn',
|
||||||
]:
|
]:
|
||||||
name = convert.get(name, name)
|
name = convert.get(name, name)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -1,4 +1,274 @@
|
|||||||
{
|
{
|
||||||
|
"Dashboard": {
|
||||||
|
"Oil": {
|
||||||
|
"Value": {
|
||||||
|
"type": "input",
|
||||||
|
"value": 0
|
||||||
|
},
|
||||||
|
"Limit": {
|
||||||
|
"type": "input",
|
||||||
|
"value": 0
|
||||||
|
},
|
||||||
|
"Color": {
|
||||||
|
"type": "input",
|
||||||
|
"value": "^000000",
|
||||||
|
"display": "hide"
|
||||||
|
},
|
||||||
|
"Record": {
|
||||||
|
"type": "datetime",
|
||||||
|
"value": "2020-01-01 00:00:00",
|
||||||
|
"validate": "datetime"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Coin": {
|
||||||
|
"Value": {
|
||||||
|
"type": "input",
|
||||||
|
"value": 0
|
||||||
|
},
|
||||||
|
"Limit": {
|
||||||
|
"type": "input",
|
||||||
|
"value": 0
|
||||||
|
},
|
||||||
|
"Color": {
|
||||||
|
"type": "input",
|
||||||
|
"value": "^FFAA33",
|
||||||
|
"display": "hide"
|
||||||
|
},
|
||||||
|
"Record": {
|
||||||
|
"type": "datetime",
|
||||||
|
"value": "2020-01-01 00:00:00",
|
||||||
|
"validate": "datetime"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Gem": {
|
||||||
|
"Value": {
|
||||||
|
"type": "input",
|
||||||
|
"value": 0
|
||||||
|
},
|
||||||
|
"Color": {
|
||||||
|
"type": "input",
|
||||||
|
"value": "^FF3333",
|
||||||
|
"display": "hide"
|
||||||
|
},
|
||||||
|
"Record": {
|
||||||
|
"type": "datetime",
|
||||||
|
"value": "2020-01-01 00:00:00",
|
||||||
|
"validate": "datetime"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Pt": {
|
||||||
|
"Value": {
|
||||||
|
"type": "input",
|
||||||
|
"value": 0
|
||||||
|
},
|
||||||
|
"Color": {
|
||||||
|
"type": "input",
|
||||||
|
"value": "^00BFFF",
|
||||||
|
"display": "hide"
|
||||||
|
},
|
||||||
|
"Record": {
|
||||||
|
"type": "datetime",
|
||||||
|
"value": "2020-01-01 00:00:00",
|
||||||
|
"validate": "datetime"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Cube": {
|
||||||
|
"Value": {
|
||||||
|
"type": "input",
|
||||||
|
"value": 0
|
||||||
|
},
|
||||||
|
"Color": {
|
||||||
|
"type": "input",
|
||||||
|
"value": "^33FFFF",
|
||||||
|
"display": "hide"
|
||||||
|
},
|
||||||
|
"Record": {
|
||||||
|
"type": "datetime",
|
||||||
|
"value": "2020-01-01 00:00:00",
|
||||||
|
"validate": "datetime"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ActionPoint": {
|
||||||
|
"Value": {
|
||||||
|
"type": "input",
|
||||||
|
"value": 0
|
||||||
|
},
|
||||||
|
"Total": {
|
||||||
|
"type": "input",
|
||||||
|
"value": 0
|
||||||
|
},
|
||||||
|
"Color": {
|
||||||
|
"type": "input",
|
||||||
|
"value": "^0000FF",
|
||||||
|
"display": "hide"
|
||||||
|
},
|
||||||
|
"Record": {
|
||||||
|
"type": "datetime",
|
||||||
|
"value": "2020-01-01 00:00:00",
|
||||||
|
"validate": "datetime"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"YellowCoin": {
|
||||||
|
"Value": {
|
||||||
|
"type": "input",
|
||||||
|
"value": 0
|
||||||
|
},
|
||||||
|
"Color": {
|
||||||
|
"type": "input",
|
||||||
|
"value": "^FF8800",
|
||||||
|
"display": "hide"
|
||||||
|
},
|
||||||
|
"Record": {
|
||||||
|
"type": "datetime",
|
||||||
|
"value": "2020-01-01 00:00:00",
|
||||||
|
"validate": "datetime"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"PurpleCoin": {
|
||||||
|
"Value": {
|
||||||
|
"type": "input",
|
||||||
|
"value": 0
|
||||||
|
},
|
||||||
|
"Color": {
|
||||||
|
"type": "input",
|
||||||
|
"value": "^7700BB",
|
||||||
|
"display": "hide"
|
||||||
|
},
|
||||||
|
"Record": {
|
||||||
|
"type": "datetime",
|
||||||
|
"value": "2020-01-01 00:00:00",
|
||||||
|
"validate": "datetime"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Core": {
|
||||||
|
"Value": {
|
||||||
|
"type": "input",
|
||||||
|
"value": 0
|
||||||
|
},
|
||||||
|
"Color": {
|
||||||
|
"type": "input",
|
||||||
|
"value": "^AAAAAA",
|
||||||
|
"display": "hide"
|
||||||
|
},
|
||||||
|
"Record": {
|
||||||
|
"type": "datetime",
|
||||||
|
"value": "2020-01-01 00:00:00",
|
||||||
|
"validate": "datetime"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Medal": {
|
||||||
|
"Value": {
|
||||||
|
"type": "input",
|
||||||
|
"value": 0
|
||||||
|
},
|
||||||
|
"Color": {
|
||||||
|
"type": "input",
|
||||||
|
"value": "^FFDD00",
|
||||||
|
"display": "hide"
|
||||||
|
},
|
||||||
|
"Record": {
|
||||||
|
"type": "datetime",
|
||||||
|
"value": "2020-01-01 00:00:00",
|
||||||
|
"validate": "datetime"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Merit": {
|
||||||
|
"Value": {
|
||||||
|
"type": "input",
|
||||||
|
"value": 0
|
||||||
|
},
|
||||||
|
"Color": {
|
||||||
|
"type": "input",
|
||||||
|
"value": "^FFFF00",
|
||||||
|
"display": "hide"
|
||||||
|
},
|
||||||
|
"Record": {
|
||||||
|
"type": "datetime",
|
||||||
|
"value": "2020-01-01 00:00:00",
|
||||||
|
"validate": "datetime"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"GuildCoin": {
|
||||||
|
"Value": {
|
||||||
|
"type": "input",
|
||||||
|
"value": 0
|
||||||
|
},
|
||||||
|
"Color": {
|
||||||
|
"type": "input",
|
||||||
|
"value": "^AAAAAA",
|
||||||
|
"display": "hide"
|
||||||
|
},
|
||||||
|
"Record": {
|
||||||
|
"type": "datetime",
|
||||||
|
"value": "2020-01-01 00:00:00",
|
||||||
|
"validate": "datetime"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ResearchPercent": {
|
||||||
|
"Value": {
|
||||||
|
"type": "input",
|
||||||
|
"value": 0
|
||||||
|
},
|
||||||
|
"Limit": {
|
||||||
|
"type": "input",
|
||||||
|
"value": 100
|
||||||
|
},
|
||||||
|
"Color": {
|
||||||
|
"type": "input",
|
||||||
|
"value": "^00AA00",
|
||||||
|
"display": "hide"
|
||||||
|
},
|
||||||
|
"Record": {
|
||||||
|
"type": "datetime",
|
||||||
|
"value": "2020-01-01 00:00:00",
|
||||||
|
"validate": "datetime"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"PlayerLevel": {
|
||||||
|
"Value": {
|
||||||
|
"type": "input",
|
||||||
|
"value": 0
|
||||||
|
},
|
||||||
|
"Color": {
|
||||||
|
"type": "input",
|
||||||
|
"value": "^FFAA33",
|
||||||
|
"display": "hide"
|
||||||
|
},
|
||||||
|
"Record": {
|
||||||
|
"type": "datetime",
|
||||||
|
"value": "2020-01-01 00:00:00",
|
||||||
|
"validate": "datetime"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"PlayerExp": {
|
||||||
|
"Value": {
|
||||||
|
"type": "input",
|
||||||
|
"value": 0
|
||||||
|
},
|
||||||
|
"Limit": {
|
||||||
|
"type": "input",
|
||||||
|
"value": 0
|
||||||
|
},
|
||||||
|
"Color": {
|
||||||
|
"type": "input",
|
||||||
|
"value": "^FFAA33",
|
||||||
|
"display": "hide"
|
||||||
|
},
|
||||||
|
"Record": {
|
||||||
|
"type": "datetime",
|
||||||
|
"value": "2020-01-01 00:00:00",
|
||||||
|
"validate": "datetime"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Storage": {
|
||||||
|
"Storage": {
|
||||||
|
"type": "storage",
|
||||||
|
"value": {},
|
||||||
|
"valuetype": "ignore",
|
||||||
|
"display": "disabled"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"Alas": {
|
"Alas": {
|
||||||
"Emulator": {
|
"Emulator": {
|
||||||
"Serial": {
|
"Serial": {
|
||||||
@@ -607,6 +877,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Misc": {
|
"Misc": {
|
||||||
|
"GlobalSpeedup": {
|
||||||
|
"type": "input",
|
||||||
|
"value": 1.0
|
||||||
|
},
|
||||||
"ChapterMove": {
|
"ChapterMove": {
|
||||||
"type": "checkbox",
|
"type": "checkbox",
|
||||||
"value": false
|
"value": false
|
||||||
@@ -15777,6 +16051,24 @@
|
|||||||
"value": 16500
|
"value": 16500
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"SpeedUp": {
|
||||||
|
"Enable": {
|
||||||
|
"type": "checkbox",
|
||||||
|
"value": false
|
||||||
|
},
|
||||||
|
"PushLua": {
|
||||||
|
"type": "checkbox",
|
||||||
|
"value": false
|
||||||
|
},
|
||||||
|
"Timeout": {
|
||||||
|
"type": "input",
|
||||||
|
"value": 600
|
||||||
|
},
|
||||||
|
"Rate": {
|
||||||
|
"type": "input",
|
||||||
|
"value": 5
|
||||||
|
}
|
||||||
|
},
|
||||||
"ChangeShip": {
|
"ChangeShip": {
|
||||||
"Enable": {
|
"Enable": {
|
||||||
"type": "checkbox",
|
"type": "checkbox",
|
||||||
|
|||||||
@@ -197,6 +197,7 @@ FakePlayer:
|
|||||||
Level: ""
|
Level: ""
|
||||||
Id: ""
|
Id: ""
|
||||||
Misc:
|
Misc:
|
||||||
|
GlobalSpeedup: 1.0
|
||||||
ChapterMove: false
|
ChapterMove: false
|
||||||
OpsiMove: false
|
OpsiMove: false
|
||||||
RemoveHardMapLimit:
|
RemoveHardMapLimit:
|
||||||
@@ -1102,7 +1103,11 @@ ChangeAttribute:
|
|||||||
ShipData:
|
ShipData:
|
||||||
type: textarea
|
type: textarea
|
||||||
value: ''
|
value: ''
|
||||||
|
SpeedUp:
|
||||||
|
Enable: false
|
||||||
|
PushLua: false
|
||||||
|
Timeout: 600
|
||||||
|
Rate: 5
|
||||||
InfiniteDelay:
|
InfiniteDelay:
|
||||||
Commission:
|
Commission:
|
||||||
value: false
|
value: false
|
||||||
|
|||||||
@@ -60,11 +60,3 @@ Freebies:
|
|||||||
# ==================== Opsi ====================
|
# ==================== Opsi ====================
|
||||||
|
|
||||||
# ==================== ChangeShip ====================
|
# ==================== ChangeShip ====================
|
||||||
ChangeShip:
|
|
||||||
ShipData:
|
|
||||||
ShipData: |
|
|
||||||
106021;1;6
|
|
||||||
107041;1;6
|
|
||||||
206011;1;6
|
|
||||||
107011;1;6
|
|
||||||
|
|
||||||
|
|||||||
@@ -514,16 +514,7 @@ EventStory:
|
|||||||
option: [ true, ]
|
option: [ true, ]
|
||||||
option_bold: [ true, ]
|
option_bold: [ true, ]
|
||||||
|
|
||||||
# ==================== GGHandler ====================
|
# ==================== GameManager ====================
|
||||||
GGHandler:
|
|
||||||
Timeout:
|
|
||||||
value: 1200
|
|
||||||
ChangeShip:
|
|
||||||
Timeout:
|
|
||||||
value: 90
|
|
||||||
ChangeAttribute:
|
|
||||||
Timeout:
|
|
||||||
value: 600
|
|
||||||
|
|
||||||
# ==================== Dashboard ====================
|
# ==================== Dashboard ====================
|
||||||
Dashboard:
|
Dashboard:
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ Alas:
|
|||||||
- OldRetire
|
- OldRetire
|
||||||
Restart:
|
Restart:
|
||||||
- Scheduler
|
- Scheduler
|
||||||
- RestartEmulator
|
|
||||||
- AutoRestart
|
- AutoRestart
|
||||||
- InstanceRestart
|
- InstanceRestart
|
||||||
- ExitWhenMaintenance
|
- ExitWhenMaintenance
|
||||||
@@ -493,6 +492,7 @@ Tool:
|
|||||||
- GameManager
|
- GameManager
|
||||||
- GGHandler
|
- GGHandler
|
||||||
- PowerLimit
|
- PowerLimit
|
||||||
|
- SpeedUp
|
||||||
- ChangeShip
|
- ChangeShip
|
||||||
- ChangeAttribute
|
- ChangeAttribute
|
||||||
SomethingSpecial:
|
SomethingSpecial:
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ class GeneratedConfig:
|
|||||||
FakePlayer_Id = None
|
FakePlayer_Id = None
|
||||||
|
|
||||||
# Group `Misc`
|
# Group `Misc`
|
||||||
|
Misc_GlobalSpeedup = 1.0
|
||||||
Misc_ChapterMove = False
|
Misc_ChapterMove = False
|
||||||
Misc_OpsiMove = False
|
Misc_OpsiMove = False
|
||||||
Misc_RemoveHardMapLimit = 'disable' # disable, remove_ship_properties_limit, remove_ship_type_limit, remove_both
|
Misc_RemoveHardMapLimit = 'disable' # disable, remove_ship_properties_limit, remove_ship_type_limit, remove_both
|
||||||
@@ -647,6 +648,12 @@ class GeneratedConfig:
|
|||||||
ChangeAttribute_Timeout = 600
|
ChangeAttribute_Timeout = 600
|
||||||
ChangeAttribute_ShipData = None
|
ChangeAttribute_ShipData = None
|
||||||
|
|
||||||
|
# Group `SpeedUp`
|
||||||
|
SpeedUp_Enable = False
|
||||||
|
SpeedUp_PushLua = False
|
||||||
|
SpeedUp_Timeout = 600
|
||||||
|
SpeedUp_Rate = 5
|
||||||
|
|
||||||
# Group `InfiniteDelay`
|
# Group `InfiniteDelay`
|
||||||
InfiniteDelay_Commission = False
|
InfiniteDelay_Commission = False
|
||||||
InfiniteDelay_Research = False
|
InfiniteDelay_Research = False
|
||||||
|
|||||||
@@ -119,6 +119,7 @@ class ManualConfig:
|
|||||||
MAP_HAS_MODE_SWITCH = False # event_20240725_cn has mode switch in map preparation
|
MAP_HAS_MODE_SWITCH = False # event_20240725_cn has mode switch in map preparation
|
||||||
# Events from 20240725 to 20241219 introduced new chapter switches
|
# Events from 20240725 to 20241219 introduced new chapter switches
|
||||||
MAP_CHAPTER_SWITCH_20241219 = False
|
MAP_CHAPTER_SWITCH_20241219 = False
|
||||||
|
MAP_CHAPTER_SWITCH_20241219_SP = False
|
||||||
# Since event_20241219_cn chapter B unlocks event startup
|
# Since event_20241219_cn chapter B unlocks event startup
|
||||||
# which means chapter AB are continuous
|
# which means chapter AB are continuous
|
||||||
STAGE_INCREASE_AB = False
|
STAGE_INCREASE_AB = False
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ class ConfigGenerator:
|
|||||||
data = {}
|
data = {}
|
||||||
# Add dashboard to args
|
# Add dashboard to args
|
||||||
dashboard_and_task = {**self.task, **self.dashboard}
|
dashboard_and_task = {**self.task, **self.dashboard}
|
||||||
for path, groups in deep_iter(dashboard_and_task, depth=3):
|
for path, groups in deep_iter(dashboard_and_task, min_depth=1, depth=3):
|
||||||
if 'tasks' not in path and 'Dashboard' not in path:
|
if 'tasks' not in path and 'Dashboard' not in path:
|
||||||
continue
|
continue
|
||||||
task = path[2] if 'tasks' in path else path[0]
|
task = path[2] if 'tasks' in path else path[0]
|
||||||
|
|||||||
@@ -924,6 +924,10 @@
|
|||||||
"name": "Misc._info.name",
|
"name": "Misc._info.name",
|
||||||
"help": "Misc._info.help"
|
"help": "Misc._info.help"
|
||||||
},
|
},
|
||||||
|
"GlobalSpeedup": {
|
||||||
|
"name": "Misc.GlobalSpeedup.name",
|
||||||
|
"help": "Misc.GlobalSpeedup.help"
|
||||||
|
},
|
||||||
"ChapterMove": {
|
"ChapterMove": {
|
||||||
"name": "Misc.ChapterMove.name",
|
"name": "Misc.ChapterMove.name",
|
||||||
"help": "Misc.ChapterMove.help"
|
"help": "Misc.ChapterMove.help"
|
||||||
@@ -3732,6 +3736,28 @@
|
|||||||
"help": "ChangeAttribute.ShipData.help"
|
"help": "ChangeAttribute.ShipData.help"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"SpeedUp": {
|
||||||
|
"_info": {
|
||||||
|
"name": "SpeedUp._info.name",
|
||||||
|
"help": "SpeedUp._info.help"
|
||||||
|
},
|
||||||
|
"Enable": {
|
||||||
|
"name": "SpeedUp.Enable.name",
|
||||||
|
"help": "SpeedUp.Enable.help"
|
||||||
|
},
|
||||||
|
"PushLua": {
|
||||||
|
"name": "SpeedUp.PushLua.name",
|
||||||
|
"help": "SpeedUp.PushLua.help"
|
||||||
|
},
|
||||||
|
"Timeout": {
|
||||||
|
"name": "SpeedUp.Timeout.name",
|
||||||
|
"help": "SpeedUp.Timeout.help"
|
||||||
|
},
|
||||||
|
"Rate": {
|
||||||
|
"name": "SpeedUp.Rate.name",
|
||||||
|
"help": "SpeedUp.Rate.help"
|
||||||
|
}
|
||||||
|
},
|
||||||
"InfiniteDelay": {
|
"InfiniteDelay": {
|
||||||
"_info": {
|
"_info": {
|
||||||
"name": "InfiniteDelay._info.name",
|
"name": "InfiniteDelay._info.name",
|
||||||
|
|||||||
@@ -924,6 +924,10 @@
|
|||||||
"name": "Misc._info.name",
|
"name": "Misc._info.name",
|
||||||
"help": "Misc._info.help"
|
"help": "Misc._info.help"
|
||||||
},
|
},
|
||||||
|
"GlobalSpeedup": {
|
||||||
|
"name": "Misc.GlobalSpeedup.name",
|
||||||
|
"help": "Misc.GlobalSpeedup.help"
|
||||||
|
},
|
||||||
"ChapterMove": {
|
"ChapterMove": {
|
||||||
"name": "Misc.ChapterMove.name",
|
"name": "Misc.ChapterMove.name",
|
||||||
"help": "Misc.ChapterMove.help"
|
"help": "Misc.ChapterMove.help"
|
||||||
@@ -3732,6 +3736,28 @@
|
|||||||
"help": "ChangeAttribute.ShipData.help"
|
"help": "ChangeAttribute.ShipData.help"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"SpeedUp": {
|
||||||
|
"_info": {
|
||||||
|
"name": "SpeedUp._info.name",
|
||||||
|
"help": "SpeedUp._info.help"
|
||||||
|
},
|
||||||
|
"Enable": {
|
||||||
|
"name": "SpeedUp.Enable.name",
|
||||||
|
"help": "SpeedUp.Enable.help"
|
||||||
|
},
|
||||||
|
"PushLua": {
|
||||||
|
"name": "SpeedUp.PushLua.name",
|
||||||
|
"help": "SpeedUp.PushLua.help"
|
||||||
|
},
|
||||||
|
"Timeout": {
|
||||||
|
"name": "SpeedUp.Timeout.name",
|
||||||
|
"help": "SpeedUp.Timeout.help"
|
||||||
|
},
|
||||||
|
"Rate": {
|
||||||
|
"name": "SpeedUp.Rate.name",
|
||||||
|
"help": "SpeedUp.Rate.help"
|
||||||
|
}
|
||||||
|
},
|
||||||
"InfiniteDelay": {
|
"InfiniteDelay": {
|
||||||
"_info": {
|
"_info": {
|
||||||
"name": "InfiniteDelay._info.name",
|
"name": "InfiniteDelay._info.name",
|
||||||
|
|||||||
@@ -924,6 +924,10 @@
|
|||||||
"name": "杂项",
|
"name": "杂项",
|
||||||
"help": ""
|
"help": ""
|
||||||
},
|
},
|
||||||
|
"GlobalSpeedup": {
|
||||||
|
"name": "全局加速",
|
||||||
|
"help": "1表示不使用,不要开太高!"
|
||||||
|
},
|
||||||
"ChapterMove": {
|
"ChapterMove": {
|
||||||
"name": "章节图移动加速",
|
"name": "章节图移动加速",
|
||||||
"help": ""
|
"help": ""
|
||||||
@@ -3732,6 +3736,28 @@
|
|||||||
"help": "格式为\"舰船Id;舰船星级;类型Id:属性>目标值[;属性>目标值...]\"\n参考https://github.com/0O0o0oOoO00/SmallKai中的数据"
|
"help": "格式为\"舰船Id;舰船星级;类型Id:属性>目标值[;属性>目标值...]\"\n参考https://github.com/0O0o0oOoO00/SmallKai中的数据"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"SpeedUp": {
|
||||||
|
"_info": {
|
||||||
|
"name": "全局倍速",
|
||||||
|
"help": "需要和倍率一起使用"
|
||||||
|
},
|
||||||
|
"Enable": {
|
||||||
|
"name": "启用",
|
||||||
|
"help": ""
|
||||||
|
},
|
||||||
|
"PushLua": {
|
||||||
|
"name": "始终推送Lua",
|
||||||
|
"help": "有时推送时会失败,视情况开启或者关闭"
|
||||||
|
},
|
||||||
|
"Timeout": {
|
||||||
|
"name": "时限(秒)",
|
||||||
|
"help": "该项目的时限,该项数值与其他项目之和不得大于gg的"
|
||||||
|
},
|
||||||
|
"Rate": {
|
||||||
|
"name": "速率",
|
||||||
|
"help": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
"InfiniteDelay": {
|
"InfiniteDelay": {
|
||||||
"_info": {
|
"_info": {
|
||||||
"name": "无限推迟",
|
"name": "无限推迟",
|
||||||
|
|||||||
@@ -924,6 +924,10 @@
|
|||||||
"name": "Misc._info.name",
|
"name": "Misc._info.name",
|
||||||
"help": "Misc._info.help"
|
"help": "Misc._info.help"
|
||||||
},
|
},
|
||||||
|
"GlobalSpeedup": {
|
||||||
|
"name": "Misc.GlobalSpeedup.name",
|
||||||
|
"help": "Misc.GlobalSpeedup.help"
|
||||||
|
},
|
||||||
"ChapterMove": {
|
"ChapterMove": {
|
||||||
"name": "Misc.ChapterMove.name",
|
"name": "Misc.ChapterMove.name",
|
||||||
"help": "Misc.ChapterMove.help"
|
"help": "Misc.ChapterMove.help"
|
||||||
@@ -3732,6 +3736,28 @@
|
|||||||
"help": "ChangeAttribute.ShipData.help"
|
"help": "ChangeAttribute.ShipData.help"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"SpeedUp": {
|
||||||
|
"_info": {
|
||||||
|
"name": "SpeedUp._info.name",
|
||||||
|
"help": "SpeedUp._info.help"
|
||||||
|
},
|
||||||
|
"Enable": {
|
||||||
|
"name": "SpeedUp.Enable.name",
|
||||||
|
"help": "SpeedUp.Enable.help"
|
||||||
|
},
|
||||||
|
"PushLua": {
|
||||||
|
"name": "SpeedUp.PushLua.name",
|
||||||
|
"help": "SpeedUp.PushLua.help"
|
||||||
|
},
|
||||||
|
"Timeout": {
|
||||||
|
"name": "SpeedUp.Timeout.name",
|
||||||
|
"help": "SpeedUp.Timeout.help"
|
||||||
|
},
|
||||||
|
"Rate": {
|
||||||
|
"name": "SpeedUp.Rate.name",
|
||||||
|
"help": "SpeedUp.Rate.help"
|
||||||
|
}
|
||||||
|
},
|
||||||
"InfiniteDelay": {
|
"InfiniteDelay": {
|
||||||
"_info": {
|
"_info": {
|
||||||
"name": "InfiniteDelay._info.name",
|
"name": "InfiniteDelay._info.name",
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ class GGHandler:
|
|||||||
self.handle_u2_restart()
|
self.handle_u2_restart()
|
||||||
success = self.change_attribute()
|
success = self.change_attribute()
|
||||||
success = self.multiplier() and success
|
success = self.multiplier() and success
|
||||||
|
success = self.speed_up() and success
|
||||||
# if not success:
|
# if not success:
|
||||||
# from module.exception import GameStuckError
|
# from module.exception import GameStuckError
|
||||||
# raise GameStuckError
|
# raise GameStuckError
|
||||||
@@ -350,6 +351,18 @@ class GGHandler:
|
|||||||
# self.gg.set_on('change_attribute')
|
# self.gg.set_on('change_attribute')
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def speed_up(self):
|
||||||
|
if not deep_get(self.config.data, "GameManager.SpeedUp.Enable"):
|
||||||
|
return False
|
||||||
|
success = timeout(self.gg.set_on,
|
||||||
|
timeout_sec=deep_get(self.config.data, "GameManager.GGHandler.Timeout"),
|
||||||
|
func='speedup',
|
||||||
|
factor=self.factor)
|
||||||
|
self.GGData.set_data(target='gg_on', value=True)
|
||||||
|
|
||||||
|
# success = self.gg.set_on(factor=self.factor)
|
||||||
|
return True
|
||||||
|
|
||||||
def multiplier(self):
|
def multiplier(self):
|
||||||
logger.hr('GG Multiplier', level=2)
|
logger.hr('GG Multiplier', level=2)
|
||||||
success = timeout(self.gg.set_on,
|
success = timeout(self.gg.set_on,
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
from module.gg_handler.speedup import SpeedUp
|
||||||
from module.logger import logger
|
from module.logger import logger
|
||||||
from module.gg_handler.gg_data import GGData
|
from module.gg_handler.gg_data import GGData
|
||||||
from module.config.config import deep_get
|
from module.config.config import deep_get
|
||||||
@@ -34,7 +35,7 @@ class GGU2(Base):
|
|||||||
|
|
||||||
def set_on(self, func='multiplier', factor=200):
|
def set_on(self, func='multiplier', factor=200):
|
||||||
"""
|
"""
|
||||||
func : 'multiplier' or 'change_type' or 'change_attribute'
|
func : 'multiplier' or 'change_type' or 'change_attribute' or 'speedup'
|
||||||
factor : factor used in multiplier
|
factor : factor used in multiplier
|
||||||
"""
|
"""
|
||||||
_name_dict = {
|
_name_dict = {
|
||||||
@@ -160,6 +161,10 @@ class GGU2(Base):
|
|||||||
# self.d.app_stop(self.gg_package_name)
|
# self.d.app_stop(self.gg_package_name)
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
def speedup(self):
|
||||||
|
speedup = SpeedUp(self.config, self.device)
|
||||||
|
speedup.Run()
|
||||||
|
|
||||||
def multiplier(self):
|
def multiplier(self):
|
||||||
_run = False
|
_run = False
|
||||||
_set = False
|
_set = False
|
||||||
|
|||||||
81
module/gg_handler/speedup.py
Normal file
81
module/gg_handler/speedup.py
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
from module.gg_handler.gg_data import GGData
|
||||||
|
from module.logger import logger
|
||||||
|
from module.config.deep import deep_get, deep_set
|
||||||
|
from module.base.base import ModuleBase
|
||||||
|
import uiautomator2 as u2
|
||||||
|
|
||||||
|
|
||||||
|
class SpeedUp(ModuleBase):
|
||||||
|
|
||||||
|
def __init__(self, config, device):
|
||||||
|
super().__init__(config, device)
|
||||||
|
self.d = u2.connect(self.device.serial)
|
||||||
|
self.gg_package_name = deep_get(self.config.data, keys='GameManager.GGHandler.GGPackageName')
|
||||||
|
|
||||||
|
def Run(self):
|
||||||
|
_run = False
|
||||||
|
_set = False
|
||||||
|
_confirmed = False
|
||||||
|
import os
|
||||||
|
rate = float(deep_get(self.config.data, keys='GameManager.SpeedUp.Rate', default=5.0))
|
||||||
|
_repush = deep_get(self.config.data, keys='GameManager.SpeedUp.PushLua')
|
||||||
|
if _repush:
|
||||||
|
self.device.adb_shell("mkdir /sdcard/Notes")
|
||||||
|
self.device.sleep(0.5)
|
||||||
|
self.device.adb_shell("rm /sdcard/Notes/SpeedUp.lua")
|
||||||
|
self.device.sleep(0.5)
|
||||||
|
self.device.adb_push("bin/Lua/SpeedUp.lua", "/sdcard/Notes/SpeedUp.lua")
|
||||||
|
self.device.sleep(0.5)
|
||||||
|
logger.info('Lua Pushed')
|
||||||
|
while 1:
|
||||||
|
self.device.sleep(1)
|
||||||
|
if self.d(resourceId=f"{self.gg_package_name}:id/search_toolbar").exists:
|
||||||
|
self.d.xpath(
|
||||||
|
f'//*[@resource-id="{self.gg_package_name}'
|
||||||
|
f':id/search_toolbar"]/android.widget.ImageView[last()]'
|
||||||
|
).click()
|
||||||
|
logger.info('Click run Scripts')
|
||||||
|
self.device.sleep(0.3)
|
||||||
|
if self.d(resourceId=f"{self.gg_package_name}:id/file").exists:
|
||||||
|
self.d(resourceId=f"{self.gg_package_name}:id/file").send_keys("/sdcard/Notes/SpeedUp.lua")
|
||||||
|
logger.info('Lua path set')
|
||||||
|
if self.d.xpath('//*[@text="执行"]').exists:
|
||||||
|
self.d.xpath('//*[@text="执行"]').click()
|
||||||
|
logger.info('Click Run')
|
||||||
|
self.device.sleep(0.5)
|
||||||
|
if self.d.xpath('//*[contains(@text,"设置倍速")]').exists:
|
||||||
|
self.d.xpath('//*[contains(@text,"设置倍速")]').click()
|
||||||
|
logger.info('Click Change Statistic')
|
||||||
|
self.device.sleep(0.5)
|
||||||
|
if self.d(resourceId=f"{self.gg_package_name}:id/edit").exists:
|
||||||
|
self.d(resourceId=f"{self.gg_package_name}:id/edit").send_keys(f"{rate}")
|
||||||
|
logger.info(f'Factor Set: {rate}')
|
||||||
|
self.device.sleep(0.5)
|
||||||
|
_set = True
|
||||||
|
if _set and self.d.xpath('//*[@text="确定"]').exists:
|
||||||
|
self.d.xpath('//*[@text="确定"]').click()
|
||||||
|
logger.info("Click confirm")
|
||||||
|
self.device.sleep(0.5)
|
||||||
|
_confirmed = True
|
||||||
|
if _confirmed:
|
||||||
|
self.d.wait_timeout = deep_get(self.config.data, "GameManager.SpeedUp.Timeout")
|
||||||
|
logger.info(f'Xpath timeout set to {self.d.wait_timeout} seconds')
|
||||||
|
|
||||||
|
if _set and _confirmed:
|
||||||
|
try:
|
||||||
|
# GGData(self.config).set_data(target='gg_on', value=True)
|
||||||
|
self.d.xpath('//*[@text="确定"]').click()
|
||||||
|
except Exception as e:
|
||||||
|
pass
|
||||||
|
# GGData(self.config).set_data(target='gg_on', value=True)
|
||||||
|
logger.attr('GG', 'Enabled')
|
||||||
|
logger.info("Close the script")
|
||||||
|
self.d.wait_timeout = 3
|
||||||
|
logger.info(f'Xpath timeout set to {self.d.wait_timeout} seconds')
|
||||||
|
if _set and _confirmed:
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
return 0
|
||||||
|
logger.hr('GG Enabled: SpeedUp', level=2)
|
||||||
|
# self.d.app_stop(self.gg_package_name)
|
||||||
|
return 1
|
||||||
@@ -44,6 +44,9 @@ class CrackApi:
|
|||||||
exp: int
|
exp: int
|
||||||
curr_star: int
|
curr_star: int
|
||||||
|
|
||||||
|
class GlobalSpeedupRate(BaseModel):
|
||||||
|
rate: float
|
||||||
|
|
||||||
def __init__(self, base_url):
|
def __init__(self, base_url):
|
||||||
self.api_url = base_url
|
self.api_url = base_url
|
||||||
|
|
||||||
@@ -231,5 +234,11 @@ class CrackApi:
|
|||||||
def disable_opsi_fast_move(self):
|
def disable_opsi_fast_move(self):
|
||||||
self.post("disable_opsi_fast_move")
|
self.post("disable_opsi_fast_move")
|
||||||
|
|
||||||
|
def enable_global_speedup(self, rate: GlobalSpeedupRate):
|
||||||
|
self.post("enable_global_speedup", data=rate.json())
|
||||||
|
|
||||||
|
def disable_global_speedup(self):
|
||||||
|
self.post("disable_global_speedup")
|
||||||
|
|
||||||
def is_alive(self):
|
def is_alive(self):
|
||||||
self.post("is_alive")
|
self.post("is_alive")
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ ALL_ENABLE_OPS = [
|
|||||||
CrackOp.EnableRemoveHardModeShipTypeLimit,
|
CrackOp.EnableRemoveHardModeShipTypeLimit,
|
||||||
CrackOp.EnableRemoveHardModeShipPropertiesLimit,
|
CrackOp.EnableRemoveHardModeShipPropertiesLimit,
|
||||||
CrackOp.EnableGGFactor,
|
CrackOp.EnableGGFactor,
|
||||||
|
CrackOp.EnableGlobalSpeedup,
|
||||||
]
|
]
|
||||||
|
|
||||||
REMOTE_PORT = 23897
|
REMOTE_PORT = 23897
|
||||||
@@ -156,6 +157,13 @@ def do_crack_op(config: AzurLaneConfig, device: Device, ops: Union[Type[CrackOp.
|
|||||||
api.enable_gg_factor()
|
api.enable_gg_factor()
|
||||||
elif op == CrackOp.DisableGGFactor:
|
elif op == CrackOp.DisableGGFactor:
|
||||||
api.disable_gg_factor()
|
api.disable_gg_factor()
|
||||||
|
elif op == CrackOp.EnableGlobalSpeedup:
|
||||||
|
rate = float(deep_get(config.data, "Hook.Misc.GlobalSpeedup", 1.0))
|
||||||
|
if rate == 1.0:
|
||||||
|
continue
|
||||||
|
api.enable_global_speedup(CrackApi.GlobalSpeedupRate(rate=rate))
|
||||||
|
elif op == CrackOp.DisableGlobalSpeedup:
|
||||||
|
api.disable_global_speedup()
|
||||||
else:
|
else:
|
||||||
logger.error(f"Unsupported op: {op}")
|
logger.error(f"Unsupported op: {op}")
|
||||||
|
|
||||||
@@ -204,6 +212,7 @@ CHAPTER_CRACK_OPS = [
|
|||||||
CrackOp.EnableRemoveHardModeLimit,
|
CrackOp.EnableRemoveHardModeLimit,
|
||||||
CrackOp.EnableFakePlayer,
|
CrackOp.EnableFakePlayer,
|
||||||
CrackOp.EnableGGFactor,
|
CrackOp.EnableGGFactor,
|
||||||
|
CrackOp.EnableGlobalSpeedup,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@@ -222,6 +231,7 @@ OPSI_CRACK_OPS = [
|
|||||||
CrackOp.EnableGlobalShipProperties,
|
CrackOp.EnableGlobalShipProperties,
|
||||||
CrackOp.EnableFakePlayer,
|
CrackOp.EnableFakePlayer,
|
||||||
CrackOp.EnableGGFactor,
|
CrackOp.EnableGGFactor,
|
||||||
|
CrackOp.EnableGlobalSpeedup,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,12 @@ class CrackOp:
|
|||||||
class DisableFakePlayer(Op):
|
class DisableFakePlayer(Op):
|
||||||
...
|
...
|
||||||
|
|
||||||
|
class EnableGlobalSpeedup(Op):
|
||||||
|
...
|
||||||
|
|
||||||
|
class DisableGlobalSpeedup(Op):
|
||||||
|
...
|
||||||
|
|
||||||
class EnableNoBBAnimation(Op):
|
class EnableNoBBAnimation(Op):
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user