runhey 3 лет назад
Родитель
Сommit
95d5bb50c3

+ 1 - 0
.gitignore

@@ -24,6 +24,7 @@ test/
 *.user
 *.user
 !module/gui/FluentUI/fluentuiplugin.dll
 !module/gui/FluentUI/fluentuiplugin.dll
 build-fluentui-Desktop_*/
 build-fluentui-Desktop_*/
+module/config/argument/setting.json
 
 
 
 
 
 

+ 44 - 1446
config/template.json

@@ -1,1449 +1,47 @@
 {
 {
-  "Alas": {
-    "Emulator": {
-      "Serial": "auto",
-      "PackageName": "auto",
-      "ScreenshotMethod": "ADB",
-      "ControlMethod": "minitouch",
-      "ScreenshotDedithering": false,
-      "AdbRestart": false
-    },
-    "Error": {
-      "HandleError": true,
-      "SaveError": true,
-      "ScreenshotLength": 1
-    },
-    "Optimization": {
-      "ScreenshotInterval": 0.3,
-      "CombatScreenshotInterval": 1.0,
-      "TaskHoardingDuration": 0,
-      "WhenTaskQueueEmpty": "goto_main"
-    },
-    "DropRecord": {
-      "SaveFolder": "./screenshots",
-      "AzurStatsID": null,
-      "API": "default",
-      "ResearchRecord": "do_not",
-      "CommissionRecord": "do_not",
-      "CombatRecord": "do_not",
-      "OpsiRecord": "do_not",
-      "MeowfficerBuy": "do_not",
-      "MeowfficerTalent": "do_not"
-    }
-  },
-  "General": {
-    "Retirement": {
-      "Enable": true,
-      "RetireMode": "one_click_retire",
-      "RetireAmount": "retire_all",
-      "EnhanceFavourite": false,
-      "EnhanceFilter": null,
-      "EnhanceCheckPerCategory": 2,
-      "OldRetireN": true,
-      "OldRetireR": true,
-      "OldRetireSR": false,
-      "OldRetireSSR": false
-    }
-  },
-  "Restart": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Restart",
-      "SuccessInterval": 0,
-      "FailureInterval": 0,
-      "ServerUpdate": "00:00"
-    }
-  },
-  "Main": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Main",
-      "SuccessInterval": 0,
-      "FailureInterval": 120,
-      "ServerUpdate": "00:00"
-    },
-    "Campaign": {
-      "Name": "12-4",
-      "Event": "campaign_main",
-      "Mode": "normal",
-      "UseClearMode": true,
-      "UseFleetLock": true,
-      "UseAutoSearch": true,
-      "Use2xBook": false,
-      "AmbushEvade": true
-    },
-    "StopCondition": {
-      "RunCount": 0,
-      "OilLimit": 1000,
-      "MapAchievement": "non_stop",
-      "StageIncrease": false,
-      "GetNewShip": false,
-      "ReachLevel": 0
-    },
-    "Fleet": {
-      "Fleet1": 1,
-      "Fleet1Formation": "double_line",
-      "Fleet1Mode": "combat_auto",
-      "Fleet1Step": 3,
-      "Fleet2": 2,
-      "Fleet2Formation": "double_line",
-      "Fleet2Mode": "combat_auto",
-      "Fleet2Step": 2,
-      "FleetOrder": "fleet1_mob_fleet2_boss"
-    },
-    "Submarine": {
-      "Fleet": 0,
-      "Mode": "do_not_use",
-      "AutoSearchMode": "sub_standby",
-      "DistanceToBoss": "2_grid_to_boss"
-    },
-    "Emotion": {
-      "CalculateEmotion": true,
-      "IgnoreLowEmotionWarn": false,
-      "Fleet1Value": 119,
-      "Fleet1Record": "2020-01-01 00:00:00",
-      "Fleet1Control": "prevent_yellow_face",
-      "Fleet1Recover": "not_in_dormitory",
-      "Fleet1Oath": false,
-      "Fleet2Value": 119,
-      "Fleet2Record": "2020-01-01 00:00:00",
-      "Fleet2Control": "prevent_yellow_face",
-      "Fleet2Recover": "not_in_dormitory",
-      "Fleet2Oath": false
-    },
-    "HpControl": {
-      "UseHpBalance": false,
-      "UseEmergencyRepair": false,
-      "UseLowHpRetreat": false,
-      "HpBalanceThreshold": 0.2,
-      "HpBalanceWeight": "1000, 1000, 1000",
-      "RepairUseSingleThreshold": 0.3,
-      "RepairUseMultiThreshold": 0.6,
-      "LowHpRetreatThreshold": 0.3
-    },
-    "EnemyPriority": {
-      "EnemyScaleBalanceWeight": "default_mode"
-    }
-  },
-  "Main2": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Main2",
-      "SuccessInterval": 0,
-      "FailureInterval": 120,
-      "ServerUpdate": "00:00"
-    },
-    "Campaign": {
-      "Name": "12-4",
-      "Event": "campaign_main",
-      "Mode": "normal",
-      "UseClearMode": true,
-      "UseFleetLock": true,
-      "UseAutoSearch": true,
-      "Use2xBook": false,
-      "AmbushEvade": true
-    },
-    "StopCondition": {
-      "RunCount": 0,
-      "OilLimit": 1000,
-      "MapAchievement": "non_stop",
-      "StageIncrease": false,
-      "GetNewShip": false,
-      "ReachLevel": 0
-    },
-    "Fleet": {
-      "Fleet1": 1,
-      "Fleet1Formation": "double_line",
-      "Fleet1Mode": "combat_auto",
-      "Fleet1Step": 3,
-      "Fleet2": 2,
-      "Fleet2Formation": "double_line",
-      "Fleet2Mode": "combat_auto",
-      "Fleet2Step": 2,
-      "FleetOrder": "fleet1_mob_fleet2_boss"
-    },
-    "Submarine": {
-      "Fleet": 0,
-      "Mode": "do_not_use",
-      "AutoSearchMode": "sub_standby",
-      "DistanceToBoss": "2_grid_to_boss"
-    },
-    "Emotion": {
-      "CalculateEmotion": true,
-      "IgnoreLowEmotionWarn": false,
-      "Fleet1Value": 119,
-      "Fleet1Record": "2020-01-01 00:00:00",
-      "Fleet1Control": "prevent_yellow_face",
-      "Fleet1Recover": "not_in_dormitory",
-      "Fleet1Oath": false,
-      "Fleet2Value": 119,
-      "Fleet2Record": "2020-01-01 00:00:00",
-      "Fleet2Control": "prevent_yellow_face",
-      "Fleet2Recover": "not_in_dormitory",
-      "Fleet2Oath": false
-    },
-    "HpControl": {
-      "UseHpBalance": false,
-      "UseEmergencyRepair": false,
-      "UseLowHpRetreat": false,
-      "HpBalanceThreshold": 0.2,
-      "HpBalanceWeight": "1000, 1000, 1000",
-      "RepairUseSingleThreshold": 0.3,
-      "RepairUseMultiThreshold": 0.6,
-      "LowHpRetreatThreshold": 0.3
-    },
-    "EnemyPriority": {
-      "EnemyScaleBalanceWeight": "default_mode"
-    }
-  },
-  "Main3": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Main3",
-      "SuccessInterval": 0,
-      "FailureInterval": 120,
-      "ServerUpdate": "00:00"
-    },
-    "Campaign": {
-      "Name": "12-4",
-      "Event": "campaign_main",
-      "Mode": "normal",
-      "UseClearMode": true,
-      "UseFleetLock": true,
-      "UseAutoSearch": true,
-      "Use2xBook": false,
-      "AmbushEvade": true
-    },
-    "StopCondition": {
-      "RunCount": 0,
-      "OilLimit": 1000,
-      "MapAchievement": "non_stop",
-      "StageIncrease": false,
-      "GetNewShip": false,
-      "ReachLevel": 0
-    },
-    "Fleet": {
-      "Fleet1": 1,
-      "Fleet1Formation": "double_line",
-      "Fleet1Mode": "combat_auto",
-      "Fleet1Step": 3,
-      "Fleet2": 2,
-      "Fleet2Formation": "double_line",
-      "Fleet2Mode": "combat_auto",
-      "Fleet2Step": 2,
-      "FleetOrder": "fleet1_mob_fleet2_boss"
-    },
-    "Submarine": {
-      "Fleet": 0,
-      "Mode": "do_not_use",
-      "AutoSearchMode": "sub_standby",
-      "DistanceToBoss": "2_grid_to_boss"
-    },
-    "Emotion": {
-      "CalculateEmotion": true,
-      "IgnoreLowEmotionWarn": false,
-      "Fleet1Value": 119,
-      "Fleet1Record": "2020-01-01 00:00:00",
-      "Fleet1Control": "prevent_yellow_face",
-      "Fleet1Recover": "not_in_dormitory",
-      "Fleet1Oath": false,
-      "Fleet2Value": 119,
-      "Fleet2Record": "2020-01-01 00:00:00",
-      "Fleet2Control": "prevent_yellow_face",
-      "Fleet2Recover": "not_in_dormitory",
-      "Fleet2Oath": false
-    },
-    "HpControl": {
-      "UseHpBalance": false,
-      "UseEmergencyRepair": false,
-      "UseLowHpRetreat": false,
-      "HpBalanceThreshold": 0.2,
-      "HpBalanceWeight": "1000, 1000, 1000",
-      "RepairUseSingleThreshold": 0.3,
-      "RepairUseMultiThreshold": 0.6,
-      "LowHpRetreatThreshold": 0.3
-    },
-    "EnemyPriority": {
-      "EnemyScaleBalanceWeight": "default_mode"
-    }
-  },
-  "GemsFarming": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "GemsFarming",
-      "SuccessInterval": 0,
-      "FailureInterval": 120,
-      "ServerUpdate": "00:00"
-    },
-    "GemsFarming": {
-      "FlagshipChange": true,
-      "FlagshipEquipChange": false,
-      "VanguardChange": false,
-      "VanguardEquipChange": false,
-      "LowEmotionRetreat": true,
-      "CommonCV": "any"
-    },
-    "Campaign": {
-      "Name": "12-4",
-      "Event": "campaign_main",
-      "Mode": "normal",
-      "UseClearMode": true,
-      "UseFleetLock": true,
-      "UseAutoSearch": true,
-      "Use2xBook": false,
-      "AmbushEvade": true
-    },
-    "StopCondition": {
-      "RunCount": 0,
-      "OilLimit": 1000,
-      "MapAchievement": "non_stop",
-      "StageIncrease": false,
-      "GetNewShip": false,
-      "ReachLevel": 0
-    },
-    "Fleet": {
-      "Fleet1": 1,
-      "Fleet1Formation": "double_line",
-      "Fleet1Mode": "combat_auto",
-      "Fleet1Step": 3,
-      "Fleet2": 2,
-      "Fleet2Formation": "double_line",
-      "Fleet2Mode": "combat_auto",
-      "Fleet2Step": 2,
-      "FleetOrder": "fleet1_mob_fleet2_boss"
-    },
-    "Emotion": {
-      "CalculateEmotion": true,
-      "IgnoreLowEmotionWarn": false,
-      "Fleet1Value": 119,
-      "Fleet1Record": "2020-01-01 00:00:00",
-      "Fleet1Control": "prevent_yellow_face",
-      "Fleet1Recover": "not_in_dormitory",
-      "Fleet1Oath": false,
-      "Fleet2Value": 119,
-      "Fleet2Record": "2020-01-01 00:00:00",
-      "Fleet2Control": "prevent_yellow_face",
-      "Fleet2Recover": "not_in_dormitory",
-      "Fleet2Oath": false
-    },
-    "EnemyPriority": {
-      "EnemyScaleBalanceWeight": "default_mode"
-    }
-  },
-  "EventGeneral": {
-    "EventGeneral": {
-      "PtLimit": 0,
-      "TimeLimit": "2020-01-01 00:00:00"
-    }
-  },
-  "Event": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Event",
-      "SuccessInterval": 0,
-      "FailureInterval": 120,
-      "ServerUpdate": "00:00"
-    },
-    "Campaign": {
-      "Name": "12-4",
-      "Event": "campaign_main",
-      "Mode": "normal",
-      "UseClearMode": true,
-      "UseFleetLock": true,
-      "UseAutoSearch": true,
-      "Use2xBook": false,
-      "AmbushEvade": true
-    },
-    "StopCondition": {
-      "RunCount": 0,
-      "OilLimit": 1000,
-      "MapAchievement": "non_stop",
-      "StageIncrease": false,
-      "GetNewShip": false,
-      "ReachLevel": 0
-    },
-    "Fleet": {
-      "Fleet1": 1,
-      "Fleet1Formation": "double_line",
-      "Fleet1Mode": "combat_auto",
-      "Fleet1Step": 3,
-      "Fleet2": 2,
-      "Fleet2Formation": "double_line",
-      "Fleet2Mode": "combat_auto",
-      "Fleet2Step": 2,
-      "FleetOrder": "fleet1_mob_fleet2_boss"
-    },
-    "Submarine": {
-      "Fleet": 0,
-      "Mode": "do_not_use",
-      "AutoSearchMode": "sub_standby",
-      "DistanceToBoss": "2_grid_to_boss"
-    },
-    "Emotion": {
-      "CalculateEmotion": true,
-      "IgnoreLowEmotionWarn": false,
-      "Fleet1Value": 119,
-      "Fleet1Record": "2020-01-01 00:00:00",
-      "Fleet1Control": "prevent_yellow_face",
-      "Fleet1Recover": "not_in_dormitory",
-      "Fleet1Oath": false,
-      "Fleet2Value": 119,
-      "Fleet2Record": "2020-01-01 00:00:00",
-      "Fleet2Control": "prevent_yellow_face",
-      "Fleet2Recover": "not_in_dormitory",
-      "Fleet2Oath": false
-    },
-    "HpControl": {
-      "UseHpBalance": false,
-      "UseEmergencyRepair": false,
-      "UseLowHpRetreat": false,
-      "HpBalanceThreshold": 0.2,
-      "HpBalanceWeight": "1000, 1000, 1000",
-      "RepairUseSingleThreshold": 0.3,
-      "RepairUseMultiThreshold": 0.6,
-      "LowHpRetreatThreshold": 0.3
-    },
-    "EnemyPriority": {
-      "EnemyScaleBalanceWeight": "default_mode"
-    }
-  },
-  "Event2": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Event2",
-      "SuccessInterval": 0,
-      "FailureInterval": 120,
-      "ServerUpdate": "00:00"
-    },
-    "Campaign": {
-      "Name": "12-4",
-      "Event": "campaign_main",
-      "Mode": "normal",
-      "UseClearMode": true,
-      "UseFleetLock": true,
-      "UseAutoSearch": true,
-      "Use2xBook": false,
-      "AmbushEvade": true
-    },
-    "StopCondition": {
-      "RunCount": 0,
-      "OilLimit": 1000,
-      "MapAchievement": "non_stop",
-      "StageIncrease": false,
-      "GetNewShip": false,
-      "ReachLevel": 0
-    },
-    "Fleet": {
-      "Fleet1": 1,
-      "Fleet1Formation": "double_line",
-      "Fleet1Mode": "combat_auto",
-      "Fleet1Step": 3,
-      "Fleet2": 2,
-      "Fleet2Formation": "double_line",
-      "Fleet2Mode": "combat_auto",
-      "Fleet2Step": 2,
-      "FleetOrder": "fleet1_mob_fleet2_boss"
-    },
-    "Submarine": {
-      "Fleet": 0,
-      "Mode": "do_not_use",
-      "AutoSearchMode": "sub_standby",
-      "DistanceToBoss": "2_grid_to_boss"
-    },
-    "Emotion": {
-      "CalculateEmotion": true,
-      "IgnoreLowEmotionWarn": false,
-      "Fleet1Value": 119,
-      "Fleet1Record": "2020-01-01 00:00:00",
-      "Fleet1Control": "prevent_yellow_face",
-      "Fleet1Recover": "not_in_dormitory",
-      "Fleet1Oath": false,
-      "Fleet2Value": 119,
-      "Fleet2Record": "2020-01-01 00:00:00",
-      "Fleet2Control": "prevent_yellow_face",
-      "Fleet2Recover": "not_in_dormitory",
-      "Fleet2Oath": false
-    },
-    "HpControl": {
-      "UseHpBalance": false,
-      "UseEmergencyRepair": false,
-      "UseLowHpRetreat": false,
-      "HpBalanceThreshold": 0.2,
-      "HpBalanceWeight": "1000, 1000, 1000",
-      "RepairUseSingleThreshold": 0.3,
-      "RepairUseMultiThreshold": 0.6,
-      "LowHpRetreatThreshold": 0.3
-    },
-    "EnemyPriority": {
-      "EnemyScaleBalanceWeight": "default_mode"
-    }
-  },
-  "EventAb": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "EventAb",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "EventAb": {
-      "StageFilter": "A1 > A2 > A3 > B1 > B2 > B3",
-      "LastStage": 0
-    },
-    "Campaign": {
-      "Name": "dynamic",
-      "Event": "campaign_main",
-      "Mode": "normal",
-      "UseClearMode": true,
-      "UseFleetLock": true,
-      "UseAutoSearch": true,
-      "Use2xBook": false,
-      "AmbushEvade": true
-    },
-    "StopCondition": {
-      "RunCount": 0,
-      "OilLimit": 1000,
-      "MapAchievement": "non_stop",
-      "StageIncrease": false,
-      "GetNewShip": false,
-      "ReachLevel": 0
-    },
-    "Fleet": {
-      "Fleet1": 1,
-      "Fleet1Formation": "double_line",
-      "Fleet1Mode": "combat_auto",
-      "Fleet1Step": 3,
-      "Fleet2": 2,
-      "Fleet2Formation": "double_line",
-      "Fleet2Mode": "combat_auto",
-      "Fleet2Step": 2,
-      "FleetOrder": "fleet1_mob_fleet2_boss"
-    },
-    "Submarine": {
-      "Fleet": 0,
-      "Mode": "do_not_use",
-      "AutoSearchMode": "sub_standby",
-      "DistanceToBoss": "2_grid_to_boss"
-    },
-    "Emotion": {
-      "CalculateEmotion": true,
-      "IgnoreLowEmotionWarn": false,
-      "Fleet1Value": 119,
-      "Fleet1Record": "2020-01-01 00:00:00",
-      "Fleet1Control": "prevent_yellow_face",
-      "Fleet1Recover": "not_in_dormitory",
-      "Fleet1Oath": false,
-      "Fleet2Value": 119,
-      "Fleet2Record": "2020-01-01 00:00:00",
-      "Fleet2Control": "prevent_yellow_face",
-      "Fleet2Recover": "not_in_dormitory",
-      "Fleet2Oath": false
-    },
-    "HpControl": {
-      "UseHpBalance": false,
-      "UseEmergencyRepair": false,
-      "UseLowHpRetreat": false,
-      "HpBalanceThreshold": 0.2,
-      "HpBalanceWeight": "1000, 1000, 1000",
-      "RepairUseSingleThreshold": 0.3,
-      "RepairUseMultiThreshold": 0.6,
-      "LowHpRetreatThreshold": 0.3
-    }
-  },
-  "EventCd": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "EventCd",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "EventCd": {
-      "StageFilter": "C1 > C2 > C3 > D1 > D2 > D3",
-      "LastStage": 0
-    },
-    "Campaign": {
-      "Name": "dynamic",
-      "Event": "campaign_main",
-      "Mode": "normal",
-      "UseClearMode": true,
-      "UseFleetLock": true,
-      "UseAutoSearch": true,
-      "Use2xBook": false,
-      "AmbushEvade": true
-    },
-    "StopCondition": {
-      "RunCount": 0,
-      "OilLimit": 1000,
-      "MapAchievement": "non_stop",
-      "StageIncrease": false,
-      "GetNewShip": false,
-      "ReachLevel": 0
-    },
-    "Fleet": {
-      "Fleet1": 1,
-      "Fleet1Formation": "double_line",
-      "Fleet1Mode": "combat_auto",
-      "Fleet1Step": 3,
-      "Fleet2": 2,
-      "Fleet2Formation": "double_line",
-      "Fleet2Mode": "combat_auto",
-      "Fleet2Step": 2,
-      "FleetOrder": "fleet1_mob_fleet2_boss"
-    },
-    "Submarine": {
-      "Fleet": 0,
-      "Mode": "do_not_use",
-      "AutoSearchMode": "sub_standby",
-      "DistanceToBoss": "2_grid_to_boss"
-    },
-    "Emotion": {
-      "CalculateEmotion": true,
-      "IgnoreLowEmotionWarn": false,
-      "Fleet1Value": 119,
-      "Fleet1Record": "2020-01-01 00:00:00",
-      "Fleet1Control": "prevent_yellow_face",
-      "Fleet1Recover": "not_in_dormitory",
-      "Fleet1Oath": false,
-      "Fleet2Value": 119,
-      "Fleet2Record": "2020-01-01 00:00:00",
-      "Fleet2Control": "prevent_yellow_face",
-      "Fleet2Recover": "not_in_dormitory",
-      "Fleet2Oath": false
-    },
-    "HpControl": {
-      "UseHpBalance": false,
-      "UseEmergencyRepair": false,
-      "UseLowHpRetreat": false,
-      "HpBalanceThreshold": 0.2,
-      "HpBalanceWeight": "1000, 1000, 1000",
-      "RepairUseSingleThreshold": 0.3,
-      "RepairUseMultiThreshold": 0.6,
-      "LowHpRetreatThreshold": 0.3
-    }
-  },
-  "EventSp": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "EventSp",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "Campaign": {
-      "Name": "sp",
-      "Event": "campaign_main",
-      "Mode": "normal",
-      "UseClearMode": true,
-      "UseFleetLock": true,
-      "UseAutoSearch": true,
-      "Use2xBook": false,
-      "AmbushEvade": true
-    },
-    "StopCondition": {
-      "RunCount": 0,
-      "OilLimit": 1000,
-      "MapAchievement": "non_stop",
-      "StageIncrease": false,
-      "GetNewShip": false,
-      "ReachLevel": 0
-    },
-    "Fleet": {
-      "Fleet1": 1,
-      "Fleet1Formation": "double_line",
-      "Fleet1Mode": "combat_auto",
-      "Fleet1Step": 3,
-      "Fleet2": 2,
-      "Fleet2Formation": "double_line",
-      "Fleet2Mode": "combat_auto",
-      "Fleet2Step": 2,
-      "FleetOrder": "fleet1_mob_fleet2_boss"
-    },
-    "Submarine": {
-      "Fleet": 0,
-      "Mode": "do_not_use",
-      "AutoSearchMode": "sub_standby",
-      "DistanceToBoss": "2_grid_to_boss"
-    },
-    "Emotion": {
-      "CalculateEmotion": true,
-      "IgnoreLowEmotionWarn": false,
-      "Fleet1Value": 119,
-      "Fleet1Record": "2020-01-01 00:00:00",
-      "Fleet1Control": "prevent_yellow_face",
-      "Fleet1Recover": "not_in_dormitory",
-      "Fleet1Oath": false,
-      "Fleet2Value": 119,
-      "Fleet2Record": "2020-01-01 00:00:00",
-      "Fleet2Control": "prevent_yellow_face",
-      "Fleet2Recover": "not_in_dormitory",
-      "Fleet2Oath": false
-    },
-    "HpControl": {
-      "UseHpBalance": false,
-      "UseEmergencyRepair": false,
-      "UseLowHpRetreat": false,
-      "HpBalanceThreshold": 0.2,
-      "HpBalanceWeight": "1000, 1000, 1000",
-      "RepairUseSingleThreshold": 0.3,
-      "RepairUseMultiThreshold": 0.6,
-      "LowHpRetreatThreshold": 0.3
-    }
-  },
-  "Raid": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Raid",
-      "SuccessInterval": 0,
-      "FailureInterval": 120,
-      "ServerUpdate": "00:00"
-    },
-    "Raid": {
-      "Mode": "hard",
-      "UseTicket": false
-    },
-    "Campaign": {
-      "Name": "dynamic",
-      "Event": "campaign_main",
-      "Mode": "normal",
-      "UseClearMode": true,
-      "UseFleetLock": true,
-      "UseAutoSearch": false,
-      "Use2xBook": false,
-      "AmbushEvade": true
-    },
-    "StopCondition": {
-      "RunCount": 0,
-      "OilLimit": 1000,
-      "MapAchievement": "non_stop",
-      "StageIncrease": false,
-      "GetNewShip": false,
-      "ReachLevel": 0
-    },
-    "Emotion": {
-      "CalculateEmotion": true,
-      "IgnoreLowEmotionWarn": false,
-      "Fleet1Value": 119,
-      "Fleet1Record": "2020-01-01 00:00:00",
-      "Fleet1Control": "prevent_yellow_face",
-      "Fleet1Recover": "not_in_dormitory",
-      "Fleet1Oath": false,
-      "Fleet2Value": 119,
-      "Fleet2Record": "2020-01-01 00:00:00",
-      "Fleet2Control": "prevent_yellow_face",
-      "Fleet2Recover": "not_in_dormitory",
-      "Fleet2Oath": false
-    }
-  },
-  "RaidDaily": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "RaidDaily",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "RaidDaily": {
-      "StageFilter": "hard > normal > easy"
-    },
-    "Campaign": {
-      "Name": "dynamic",
-      "Event": "campaign_main",
-      "Mode": "normal",
-      "UseClearMode": true,
-      "UseFleetLock": true,
-      "UseAutoSearch": false,
-      "Use2xBook": false,
-      "AmbushEvade": true
-    },
-    "StopCondition": {
-      "RunCount": 0,
-      "OilLimit": 1000,
-      "MapAchievement": "non_stop",
-      "StageIncrease": false,
-      "GetNewShip": false,
-      "ReachLevel": 0
-    },
-    "Emotion": {
-      "CalculateEmotion": true,
-      "IgnoreLowEmotionWarn": false,
-      "Fleet1Value": 119,
-      "Fleet1Record": "2020-01-01 00:00:00",
-      "Fleet1Control": "prevent_yellow_face",
-      "Fleet1Recover": "not_in_dormitory",
-      "Fleet1Oath": false,
-      "Fleet2Value": 119,
-      "Fleet2Record": "2020-01-01 00:00:00",
-      "Fleet2Control": "prevent_yellow_face",
-      "Fleet2Recover": "not_in_dormitory",
-      "Fleet2Oath": false
-    }
-  },
-  "MaritimeEscort": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "MaritimeEscort",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "MaritimeEscort": {
-      "Enable": true
-    }
-  },
-  "Commission": {
-    "Scheduler": {
-      "Enable": true,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Commission",
-      "SuccessInterval": "30-60",
-      "FailureInterval": "30-60",
-      "ServerUpdate": "00:00"
-    },
-    "Commission": {
-      "DoMajorCommission": false,
-      "CommissionFilter": "DailyEvent\n> Gem-8 > Gem-4 > Gem-2\n> NightDrill-8 > NightDrill-7 > NightDrill-6\n> ExtraDrill-0:20 > ExtraDrill-1 > ExtraDrill-2 > ExtraDrill-2:40 > ExtraDrill-3:20 > ExtraDrill-5:20\n> Box-6 > Box-3 > Box-1\n> DailyCube-0:30 > UrgentCube-1:30 > DailyCube-1:30 > UrgentCube-1:45 > UrgentCube-2:15 > UrgentCube-3\n> Major\n> DailyChip > DailyResource\n> UrgentBook-2:30 > UrgentBook-2 > UrgentBook-1:20 > UrgentBook-1:40\n> Daily-0:20 > Daily-0:30 > Daily-1:00 > Daily-1:30 > Daily-2:00\n> NightOil > NightCube\n> shortest"
-    }
-  },
-  "Tactical": {
-    "Scheduler": {
-      "Enable": true,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Tactical",
-      "SuccessInterval": "30-60",
-      "FailureInterval": "120-240",
-      "ServerUpdate": "00:00"
-    },
-    "Tactical": {
-      "TacticalFilter": "SameT4 > SameT3 > SameT2 > SameT1\n> BlueT2 > YellowT2 > RedT2\n> BlueT3 > YellowT3 > RedT3\n> BlueT4 > YellowT4 > RedT4\n> BlueT1 > YellowT1 > RedT1\n> first"
-    },
-    "ControlExpOverflow": {
-      "Enable": true,
-      "T4Allow": 100,
-      "T3Allow": 100,
-      "T2Allow": 200,
-      "T1Allow": 200
-    }
-  },
-  "Research": {
-    "Scheduler": {
-      "Enable": true,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Research",
-      "SuccessInterval": "30-60",
-      "FailureInterval": "30-60",
-      "ServerUpdate": "00:00"
-    },
-    "Research": {
-      "UseCube": "only_05_hour",
-      "UseCoin": "always_use",
-      "UsePart": "always_use",
-      "PresetFilter": "series_4_blueprint_tenrai",
-      "CustomFilter": "S4-Q0.5 > Q-0.5 > S4-DR0.5 > S4-PRY0.5 > DR-0.5 > PRY-0.5\n> S4-Q1 > S4-Q2\n> S4-DR2.5 > S4-G1.5\n> S4-Q4 > S4-H0.5 > S4-G4\n> S4-PRY2.5 > S4-G2.5\n> reset > S4-H1 > shortest"
-    }
-  },
-  "Dorm": {
-    "Scheduler": {
-      "Enable": true,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Dorm",
-      "SuccessInterval": 278,
-      "FailureInterval": 278,
-      "ServerUpdate": "00:00"
-    },
-    "Dorm": {
-      "Collect": true,
-      "Feed": true,
-      "FeedFilter": "20000 > 10000 > 5000 > 3000 > 2000 > 1000"
-    }
-  },
-  "Meowfficer": {
-    "Scheduler": {
-      "Enable": true,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Meowfficer",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "Meowfficer": {
-      "BuyAmount": 1,
-      "FortChoreMeowfficer": true
-    },
-    "MeowfficerTrain": {
-      "Enable": false,
-      "Mode": "seamlessly",
-      "RetainTalentedGold": true,
-      "RetainTalentedPurple": true,
-      "EnhanceIndex": 1
-    }
-  },
-  "Guild": {
-    "Scheduler": {
-      "Enable": true,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Guild",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00, 06:00, 12:00, 18:00, 21:00"
-    },
-    "GuildLogistics": {
-      "Enable": true,
-      "SelectNewMission": false,
-      "ExchangeFilter": "PlateTorpedoT1 > PlateAntiAirT1 > PlatePlaneT1 > PlateGunT1 > PlateGeneralT1\n> PlateTorpedoT2 > PlateAntiAirT2 > PlatePlaneT2 > PlateGunT2 > PlateGeneralT2\n> PlateTorpedoT3 > PlateAntiAirT3 > PlatePlaneT3 > PlateGunT3 > PlateGeneralT3\n> OxyCola > Coolant > Merit > Coin > Oil"
-    },
-    "GuildOperation": {
-      "Enable": true,
-      "SelectNewOperation": false,
-      "NewOperationMaxDate": 15,
-      "JoinThreshold": 1,
-      "AttackBoss": true,
-      "BossFleetRecommend": false
-    }
-  },
-  "Reward": {
-    "Scheduler": {
-      "Enable": true,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Reward",
-      "SuccessInterval": "120-240",
-      "FailureInterval": "120-240",
-      "ServerUpdate": "00:00"
-    },
-    "Reward": {
-      "CollectOil": true,
-      "CollectCoin": true,
-      "CollectExp": true,
-      "CollectMission": true,
-      "CollectWeeklyMission": true
-    }
-  },
-  "ShopFrequent": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "ShopFrequent",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00, 12:00, 18:00"
-    },
-    "GeneralShop": {
-      "UseGems": false,
-      "Refresh": false,
-      "BuySkinBox": false,
-      "Filter": "BookRedT3 > BookYellowT3 > BookBlueT3 > BookRedT2\n> Cube\n> FoodT6 > FoodT5"
-    }
-  },
-  "ShopOnce": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "ShopOnce",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "GuildShop": {
-      "Refresh": true,
-      "Filter": "PlateT4 > BookT3 > PR > CatT3 > Chip > BookT2 > Retrofit > FoodT6 > FoodT5 > CatT2 > BoxT4",
-      "BOX_T3": "ironblood",
-      "BOX_T4": "ironblood",
-      "BOOK_T2": "red",
-      "BOOK_T3": "red",
-      "RETROFIT_T2": "cl",
-      "RETROFIT_T3": "cl",
-      "PLATE_T2": "general",
-      "PLATE_T3": "general",
-      "PLATE_T4": "gun",
-      "PR1": "neptune",
-      "PR2": "seattle",
-      "PR3": "cheshire"
-    },
-    "MedalShop2": {
-      "Filter": "DR > PR\n> BookRedT3 > BookYellowT3 > BookBlueT3\n> BookRedT2 > BookYellowT2 > BookBlueT2\n> RetrofitT3\n> FoodT6 > FoodT5\n> PlateGeneralT3 > PlateWildT3",
-      "RETROFIT_T1": "cl",
-      "RETROFIT_T2": "cl",
-      "RETROFIT_T3": "cl",
-      "PLATE_T1": "general",
-      "PLATE_T2": "general",
-      "PLATE_T3": "general"
-    },
-    "MeritShop": {
-      "Refresh": false,
-      "Filter": "Cube"
-    },
-    "CoreShop": {
-      "Filter": "Array"
-    }
-  },
-  "Shipyard": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Shipyard",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "04:00"
-    },
-    "Shipyard": {
-      "ResearchSeries": 1,
-      "ShipIndex": 0,
-      "BuyAmount": 2
-    }
-  },
-  "Gacha": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Gacha",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "Gacha": {
-      "Pool": "light",
-      "Amount": 1,
-      "UseDrill": false
-    }
-  },
-  "DataKey": {
-    "Scheduler": {
-      "Enable": true,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "DataKey",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    }
-  },
-  "SupplyPack": {
-    "Scheduler": {
-      "Enable": true,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "SupplyPack",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "SupplyPack": {
-      "WeeklyFreeSupplyPack": true
-    }
-  },
-  "BattlePass": {
-    "Scheduler": {
-      "Enable": true,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "BattlePass",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "BattlePass": {
-      "BattlePassReward": true
-    }
-  },
-  "MetaReward": {
-    "Scheduler": {
-      "Enable": true,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "MetaReward",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "MetaReward": {
-      "MetaReward": true
-    }
-  },
-  "Daily": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Daily",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "Daily": {
-      "UseDailySkip": true,
-      "EscortMission": "first",
-      "EscortMissionFleet": 5,
-      "AdvanceMission": "first",
-      "AdvanceMissionFleet": 5,
-      "FierceAssault": "first",
-      "FierceAssaultFleet": 5,
-      "TacticalTraining": "second",
-      "TacticalTrainingFleet": 5,
-      "SupplyLineDisruption": "second",
-      "ModuleDevelopment": "first",
-      "ModuleDevelopmentFleet": 5
-    }
-  },
-  "Hard": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Hard",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "Hard": {
-      "HardStage": "11-4",
-      "HardFleet": 1
-    }
-  },
-  "Exercise": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Exercise",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00, 12:00, 18:00"
-    },
-    "Exercise": {
-      "OpponentChooseMode": "max_exp",
-      "OpponentTrial": 1,
-      "ExercisePreserve": 0,
-      "LowHpThreshold": 0.4,
-      "LowHpConfirmWait": 0.1,
-      "OpponentRefreshValue": 0,
-      "OpponentRefreshRecord": "2020-01-01 00:00:00"
-    }
-  },
-  "Sos": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "Sos",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "Sos": {
-      "Chapter": 3
-    },
-    "Campaign": {
-      "Name": "dynamic",
-      "Event": "campaign_main",
-      "Mode": "normal",
-      "UseClearMode": true,
-      "UseFleetLock": true,
-      "UseAutoSearch": false,
-      "Use2xBook": false,
-      "AmbushEvade": true
-    },
-    "StopCondition": {
-      "RunCount": 0,
-      "OilLimit": 1000,
-      "MapAchievement": "non_stop",
-      "StageIncrease": false,
-      "GetNewShip": false,
-      "ReachLevel": 0
-    },
-    "Fleet": {
-      "Fleet1": 1,
-      "Fleet1Formation": "double_line",
-      "Fleet1Mode": "combat_auto",
-      "Fleet1Step": 3,
-      "Fleet2": 2,
-      "Fleet2Formation": "double_line",
-      "Fleet2Mode": "combat_auto",
-      "Fleet2Step": 2,
-      "FleetOrder": "fleet1_mob_fleet2_boss"
-    },
-    "Submarine": {
-      "Fleet": 0,
-      "Mode": "do_not_use",
-      "AutoSearchMode": "sub_standby",
-      "DistanceToBoss": "2_grid_to_boss"
-    },
-    "Emotion": {
-      "CalculateEmotion": true,
-      "IgnoreLowEmotionWarn": false,
-      "Fleet1Value": 119,
-      "Fleet1Record": "2020-01-01 00:00:00",
-      "Fleet1Control": "prevent_yellow_face",
-      "Fleet1Recover": "not_in_dormitory",
-      "Fleet1Oath": false,
-      "Fleet2Value": 119,
-      "Fleet2Record": "2020-01-01 00:00:00",
-      "Fleet2Control": "prevent_yellow_face",
-      "Fleet2Recover": "not_in_dormitory",
-      "Fleet2Oath": false
-    },
-    "HpControl": {
-      "UseHpBalance": false,
-      "UseEmergencyRepair": false,
-      "UseLowHpRetreat": false,
-      "HpBalanceThreshold": 0.2,
-      "HpBalanceWeight": "1000, 1000, 1000",
-      "RepairUseSingleThreshold": 0.3,
-      "RepairUseMultiThreshold": 0.6,
-      "LowHpRetreatThreshold": 0.3
-    }
-  },
-  "WarArchives": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "WarArchives",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "Campaign": {
-      "Name": "12-4",
-      "Event": "war_archives_20210325_cn",
-      "Mode": "normal",
-      "UseClearMode": true,
-      "UseFleetLock": true,
-      "UseAutoSearch": true,
-      "Use2xBook": false,
-      "AmbushEvade": true
-    },
-    "StopCondition": {
-      "RunCount": 0,
-      "OilLimit": 1000,
-      "MapAchievement": "non_stop",
-      "StageIncrease": false,
-      "GetNewShip": false,
-      "ReachLevel": 0
-    },
-    "Fleet": {
-      "Fleet1": 1,
-      "Fleet1Formation": "double_line",
-      "Fleet1Mode": "combat_auto",
-      "Fleet1Step": 3,
-      "Fleet2": 2,
-      "Fleet2Formation": "double_line",
-      "Fleet2Mode": "combat_auto",
-      "Fleet2Step": 2,
-      "FleetOrder": "fleet1_mob_fleet2_boss"
-    },
-    "Submarine": {
-      "Fleet": 0,
-      "Mode": "do_not_use",
-      "AutoSearchMode": "sub_standby",
-      "DistanceToBoss": "2_grid_to_boss"
-    },
-    "Emotion": {
-      "CalculateEmotion": true,
-      "IgnoreLowEmotionWarn": false,
-      "Fleet1Value": 119,
-      "Fleet1Record": "2020-01-01 00:00:00",
-      "Fleet1Control": "prevent_yellow_face",
-      "Fleet1Recover": "not_in_dormitory",
-      "Fleet1Oath": false,
-      "Fleet2Value": 119,
-      "Fleet2Record": "2020-01-01 00:00:00",
-      "Fleet2Control": "prevent_yellow_face",
-      "Fleet2Recover": "not_in_dormitory",
-      "Fleet2Oath": false
-    },
-    "HpControl": {
-      "UseHpBalance": false,
-      "UseEmergencyRepair": false,
-      "UseLowHpRetreat": false,
-      "HpBalanceThreshold": 0.2,
-      "HpBalanceWeight": "1000, 1000, 1000",
-      "RepairUseSingleThreshold": 0.3,
-      "RepairUseMultiThreshold": 0.6,
-      "LowHpRetreatThreshold": 0.3
-    }
-  },
-  "OpsiGeneral": {
-    "OpsiGeneral": {
-      "UseLogger": true,
-      "BuyActionPoint": false,
-      "OilLimit": 1000,
-      "RepairThreshold": 0.4,
-      "DoRandomMapEvent": true,
-      "AkashiShopFilter": "ActionPoint > PurpleCoins"
-    },
-    "OpsiAshBeacon": {
-      "AshAttack": true,
-      "EnsureFullyCollected": true,
-      "RequestAssist": true
-    }
-  },
-  "OpsiAshAssist": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "OpsiAshAssist",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "OpsiAshAssist": {
-      "Tier": 15
-    }
-  },
-  "OpsiExplore": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "OpsiExplore",
-      "SuccessInterval": 0,
-      "FailureInterval": 0,
-      "ServerUpdate": "00:00"
-    },
-    "OpsiExplore": {
-      "SpecialRadar": false,
-      "ForceRun": false,
-      "LastZone": 0
-    },
-    "OpsiFleet": {
-      "Fleet": 1,
-      "Submarine": false
-    }
-  },
-  "OpsiShop": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "OpsiShop",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "OpsiShop": {
-      "BuySupply": true
-    }
-  },
-  "OpsiDaily": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "OpsiDaily",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "OpsiDaily": {
-      "DoMission": true,
-      "UseTuningSample": true
-    },
-    "OpsiFleet": {
-      "Fleet": 1,
-      "Submarine": false
-    }
-  },
-  "OpsiObscure": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "OpsiObscure",
-      "SuccessInterval": 60,
-      "FailureInterval": 60,
-      "ServerUpdate": "00:00"
-    },
-    "OpsiObscure": {
-      "ForceRun": false
-    },
-    "OpsiFleet": {
-      "Fleet": 1,
-      "Submarine": false
-    }
-  },
-  "OpsiAbyssal": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "OpsiAbyssal",
-      "SuccessInterval": 60,
-      "FailureInterval": 60,
-      "ServerUpdate": "00:00"
-    },
-    "OpsiAbyssal": {
-      "ForceRun": false
-    },
-    "OpsiFleetFilter": {
-      "Filter": "Fleet-4 > CallSubmarine > Fleet-2 > Fleet-3 > Fleet-1"
-    }
-  },
-  "OpsiStronghold": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "OpsiStronghold",
-      "SuccessInterval": 60,
-      "FailureInterval": 60,
-      "ServerUpdate": "00:00"
-    },
-    "OpsiStronghold": {
-      "ForceRun": false
-    },
-    "OpsiFleetFilter": {
-      "Filter": "Fleet-4 > CallSubmarine > Fleet-2 > Fleet-3 > Fleet-1"
-    }
-  },
-  "OpsiMeowfficerFarming": {
-    "Scheduler": {
-      "Enable": false,
-      "NextRun": "2020-01-01 00:00:00",
-      "Command": "OpsiMeowfficerFarming",
-      "SuccessInterval": 30,
-      "FailureInterval": 30,
-      "ServerUpdate": "00:00"
-    },
-    "OpsiMeowfficerFarming": {
-      "ActionPointPreserve": 500,
-      "HazardLevel": 5,
-      "TargetZone": 0
-    },
-    "OpsiFleet": {
-      "Fleet": 1,
-      "Submarine": false
-    }
-  },
-  "Daemon": {
-    "Daemon": {
-      "EnterMap": true
-    }
-  },
-  "OpsiDaemon": {
-    "OpsiDaemon": {
-      "RepairShip": true,
-      "SelectEnemy": true
-    }
-  },
-  "Benchmark": {
-    "Benchmark": {
-      "AdbScreenshot": true,
-      "AdbncScreenshot": true,
-      "Uiautomator2Screenshot": true,
-      "AscreencapScreenshot": true,
-      "AscreencapncScreenshot": true,
-      "AdbClick": true,
-      "Uiautomator2Click": true,
-      "MinitouchClick": true,
-      "HermitClick": false
-    }
-  },
-  "AzurLaneUncensored": {
-    "AzurLaneUncensored": {
-      "Repository": "https://gitee.com/LmeSzinc/AzurLaneUncensored"
-    }
-  },
-  "GameManager": {
-    "GameManager": {
-      "AutoRestart": true
+    "Script":{
+        "Device":{
+            "Serial": "127.0.0.1:7555",
+            "Handle":"auto",
+            "PackageName":"auto",
+            "ScreenshotMethod": "ADB",
+            "ControlMethod": "minitouch",
+            "AdbRestart": false
+        },
+        "Error": {
+            "HandleError": true,
+            "SaveError": true,
+            "ScreenshotLength": 1
+          },
+        "Optimization": {
+              "ScreenshotInterval": 0.3,
+              "CombatScreenshotInterval": 1.0,
+              "TaskHoardingDuration": 0,
+              "WhenTaskQueueEmpty": "goto_home"
+    	}
+    },
+    "General": {
+        "Retirement": {
+          "Enable": true,
+          "RetireMode": "one_click_retire",
+          "RetireAmount": "retire_all",
+          "EnhanceFavourite": false,
+          "EnhanceFilter": null,
+          "EnhanceCheckPerCategory": 2,
+          "OldRetireN": true,
+          "OldRetireR": true,
+          "OldRetireSR": false,
+          "OldRetireSSR": false
+        }
+      },
+    "Restart": {
+        "Scheduler": {
+            "Enable": false,
+            "NextRun": "2021-01-01 00:00:00",
+            "Command": "Restart",
+            "SuccessInterval": 0,
+            "FailureInterval": 0,
+            "ServerUpdate": "00:00"
+        }
     }
     }
-  }
 }
 }

