mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2025-02-07 03:08:45 +00:00
Add gui options
This commit is contained in:
parent
e92ecc9486
commit
9877d1203d
@ -223,6 +223,10 @@
|
|||||||
},
|
},
|
||||||
"SupportReward": {
|
"SupportReward": {
|
||||||
"Collect": true
|
"Collect": true
|
||||||
|
},
|
||||||
|
"GiftofOdyssey": {
|
||||||
|
"Collect": true,
|
||||||
|
"GiftofOdysseyClaimed": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Weekly": {
|
"Weekly": {
|
||||||
|
@ -1378,6 +1378,18 @@
|
|||||||
"type": "checkbox",
|
"type": "checkbox",
|
||||||
"value": true
|
"value": true
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"GiftofOdyssey": {
|
||||||
|
"Collect": {
|
||||||
|
"type": "checkbox",
|
||||||
|
"value": true
|
||||||
|
},
|
||||||
|
"GiftofOdysseyClaimed": {
|
||||||
|
"type": "stored",
|
||||||
|
"value": {},
|
||||||
|
"display": "display",
|
||||||
|
"stored": "StoredInt"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Weekly": {
|
"Weekly": {
|
||||||
|
@ -136,6 +136,11 @@ DungeonStorage:
|
|||||||
color: "#8fb5fe"
|
color: "#8fb5fe"
|
||||||
SupportReward:
|
SupportReward:
|
||||||
Collect: true
|
Collect: true
|
||||||
|
GiftofOdyssey:
|
||||||
|
Collect: true
|
||||||
|
GiftofOdysseyClaimed:
|
||||||
|
stored: StoredInt
|
||||||
|
display: display
|
||||||
Planner:
|
Planner:
|
||||||
PlannerOverall:
|
PlannerOverall:
|
||||||
stored: StoredPlannerOverall
|
stored: StoredPlannerOverall
|
||||||
|
@ -951,6 +951,18 @@
|
|||||||
"order": 0,
|
"order": 0,
|
||||||
"color": "#777777"
|
"color": "#777777"
|
||||||
},
|
},
|
||||||
|
"GiftofOdysseyClaimed": {
|
||||||
|
"name": "GiftofOdysseyClaimed",
|
||||||
|
"path": "Freebies.GiftofOdyssey.GiftofOdysseyClaimed",
|
||||||
|
"i18n": "GiftofOdyssey.GiftofOdysseyClaimed.name",
|
||||||
|
"stored": "StoredInt",
|
||||||
|
"attrs": {
|
||||||
|
"time": "2020-01-01 00:00:00",
|
||||||
|
"value": 0
|
||||||
|
},
|
||||||
|
"order": 0,
|
||||||
|
"color": "#777777"
|
||||||
|
},
|
||||||
"SimulatedUniverseFarm": {
|
"SimulatedUniverseFarm": {
|
||||||
"name": "SimulatedUniverseFarm",
|
"name": "SimulatedUniverseFarm",
|
||||||
"path": "Rogue.RogueWorld.SimulatedUniverseFarm",
|
"path": "Rogue.RogueWorld.SimulatedUniverseFarm",
|
||||||
|
@ -50,6 +50,7 @@ Daily:
|
|||||||
Freebies:
|
Freebies:
|
||||||
- Scheduler
|
- Scheduler
|
||||||
- SupportReward
|
- SupportReward
|
||||||
|
- GiftofOdyssey
|
||||||
|
|
||||||
# ==================== Weekly ====================
|
# ==================== Weekly ====================
|
||||||
|
|
||||||
|
@ -67,6 +67,10 @@ class GeneratedConfig:
|
|||||||
# Group `SupportReward`
|
# Group `SupportReward`
|
||||||
SupportReward_Collect = True
|
SupportReward_Collect = True
|
||||||
|
|
||||||
|
# Group `GiftofOdyssey`
|
||||||
|
GiftofOdyssey_Collect = True
|
||||||
|
GiftofOdyssey_GiftofOdysseyClaimed = {}
|
||||||
|
|
||||||
# Group `Planner`
|
# Group `Planner`
|
||||||
Planner_PlannerOverall = {}
|
Planner_PlannerOverall = {}
|
||||||
Planner_Item_Credit = {}
|
Planner_Item_Credit = {}
|
||||||
|
@ -500,6 +500,20 @@
|
|||||||
"help": ""
|
"help": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"GiftofOdyssey": {
|
||||||
|
"_info": {
|
||||||
|
"name": "Gift of Odyssey",
|
||||||
|
"help": ""
|
||||||
|
},
|
||||||
|
"Collect": {
|
||||||
|
"name": "Claim Gift of Odyssey",
|
||||||
|
"help": ""
|
||||||
|
},
|
||||||
|
"GiftofOdysseyClaimed": {
|
||||||
|
"name": "Claimed X days of reward",
|
||||||
|
"help": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
"Planner": {
|
"Planner": {
|
||||||
"_info": {
|
"_info": {
|
||||||
"name": "Character Planner Progress",
|
"name": "Character Planner Progress",
|
||||||
@ -1256,4 +1270,4 @@
|
|||||||
"Clear": "Clear"
|
"Clear": "Clear"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -500,6 +500,20 @@
|
|||||||
"help": ""
|
"help": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"GiftofOdyssey": {
|
||||||
|
"_info": {
|
||||||
|
"name": "GiftofOdyssey._info.name",
|
||||||
|
"help": "GiftofOdyssey._info.help"
|
||||||
|
},
|
||||||
|
"Collect": {
|
||||||
|
"name": "GiftofOdyssey.Collect.name",
|
||||||
|
"help": "GiftofOdyssey.Collect.help"
|
||||||
|
},
|
||||||
|
"GiftofOdysseyClaimed": {
|
||||||
|
"name": "GiftofOdyssey.GiftofOdysseyClaimed.name",
|
||||||
|
"help": "GiftofOdyssey.GiftofOdysseyClaimed.help"
|
||||||
|
}
|
||||||
|
},
|
||||||
"Planner": {
|
"Planner": {
|
||||||
"_info": {
|
"_info": {
|
||||||
"name": "Progreso del planificador de personajes",
|
"name": "Progreso del planificador de personajes",
|
||||||
|
@ -500,6 +500,20 @@
|
|||||||
"help": ""
|
"help": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"GiftofOdyssey": {
|
||||||
|
"_info": {
|
||||||
|
"name": "GiftofOdyssey._info.name",
|
||||||
|
"help": "GiftofOdyssey._info.help"
|
||||||
|
},
|
||||||
|
"Collect": {
|
||||||
|
"name": "GiftofOdyssey.Collect.name",
|
||||||
|
"help": "GiftofOdyssey.Collect.help"
|
||||||
|
},
|
||||||
|
"GiftofOdysseyClaimed": {
|
||||||
|
"name": "GiftofOdyssey.GiftofOdysseyClaimed.name",
|
||||||
|
"help": "GiftofOdyssey.GiftofOdysseyClaimed.help"
|
||||||
|
}
|
||||||
|
},
|
||||||
"Planner": {
|
"Planner": {
|
||||||
"_info": {
|
"_info": {
|
||||||
"name": "Planner._info.name",
|
"name": "Planner._info.name",
|
||||||
|
@ -500,6 +500,20 @@
|
|||||||
"help": ""
|
"help": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"GiftofOdyssey": {
|
||||||
|
"_info": {
|
||||||
|
"name": "巡星之礼(版本十连)",
|
||||||
|
"help": ""
|
||||||
|
},
|
||||||
|
"Collect": {
|
||||||
|
"name": "领取巡星之礼",
|
||||||
|
"help": ""
|
||||||
|
},
|
||||||
|
"GiftofOdysseyClaimed": {
|
||||||
|
"name": "已领取 X 天",
|
||||||
|
"help": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
"Planner": {
|
"Planner": {
|
||||||
"_info": {
|
"_info": {
|
||||||
"name": "养成规划进度",
|
"name": "养成规划进度",
|
||||||
@ -1256,4 +1270,4 @@
|
|||||||
"Clear": "清除"
|
"Clear": "清除"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -500,6 +500,20 @@
|
|||||||
"help": ""
|
"help": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"GiftofOdyssey": {
|
||||||
|
"_info": {
|
||||||
|
"name": "GiftofOdyssey._info.name",
|
||||||
|
"help": "GiftofOdyssey._info.help"
|
||||||
|
},
|
||||||
|
"Collect": {
|
||||||
|
"name": "GiftofOdyssey.Collect.name",
|
||||||
|
"help": "GiftofOdyssey.Collect.help"
|
||||||
|
},
|
||||||
|
"GiftofOdysseyClaimed": {
|
||||||
|
"name": "GiftofOdyssey.GiftofOdysseyClaimed.name",
|
||||||
|
"help": "GiftofOdyssey.GiftofOdysseyClaimed.help"
|
||||||
|
}
|
||||||
|
},
|
||||||
"Planner": {
|
"Planner": {
|
||||||
"_info": {
|
"_info": {
|
||||||
"name": "養成規劃進度",
|
"name": "養成規劃進度",
|
||||||
|
@ -114,4 +114,5 @@ class StoredGenerated:
|
|||||||
CloudRemainSeasonPass = StoredInt("DataUpdate.CloudStorage.CloudRemainSeasonPass")
|
CloudRemainSeasonPass = StoredInt("DataUpdate.CloudStorage.CloudRemainSeasonPass")
|
||||||
CloudRemainPaid = StoredInt("DataUpdate.CloudStorage.CloudRemainPaid")
|
CloudRemainPaid = StoredInt("DataUpdate.CloudStorage.CloudRemainPaid")
|
||||||
CloudRemainFree = StoredInt("DataUpdate.CloudStorage.CloudRemainFree")
|
CloudRemainFree = StoredInt("DataUpdate.CloudStorage.CloudRemainFree")
|
||||||
|
GiftofOdysseyClaimed = StoredInt("Freebies.GiftofOdyssey.GiftofOdysseyClaimed")
|
||||||
SimulatedUniverseFarm = StoredSimulatedUniverseElite("Rogue.RogueWorld.SimulatedUniverseFarm")
|
SimulatedUniverseFarm = StoredSimulatedUniverseElite("Rogue.RogueWorld.SimulatedUniverseFarm")
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
from module.logger import logger
|
from module.logger import logger
|
||||||
from module.base.base import ModuleBase
|
from module.base.base import ModuleBase
|
||||||
from tasks.freebies.support_reward import SupportReward
|
from tasks.freebies.support_reward import SupportReward
|
||||||
|
from tasks.freebies.gift_of_odyssey import GiftofOdyssey
|
||||||
|
|
||||||
|
|
||||||
class Freebies(ModuleBase):
|
class Freebies(ModuleBase):
|
||||||
def run(self):
|
def run(self):
|
||||||
@ -10,5 +12,12 @@ class Freebies(ModuleBase):
|
|||||||
if self.config.SupportReward_Collect:
|
if self.config.SupportReward_Collect:
|
||||||
logger.hr('Support Reward')
|
logger.hr('Support Reward')
|
||||||
SupportReward(config=self.config, device=self.device).run()
|
SupportReward(config=self.config, device=self.device).run()
|
||||||
|
if self.config.GiftofOdyssey_Collect:
|
||||||
self.config.task_delay(server_update=True)
|
logger.hr('Gift of Odyssey')
|
||||||
|
if self.config.stored.GiftofOdysseyClaimed == 7:
|
||||||
|
logger.hr('All Claimed in this patch')
|
||||||
|
else:
|
||||||
|
GiftofOdyssey(config=self.config, device=self.device).run()
|
||||||
|
|
||||||
|
self.config.task_delay(server_update=True)
|
||||||
|
|
||||||
|
@ -30,7 +30,8 @@ class GiftofOdyssey(UI):
|
|||||||
self.device.screenshot()
|
self.device.screenshot()
|
||||||
results = ocr.matched_ocr(self.device.image, GiftOfOdysseyEvent)
|
results = ocr.matched_ocr(self.device.image, GiftOfOdysseyEvent)
|
||||||
if len(results) == 0 and timer.reached():
|
if len(results) == 0 and timer.reached():
|
||||||
logger.info("Event not found")
|
logger.info("Event not found, probably already been claimed")
|
||||||
|
self.config.stored.GiftofOdysseyClaimed.value = 7
|
||||||
return False
|
return False
|
||||||
if len(results) == 1:
|
if len(results) == 1:
|
||||||
break
|
break
|
||||||
@ -58,6 +59,7 @@ class GiftofOdyssey(UI):
|
|||||||
logger.info(f"Claim status (Claimed, Claim, Awaiting check in): {status}")
|
logger.info(f"Claim status (Claimed, Claim, Awaiting check in): {status}")
|
||||||
if sum(status) != 7:
|
if sum(status) != 7:
|
||||||
logger.warning("Num of OCR results is not seven")
|
logger.warning("Num of OCR results is not seven")
|
||||||
|
self.config.stored.GiftofOdysseyClaimed.value = status[0]
|
||||||
return status
|
return status
|
||||||
|
|
||||||
def _get_reward(self):
|
def _get_reward(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user