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": {
|
||||
"Collect": true
|
||||
},
|
||||
"GiftofOdyssey": {
|
||||
"Collect": true,
|
||||
"GiftofOdysseyClaimed": {}
|
||||
}
|
||||
},
|
||||
"Weekly": {
|
||||
|
@ -1378,6 +1378,18 @@
|
||||
"type": "checkbox",
|
||||
"value": true
|
||||
}
|
||||
},
|
||||
"GiftofOdyssey": {
|
||||
"Collect": {
|
||||
"type": "checkbox",
|
||||
"value": true
|
||||
},
|
||||
"GiftofOdysseyClaimed": {
|
||||
"type": "stored",
|
||||
"value": {},
|
||||
"display": "display",
|
||||
"stored": "StoredInt"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Weekly": {
|
||||
|
@ -136,6 +136,11 @@ DungeonStorage:
|
||||
color: "#8fb5fe"
|
||||
SupportReward:
|
||||
Collect: true
|
||||
GiftofOdyssey:
|
||||
Collect: true
|
||||
GiftofOdysseyClaimed:
|
||||
stored: StoredInt
|
||||
display: display
|
||||
Planner:
|
||||
PlannerOverall:
|
||||
stored: StoredPlannerOverall
|
||||
|
@ -951,6 +951,18 @@
|
||||
"order": 0,
|
||||
"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": {
|
||||
"name": "SimulatedUniverseFarm",
|
||||
"path": "Rogue.RogueWorld.SimulatedUniverseFarm",
|
||||
|
@ -50,6 +50,7 @@ Daily:
|
||||
Freebies:
|
||||
- Scheduler
|
||||
- SupportReward
|
||||
- GiftofOdyssey
|
||||
|
||||
# ==================== Weekly ====================
|
||||
|
||||
|
@ -67,6 +67,10 @@ class GeneratedConfig:
|
||||
# Group `SupportReward`
|
||||
SupportReward_Collect = True
|
||||
|
||||
# Group `GiftofOdyssey`
|
||||
GiftofOdyssey_Collect = True
|
||||
GiftofOdyssey_GiftofOdysseyClaimed = {}
|
||||
|
||||
# Group `Planner`
|
||||
Planner_PlannerOverall = {}
|
||||
Planner_Item_Credit = {}
|
||||
|
@ -500,6 +500,20 @@
|
||||
"help": ""
|
||||
}
|
||||
},
|
||||
"GiftofOdyssey": {
|
||||
"_info": {
|
||||
"name": "Gift of Odyssey",
|
||||
"help": ""
|
||||
},
|
||||
"Collect": {
|
||||
"name": "Claim Gift of Odyssey",
|
||||
"help": ""
|
||||
},
|
||||
"GiftofOdysseyClaimed": {
|
||||
"name": "Claimed X days of reward",
|
||||
"help": ""
|
||||
}
|
||||
},
|
||||
"Planner": {
|
||||
"_info": {
|
||||
"name": "Character Planner Progress",
|
||||
@ -1256,4 +1270,4 @@
|
||||
"Clear": "Clear"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -500,6 +500,20 @@
|
||||
"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": {
|
||||
"_info": {
|
||||
"name": "Progreso del planificador de personajes",
|
||||
|
@ -500,6 +500,20 @@
|
||||
"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": {
|
||||
"_info": {
|
||||
"name": "Planner._info.name",
|
||||
|
@ -500,6 +500,20 @@
|
||||
"help": ""
|
||||
}
|
||||
},
|
||||
"GiftofOdyssey": {
|
||||
"_info": {
|
||||
"name": "巡星之礼(版本十连)",
|
||||
"help": ""
|
||||
},
|
||||
"Collect": {
|
||||
"name": "领取巡星之礼",
|
||||
"help": ""
|
||||
},
|
||||
"GiftofOdysseyClaimed": {
|
||||
"name": "已领取 X 天",
|
||||
"help": ""
|
||||
}
|
||||
},
|
||||
"Planner": {
|
||||
"_info": {
|
||||
"name": "养成规划进度",
|
||||
@ -1256,4 +1270,4 @@
|
||||
"Clear": "清除"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -500,6 +500,20 @@
|
||||
"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": {
|
||||
"_info": {
|
||||
"name": "養成規劃進度",
|
||||
|
@ -114,4 +114,5 @@ class StoredGenerated:
|
||||
CloudRemainSeasonPass = StoredInt("DataUpdate.CloudStorage.CloudRemainSeasonPass")
|
||||
CloudRemainPaid = StoredInt("DataUpdate.CloudStorage.CloudRemainPaid")
|
||||
CloudRemainFree = StoredInt("DataUpdate.CloudStorage.CloudRemainFree")
|
||||
GiftofOdysseyClaimed = StoredInt("Freebies.GiftofOdyssey.GiftofOdysseyClaimed")
|
||||
SimulatedUniverseFarm = StoredSimulatedUniverseElite("Rogue.RogueWorld.SimulatedUniverseFarm")
|
||||
|
@ -1,6 +1,8 @@
|
||||
from module.logger import logger
|
||||
from module.base.base import ModuleBase
|
||||
from tasks.freebies.support_reward import SupportReward
|
||||
from tasks.freebies.gift_of_odyssey import GiftofOdyssey
|
||||
|
||||
|
||||
class Freebies(ModuleBase):
|
||||
def run(self):
|
||||
@ -10,5 +12,12 @@ class Freebies(ModuleBase):
|
||||
if self.config.SupportReward_Collect:
|
||||
logger.hr('Support Reward')
|
||||
SupportReward(config=self.config, device=self.device).run()
|
||||
|
||||
self.config.task_delay(server_update=True)
|
||||
if self.config.GiftofOdyssey_Collect:
|
||||
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()
|
||||
results = ocr.matched_ocr(self.device.image, GiftOfOdysseyEvent)
|
||||
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
|
||||
if len(results) == 1:
|
||||
break
|
||||
@ -58,6 +59,7 @@ class GiftofOdyssey(UI):
|
||||
logger.info(f"Claim status (Claimed, Claim, Awaiting check in): {status}")
|
||||
if sum(status) != 7:
|
||||
logger.warning("Num of OCR results is not seven")
|
||||
self.config.stored.GiftofOdysseyClaimed.value = status[0]
|
||||
return status
|
||||
|
||||
def _get_reward(self):
|
||||
|
Loading…
Reference in New Issue
Block a user