+ 3 - 1
gui.py

@@ -3,6 +3,7 @@
 # github https://github.com/runhey
 # github https://github.com/runhey
 
 
 from module.gui.context.add import Add
 from module.gui.context.add import Add
+from module.gui.context.settings import Setting
 from module.gui.context.process_manager import ProcessManager
 from module.gui.context.process_manager import ProcessManager
 from module.gui.fluent_app import FluentApp
 from module.gui.fluent_app import FluentApp
 
 
@@ -13,9 +14,10 @@ if __name__ == "__main__":
     # 后面选择注入上下文快
     # 后面选择注入上下文快
     app = FluentApp()
     app = FluentApp()
     add_config = Add()
     add_config = Add()
+    setting = Setting()
     process_manager = ProcessManager()
     process_manager = ProcessManager()
-    # process_manager.create_all()
 
 
+    app.set_context_property(setting, 'setting')
     app.set_context_property(add_config, 'add_config')
     app.set_context_property(add_config, 'add_config')
     app.set_context_property(process_manager, 'process_manager')
     app.set_context_property(process_manager, 'process_manager')
     # 启动一个GUI
     # 启动一个GUI

+ 1 - 0
module/config/argument/setting-template.json

@@ -0,0 +1 @@
+{"displayMode":1,"darkMode":2,"primaryColor":"Yellow","nativeText":true,"language":"zh-CN"}

+ 14 - 0
module/config/config.py

@@ -25,6 +25,7 @@ class Config(ConfigManual, ConfigWatcher, ConfigUpdater):
         """
         """
         self.config_name = config_name
         self.config_name = config_name
         self.data: dict = {}
         self.data: dict = {}
+        self.is_template_config = config_name.startswith("template")
 
 
         self.load()
         self.load()
 
 
@@ -46,6 +47,19 @@ class Config(ConfigManual, ConfigWatcher, ConfigUpdater):
         except:
         except:
             logger.exception(f'have no arg {task}.{group}.{argument}')
             logger.exception(f'have no arg {task}.{group}.{argument}')
 
 
+    def set_arg(self, task: str, group: str, argument: str, value) -> None:
+        """
+
+        :param task:
+        :param group:
+        :param argument:
+        :param value:
+        :return:
+        """
+        try:
+            self.data[task][group][argument] = value
+        except:
+            logger.exception(f'have no arg {task}.{group}.{argument}')
 
 
 if __name__ == '__main__':
 if __name__ == '__main__':
     config = Config(config_name='oas1')
     config = Config(config_name='oas1')

+ 4 - 4
module/device/screenshot.py

@@ -145,17 +145,17 @@ class Screenshot(Adb, DroidCast, Scrcpy, Window):
                 Or None for Optimization_ScreenshotInterval, 'combat' for Optimization_CombatScreenshotInterval
                 Or None for Optimization_ScreenshotInterval, 'combat' for Optimization_CombatScreenshotInterval
         """
         """
         if interval is None:
         if interval is None:
-            origin = self.config.Optimization_ScreenshotInterval
+            origin = self.config.get_arg('Script', 'Optimization', 'ScreenshotInterval')
             interval = limit_in(origin, 0.1, 0.3)
             interval = limit_in(origin, 0.1, 0.3)
             if interval != origin:
             if interval != origin:
                 logger.warning(f'Optimization.ScreenshotInterval {origin} is revised to {interval}')
                 logger.warning(f'Optimization.ScreenshotInterval {origin} is revised to {interval}')
-                self.config.Optimization_ScreenshotInterval = interval
+                self.config.set_arg('Script', 'Optimization', 'ScreenshotInterval', interval)
         elif interval == 'combat':
         elif interval == 'combat':
-            origin = self.config.Optimization_CombatScreenshotInterval
+            origin = self.config.get_arg('Script', 'Optimization', 'CombatScreenshotInterval')
             interval = limit_in(origin, 0.3, 1.0)
             interval = limit_in(origin, 0.3, 1.0)
             if interval != origin:
             if interval != origin:
                 logger.warning(f'Optimization.CombatScreenshotInterval {origin} is revised to {interval}')
                 logger.warning(f'Optimization.CombatScreenshotInterval {origin} is revised to {interval}')
-                self.config.Optimization_CombatScreenshotInterval = interval
+                self.config.set_arg('Script', 'Optimization', 'CombatScreenshotInterval', interval)
         elif isinstance(interval, (int, float)):
         elif isinstance(interval, (int, float)):
             # No limitation for manual set in code
             # No limitation for manual set in code
             pass
             pass

+ 1 - 0
module/gui/context/add.py

@@ -15,6 +15,7 @@ class Add(QObject):
     def __init__(self) -> None:
     def __init__(self) -> None:
         super(Add, self).__init__()
         super(Add, self).__init__()
 
 
+
     @Slot(result="QVariantList")
     @Slot(result="QVariantList")
     def all_script_files(self) -> list:
     def all_script_files(self) -> list:
         """
         """

+ 45 - 3
module/gui/context/process_manager.py

@@ -1,13 +1,38 @@
 # This Python file uses the following encoding: utf-8
 # This Python file uses the following encoding: utf-8
 # @author runhey
 # @author runhey
 # github https://github.com/runhey
 # github https://github.com/runhey
+import socket
+import random
+import zerorpc
+
+from PySide6.QtCore import QObject, Slot, Signal
 
 
 from module.gui.process.script_process import ScriptProcess
 from module.gui.process.script_process import ScriptProcess
 from module.gui.context.add import Add
 from module.gui.context.add import Add
 from module.logger import logger
 from module.logger import logger
 
 
 
 
-class ProcessManager:
+def is_port_in_use(ip, port) -> bool:
+    """
+    检查端口是否被占用
+    :param ip:
+    :param port:
+    :return:
+    """
+    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+    try:
+        s.connect((ip, port))
+        s.shutdown(2)
+        logger.info(f'port {port} is in use')
+        return True
+    except:
+        logger.info(f'port {port} is not in use')
+        return False
+
+
+
+
+class ProcessManager(QObject):
     """
     """
     进程管理
     进程管理
     """
     """
@@ -17,8 +42,11 @@ class ProcessManager:
         init
         init
         """
         """
         super().__init__()
         super().__init__()
-        self.processes = {}
+        self.processes = {}  # 持有所有的进程
+        self.ports = {}  # 持有所有的端口
+        self.clients = {}  # zerorpc连接的客户端
 
 
+    @Slot()
     def create_all(self) -> None:
     def create_all(self) -> None:
         """
         """
         创建所有的配置实例
         创建所有的配置实例
@@ -35,7 +63,18 @@ class ProcessManager:
         :return:
         :return:
         """
         """
         if config not in self.processes:
         if config not in self.processes:
-            self.processes[config] = ScriptProcess(config)
+            port = 40000 + random.randint(0, 200)
+            while is_port_in_use('127.0.0.1', port):
+                port = 40000 + random.randint(0, 200)
+            self.ports[config] = port
+            self.processes[config] = ScriptProcess(config, port)
+            logger.info(f'create script {config} on port {port}')
+            try:
+                self.clients[config] = zerorpc.Client()
+                self.clients[config].connect(f'tcp://127.0.0.1:{self.ports[config]}')
+            except:
+                logger.exception(f'connect to script {config} error')
+                raise
             self.processes[config].start()
             self.processes[config].start()
             logger.info(f'add script {config}')
             logger.info(f'add script {config}')
         else:
         else:
@@ -50,7 +89,10 @@ class ProcessManager:
         if config in self.processes:
         if config in self.processes:
             self.processes[config].stop()
             self.processes[config].stop()
             del self.processes[config]
             del self.processes[config]
+            del self.ports[config]
+            del self.clients[config]
             logger.info(f'remove script {config}')
             logger.info(f'remove script {config}')
+            logger.info(f'port {config} is released')
         else:
         else:
             logger.info(f'script {config} is not running')
             logger.info(f'script {config} is not running')
 
 

+ 53 - 0
module/gui/context/settings.py

@@ -0,0 +1,53 @@
+# This Python file uses the following encoding: utf-8
+# @author runhey
+# github https://github.com/runhey
+from pathlib import Path
+from PySide6.QtCore import QObject, Slot, Signal
+
+from module.logger import logger
+
+class Setting(QObject):
+
+    @classmethod
+    def copy_from_template(cls) -> None:
+        """
+        从模板复制一个配置文件
+        :return:
+        """
+        template_path = Path.cwd() / 'module' / 'config' / 'argument' / 'setting-template.json'
+        if not template_path.exists():
+            logger.error('template.json not exists')
+            return
+        with open(template_path, 'r', encoding='utf-8') as f:
+            data = f.read()
+        setting_path = Path.cwd() / 'module' / 'config' / 'argument' / 'setting.json'
+        with open(setting_path, 'w', encoding='utf-8') as f:
+            f.write(data)
+        logger.info('setting.json copy from template.json success')
+
+    @Slot(result="QString")
+    def read(self) -> str:
+        """
+        读取配置文件的数据
+        :return:
+        """
+        setting_path = Path.cwd() / 'module' / 'config' / 'argument' / 'setting.json'
+        if not setting_path.exists():
+            logger.error('setting.json not exists')
+            self.copy_from_template()
+        with open(setting_path, 'r', encoding='utf-8') as f:
+            return f.read()
+
+    @Slot(str)
+    def update(self, data: str) -> None:
+        """
+        更新配置文件的数据
+        :return:
+        """
+        setting_path = Path.cwd() / 'module' / 'config' / 'argument' / 'setting.json'
+        if not setting_path.exists():
+            logger.error('setting.json not exists')
+            self.copy_from_template()
+        with open(setting_path, 'w', encoding='utf-8') as f:
+            f.write(data)
+        logger.info('setting.json update success')

+ 5 - 1
module/gui/process/script_process.py

@@ -9,13 +9,15 @@ from module.logger import logger
 
 
 class ScriptProcess(Process):
 class ScriptProcess(Process):
 
 
-    def __init__(self, config: str) -> None:
+    def __init__(self, config: str, port: int) -> None:
         """
         """
 
 
+        :param port: 端口 tcp 127.0.0.1:port
         :param config: 如oas1
         :param config: 如oas1
         """
         """
         super().__init__()
         super().__init__()
         self.config = config
         self.config = config
+        self.port = port
         self.name = config
         self.name = config
         self.daemon = True  # 设置为守护进程,主进程结束,子进程也结束
         self.daemon = True  # 设置为守护进程,主进程结束,子进程也结束
 
 
@@ -35,6 +37,8 @@ class ScriptProcess(Process):
         try:
         try:
             from script import Script
             from script import Script
             script = Script(config_name=self.config)
             script = Script(config_name=self.config)
+            script.init_server(self.port)
+            script.run_server()
         except:
         except:
             logger.exception(f'run script {self.config} error')
             logger.exception(f'run script {self.config} error')
             raise
             raise

+ 3 - 0
module/gui/qml.qrc

@@ -15,5 +15,8 @@
         <file>qml/Component/FluDialog.qml</file>
         <file>qml/Component/FluDialog.qml</file>
         <file>qml/Component/FComboBox.qml</file>
         <file>qml/Component/FComboBox.qml</file>
         <file>qml/Component/FItemDelegate.qml</file>
         <file>qml/Component/FItemDelegate.qml</file>
+        <file>qml/Page/ScriptView.qml</file>
+        <file>qml/Component/ScriptItem.qml</file>
+        <file>qml/Component/OverView.qml</file>
     </qresource>
     </qresource>
 </RCC>
 </RCC>

+ 3 - 0
module/gui/qml/Component/Add.qml

@@ -9,6 +9,8 @@ FluContentDialog{
     id:dialog
     id:dialog
     title:"Add new config"
     title:"Add new config"
 
 
+    signal updateScriptItems
+
     contentItem: Rectangle {
     contentItem: Rectangle {
         id:layout_content
         id:layout_content
         implicitWidth:minWidth
         implicitWidth:minWidth
@@ -125,6 +127,7 @@ FluContentDialog{
     onPositiveClicked:{
     onPositiveClicked:{
         showSuccess("已创建")
         showSuccess("已创建")
         add_config.copy(newNameBox.text, copyConfig.currentText)
         add_config.copy(newNameBox.text, copyConfig.currentText)
+        dialog.updateScriptItems()
     }
     }
 
 
     onOpened: {
     onOpened: {

+ 8 - 0
module/gui/qml/Component/OverView.qml

@@ -0,0 +1,8 @@
+import QtQuick
+import FluentUI
+
+Item {
+    FluText{
+        text: "i kdow this overview"
+    }
+}

+ 11 - 0
module/gui/qml/Component/ScriptItem.qml

@@ -0,0 +1,11 @@
+import QtQuick
+import FluentUI
+import "../Global/"
+
+FluPaneItem{
+    title: "home"
+    icon:FluentIcons.Play36
+    onTap:{
+        navigationView.push(Qt.resolvedUrl("../../qml/Page/ScriptView.qml"))
+    }
+}

+ 92 - 8
module/gui/qml/Component/SplitPanel.qml

@@ -3,6 +3,7 @@ import QtQuick.Controls
 import FluentUI
 import FluentUI
 
 
 Item {
 Item {
+    signal clickMessage(string text)
 
 
     // 左边菜单
     // 左边菜单
     FluArea{
     FluArea{
@@ -13,17 +14,27 @@ Item {
         FluTreeView{
         FluTreeView{
             id: menu_tree
             id: menu_tree
             anchors.fill: parent
             anchors.fill: parent
-            Component.onCompleted: {
-                var datas = []
-                datas.push(createItem("Node1",false))
-                datas.push(createItem("Node2",false))
-                datas.push(createItem("Node2",true,[createItem("Node2-1",false),createItem("Node2-2",false)]))
-                updateData(datas)
-            }
+            selectionMode: FluTabView.SizeToContent
+
+            onItemClicked:(model)=>{
+                    clickMessage(model.text)
+                    showSuccess(model.text)
+                }
         }
         }
     }
     }
     // 右边内容
     // 右边内容
-    FluArea{
+    Loader{
+        id: contentDefalut
+        anchors.right: parent.right
+        anchors.rightMargin: 12
+        anchors.left: menuArea.right
+        anchors.leftMargin: 12
+        anchors.top: parent.top
+        anchors.bottom: parent.bottom
+        anchors.bottomMargin: 12
+    }
+    Loader{
+        id: contentLoader
         anchors.right: parent.right
         anchors.right: parent.right
         anchors.rightMargin: 12
         anchors.rightMargin: 12
         anchors.left: menuArea.right
         anchors.left: menuArea.right
@@ -32,4 +43,77 @@ Item {
         anchors.bottom: parent.bottom
         anchors.bottom: parent.bottom
         anchors.bottomMargin: 12
         anchors.bottomMargin: 12
     }
     }
+
+    Component.onCompleted: {
+        var datas = []
+        datas.push(menu_tree.createItem("Home",false))
+        datas.push(menu_tree.createItem("Update",false))
+//        datas.push(menu_tree.createItem("Node2",true,[createItem("Node2-1",false),createItem("Node2-2",false)]))
+        menu_tree.updateData(datas)
+    }
+    //创建左边的菜单,最多两级
+    //['home', 'xxx':['x1', 'x2']]
+    function create(data){
+        var datas = []
+        for(var items in data){
+            if(items.length === 0){
+                datas.push(menu_tree.createItem(items,false))
+            }else{
+                var da = []
+                for(var item in data[items]){
+                    da.push(menu_tree.createItem(data[items][item], false))
+                }
+                datas.push(menu_tree.createItem(items, true, da))
+            }
+        }
+        menu_tree.updateData(datas)
+
+//        for(let items of data){
+//        if(items.length === 'string'){
+//            datas.push(menu_tree.createItem(items,false))
+//        }else{
+//            var da = []
+//            for(let item of items){
+//                da.push(menu_tree.createItem(item,false))
+//            }
+//            datas.push(menu_tree.createItem(items, true, da))
+//        }
+
+//        }
+    }
+
+    //右侧的分为两个部分一个部分是contentDefalut表示固定的不动的
+    //第二个部分是一个加载器动态加载不同的组件
+    //显示固定的部分
+    function showDefalut(){
+        contentDefalut.visible = true
+        contentLoader.visible = false
+    }
+    //显示不固定的
+    function showLoader(){
+        contentDefalut.visible = false
+        contentLoader.visible = true
+    }
+
+    //设置固定的部分的具体内容  主要是传一个组件
+    function setDefalut(component){
+        contentDefalut.sourceComponent = component
+        showDefalut()
+    }
+    //
+    function setLoader(component){
+        contentLoader.sourceComponent = component
+        showLoader()
+    }
+
+    //获取固定的部分的对象的,方便更改属性
+//    function getDefalut(){
+//        return contentDefalut.item
+//    }
+//    //方便更改属性
+//    function getDefalut(){
+//        return contentLoader.item
+//    }
+
+
 }
 }

+ 9 - 1
module/gui/qml/Global/ItemsFooter.qml

@@ -2,6 +2,7 @@ pragma Singleton
 
 
 import QtQuick
 import QtQuick
 import FluentUI
 import FluentUI
+import "../Global/"
 
 
 FluObject{
 FluObject{
 
 
@@ -12,7 +13,14 @@ FluObject{
     FluPaneItemSeparator{}
     FluPaneItemSeparator{}
 
 
     FluPaneItem{
     FluPaneItem{
-        title: "关于"
+        title: "add"
+        icon: FluentIcons.Add
+        onTap:{
+            MainEvent.addOpen = !MainEvent.addOpen
+        }
+    }
+    FluPaneItem{
+        title: "about"
         icon:FluentIcons.Contact
         icon:FluentIcons.Contact
         tapFunc:function(){
         tapFunc:function(){
             console.debug("this click about")
             console.debug("this click about")

+ 46 - 8
module/gui/qml/Global/ItemsOriginal.qml

@@ -15,14 +15,6 @@ FluObject{
             navigationView.push(Qt.resolvedUrl("../../qml/Page/O_Home.qml"))
             navigationView.push(Qt.resolvedUrl("../../qml/Page/O_Home.qml"))
         }
         }
     }
     }
-    FluPaneItem{
-        title: "add"
-        icon: FluentIcons.Add
-        onTap:{
-            MainEvent.addOpen = !MainEvent.addOpen
-        }
-    }
-
     function getRecentlyAddedData(){
     function getRecentlyAddedData(){
         var arr = []
         var arr = []
         for(var i=0;i<children.length;i++){
         for(var i=0;i<children.length;i++){
@@ -70,5 +62,51 @@ FluObject{
     function startPageByItem(data){
     function startPageByItem(data){
         navigationView.startPageByItem(data)
         navigationView.startPageByItem(data)
     }
     }
+    //获取现在存在的所有的Item
+    function allPaneItems(){
+        var arr = []
+        var items = navigationView.getItems();
+        for(var i=0;i<items.length;i++){
+            var item = items[i]
+            if(item instanceof FluPaneItem){
+                arr.push(item.title)
+            }
+        }
+        return arr
+    }
+
+    //动态添加Paneitem
+    function createPaneItem(configName){
+        var component = Qt.createComponent("../../qml/Component/ScriptItem.qml")
+        if (component.status === Component.Ready) {
+            var object = component.createObject(itemsOriginal, {
+                title: configName
+            });
+
+            if (object !== null) {
+                object.title = configName
+                // 创建成功,可以进行操作
+                children.push(object)
+//                children.insert(children.length -1, object)
+//                children.splice(children.length-1, object)
+            } else {
+                // 创建失败
+            }
+        } else {
+            // 组件加载失败
+        }
+    }
+    //给添加
+    function addFluPaneItems(){
+        var configs = add_config.all_script_files()
+        var exists = allPaneItems()
+        for(var i=0; i<configs.length; i++){
+            if(exists.includes(configs[i])){
+                console.debug('已经存在了:'+configs[i])
+            }else{
+            createPaneItem(configs[i])
+            }
+        }
+    }
 
 
 }
 }

+ 100 - 0
module/gui/qml/Global/MainEvent.qml

@@ -4,7 +4,9 @@ import QtQuick
 import QtQuick.Controls
 import QtQuick.Controls
 import FluentUI
 import FluentUI
 
 
+
 QtObject {
 QtObject {
+    id: mainEvent
     enum RunStatus {
     enum RunStatus {
         Error,
         Error,
         Run,
         Run,
@@ -12,8 +14,106 @@ QtObject {
         Empty //不显示
         Empty //不显示
     }
     }
 
 
+    // 界面的自定义设置
+    property var settings: {""}
     property int displayMode : FluNavigationView.Compact
     property int displayMode : FluNavigationView.Compact
+    property int darkMode: FluDarkMode.System
+    property QtObject primaryColor: FluColors.Orange
+    property bool nativeText: true
+    property string language: "zh-CN"
+
     property int runStatus: MainEvent.RunStatus.Empty
     property int runStatus: MainEvent.RunStatus.Empty
     property string menuTitle: "主页"
     property string menuTitle: "主页"
     property bool addOpen: false
     property bool addOpen: false
+    property string scriptName: ""
+
+    Component.onCompleted:{
+        var set = JSON.parse(setting.read())
+        mainEvent.settings = set
+        if(mainEvent.settings === ""){
+            mainEvent.settings = {
+                "displayMode": 1,
+                "darkMode": 2,
+                "primaryColor": "Orange",
+                "nativeText": true,
+                "language": "zh-CN"}
+        }
+
+        console.debug(displayMode, darkMode, primaryColor, nativeText, language)
+        mainEvent.displayMode = set["displayMode"]
+        mainEvent.darkMode = set["darkMode"]
+        mainEvent.nativeText = set["nativeText"]
+        mainEvent.language = set["language"]
+
+        var primary_color = set["primaryColor"]
+        if(primary_color === "Yellow"){mainEvent.primaryColor = FluColors.Yellow}
+        else if(primary_color === "Orange"){mainEvent.primaryColor = FluColors.Orange}
+        else if(primary_color === "Red"){mainEvent.primaryColor = FluColors.Red}
+        else if(primary_color === "Magenta"){mainEvent.primaryColor = FluColors.Magenta}
+        else if(primary_color === "Purple"){mainEvent.primaryColor = FluColors.Purple}
+        else if(primary_color === "Blue"){mainEvent.primaryColor = FluColors.Blue}
+        else if(primary_color === "Teal"){mainEvent.primaryColor = FluColors.Teal}
+        else if(primary_color === "Green"){mainEvent.primaryColor = FluColors.Green}
+        console.debug(displayMode, darkMode, primaryColor, nativeText, language)
+    }
+    onDisplayModeChanged: {
+        if(mainEvent.settings === ""){
+            console.debug('display mode and is none')
+        }
+
+        mainEvent.settings["displayMode"] = mainEvent.displayMode
+        setting.update(JSON.stringify(mainEvent.settings))
+//        showSuccess('update dark mode')
+    }
+    onDarkModeChanged: {
+        if(mainEvent.settings === ""){
+            console.debug('darkMode and is none')
+        }
+        FluTheme.darkMode = mainEvent.darkMode
+        mainEvent.settings["darkMode"] = FluTheme.darkMode
+        setting.update(JSON.stringify(mainEvent.settings))
+//        showSuccess('update dark mode' + FluTheme.darkMode)
+    }
+    onPrimaryColorChanged: {
+        if(mainEvent.settings === ""){
+            console.debug('primaryColor and is none')
+            var set = JSON.parse(setting.read())
+            mainEvent.settings = set
+            return
+        }
+
+        FluTheme.primaryColor = mainEvent.primaryColor
+        var primary_color = "Yellow"
+        if(FluTheme.primaryColor === FluColors.Yellow){primary_color="Yellow"}
+        else if(FluTheme.primaryColor === FluColors.Orange){primary_color="Orange"}
+        else if(FluTheme.primaryColor === FluColors.Red){primary_color="Red"}
+        else if(FluTheme.primaryColor === FluColors.Magenta){primary_color="Magenta"}
+        else if(FluTheme.primaryColor === FluColors.Purple){primary_color="Purple"}
+        else if(FluTheme.primaryColor === FluColors.Blue){primary_color="Blue"}
+        else if(FluTheme.primaryColor === FluColors.Teal){primary_color="Teal"}
+        else if(FluTheme.primaryColor === FluColors.Green){primary_color="Green"}
+        mainEvent.settings["primaryColor"] = primary_color
+        setting.update(JSON.stringify(mainEvent.settings))
+//        showSuccess('update primary color' + FluTheme.primaryColor)
+    }
+    onNativeTextChanged: {
+        if(mainEvent.settings === ""){
+            console.debug('nativeText and is none')
+        }
+
+        FluTheme.nativeText = mainEvent.nativeText
+        mainEvent.settings["nativeText"] = FluTheme.nativeText
+        setting.update(JSON.stringify(mainEvent.settings))
+//        var message = 'update native text' + FluTheme.nativeText
+//        showSuccess(message)
+    }
+    onLanguageChanged: {
+        if(mainEvent.settings === ""){
+            console.debug('language and is none')
+        }
+
+        mainEvent.settings["language"] = mainEvent.language
+        setting.update(JSON.stringify(mainEvent.settings))
+//        showSuccess('update language' + mainEvent.language)
+    }
 }
 }

+ 8 - 3
module/gui/qml/MainWindow.qml

@@ -18,7 +18,6 @@ FluWindow {
     minimumHeight: 460
     minimumHeight: 460
     launchMode: FluWindow.SingleTask
     launchMode: FluWindow.SingleTask
 
 
-
     FluAppBar{
     FluAppBar{
        id:appbar
        id:appbar
        z:9
        z:9
@@ -64,6 +63,10 @@ FluWindow {
         onAdd_openChanged: {
         onAdd_openChanged: {
             add.open()
             add.open()
         }
         }
+        onUpdateScriptItems: {
+            nav_view.items.addFluPaneItems()
+            process_manager.create_all()
+        }
     }
     }
 
 
     FluNavigationView{
     FluNavigationView{
@@ -79,9 +82,11 @@ FluWindow {
             items.navigationView = nav_view
             items.navigationView = nav_view
             footerItems.navigationView = nav_view
             footerItems.navigationView = nav_view
             nav_view.setCurrentIndex(0)
             nav_view.setCurrentIndex(0)
+            items.addFluPaneItems()
         }
         }
     }
     }
-
-
+    Component.onCompleted:{
+        process_manager.create_all()
+    }
 
 
 }
 }

+ 5 - 5
module/gui/qml/Page/O_Settings.qml

@@ -32,10 +32,10 @@ FluScrollablePage{
             Repeater{
             Repeater{
                 model: [{title:"System",mode:FluDarkMode.System},{title:"Light",mode:FluDarkMode.Light},{title:"Dark",mode:FluDarkMode.Dark}]
                 model: [{title:"System",mode:FluDarkMode.System},{title:"Light",mode:FluDarkMode.Light},{title:"Dark",mode:FluDarkMode.Dark}]
                 delegate:  FluRadioButton{
                 delegate:  FluRadioButton{
-                    selected : FluTheme.darkMode === modelData.mode
+                    selected : MainEvent.darkMode === modelData.mode
                     text:modelData.title
                     text:modelData.title
                     onClicked:{
                     onClicked:{
-                        FluTheme.darkMode = modelData.mode
+                        MainEvent.darkMode = modelData.mode
                     }
                     }
                 }
                 }
             }
             }
@@ -107,7 +107,7 @@ FluScrollablePage{
                             anchors.fill: parent
                             anchors.fill: parent
                             hoverEnabled: true
                             hoverEnabled: true
                             onClicked: {
                             onClicked: {
-                                FluTheme.primaryColor = modelData
+                                MainEvent.primaryColor = modelData
                             }
                             }
                         }
                         }
                     }
                     }
@@ -119,9 +119,9 @@ FluScrollablePage{
             }
             }
             FluToggleSwitch{
             FluToggleSwitch{
                 Layout.topMargin: 5
                 Layout.topMargin: 5
-                selected: FluTheme.nativeText
+                selected: MainEvent.nativeText
                 clickFunc:function(){
                 clickFunc:function(){
-                    FluTheme.nativeText = !FluTheme.nativeText
+                    MainEvent.nativeText = !MainEvent.nativeText
                 }
                 }
             }
             }
         }
         }

+ 23 - 0
module/gui/qml/Page/ScriptView.qml

@@ -0,0 +1,23 @@
+import QtQuick
+import QtQuick.Controls
+import FluentUI
+import "../Component"
+import "../Global"
+
+SplitPanel{
+
+    property string configName: ""
+
+
+    Component.onCompleted:{
+        var data = {'OverView':[], 'Script': ['Script', 'General', 'Restart']}
+        create(data)
+
+        var component = Qt.createComponent("../../qml/Component/OverView.qml")
+        if (component.status === Component.Ready) {
+            setDefalut(component)
+        } else {
+            // 组件加载失败
+        }
+    }
+}

+ 2 - 1
requirements-in.txt

@@ -8,4 +8,5 @@ numpy==1.24.3
 opencv-python==4.7.0.72
 opencv-python==4.7.0.72
 websockets==11.0.3
 websockets==11.0.3
 anytree==2.8.0
 anytree==2.8.0
-pywin32==306
+pywin32==306
+zerorpc==0.6.3

+ 49 - 5
script.py

@@ -1,19 +1,63 @@
 # This Python file uses the following encoding: utf-8
 # This Python file uses the following encoding: utf-8
 # @author runhey
 # @author runhey
 # github https://github.com/runhey
 # github https://github.com/runhey
-
+import zerorpc
+import zmq
+import random
 from cached_property import cached_property
 from cached_property import cached_property
 
 
-from module.device.device import Device
+from module.logger import logger
+from module.exception import *
 
 
 class Script:
 class Script:
     def __init__(self, config_name: str ='oas') -> None:
     def __init__(self, config_name: str ='oas') -> None:
+        self.server = None
         self.config_name = config_name
         self.config_name = config_name
-        print('this is script')
 
 
     @cached_property
     @cached_property
-    def device(self) -> Device:
-        pass
+    def config(self) -> "Config":
+        try:
+            from module.config.config import Config
+            config = Config(config_name=self.config_name)
+            return config
+        except RequestHumanTakeover:
+            logger.critical('Request human takeover')
+            exit(1)
+        except Exception as e:
+            logger.exception(e)
+            exit(1)
+
+    @cached_property
+    def device(self) -> "Device":
+        try:
+            from module.device.device import Device
+            device = Device(config=self.config)
+            return device
+        except RequestHumanTakeover:
+            logger.critical('Request human takeover')
+            exit(1)
+        except Exception as e:
+            logger.exception(e)
+            exit(1)
+
+    def init_server(self, port: int) -> int:
+        """
+        初始化zerorpc服务,返回端口号
+        :return:
+        """
+        self.server = zerorpc.Server(self)
+        try:
+            self.server.bind(f'tcp://127.0.0.1:{port}')
+            return port
+        except zmq.error.ZMQError:
+            logger.error(f"Ocr server cannot bind on port {port}")
+            return None
 
 
 
 
+    def run_server(self) -> None:
+        """
+        启动zerorpc服务
+        :return:
+        """
+        self.server.run()