-
Notifications
You must be signed in to change notification settings - Fork 967
Feat: [WIP] 離島計畫配置管理 #5211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Feat: [WIP] 離島計畫配置管理 #5211
Conversation
module/island/interact.py
Outdated
| def dismiss(self, repeats=1): | ||
| """ | ||
| Dismiss any popups if exist | ||
| """ | ||
| for _ in range(repeats): | ||
| self.device.click(self.BTN_EMPTY) | ||
| self.device.sleep(0.1) | ||
|
|
||
| def click_and_wait_until_appear(self, | ||
| btn: Button, | ||
| *targets: list, | ||
| threshold=20, | ||
| similarity=0.85, | ||
| timeout=Timer(5, 10), | ||
| interval=1 | ||
| ): | ||
| """ | ||
| Click a button and wait until one of given target appear | ||
| Args: | ||
| btn: Button to click | ||
| targets: List of target template or button to wait for | ||
| threshold: Matching threshold for button | ||
| similarity: Similarity threshold for target | ||
| timeout: Timeout timer | ||
| interval: Interval between click and check | ||
| Returns: | ||
| The target button appeared, or None if timeout | ||
| """ | ||
| timeout.reset() | ||
| while 1: | ||
| if timeout.reached(): | ||
| logger.error(f'Timeout waiting for {",".join([t.name for t in targets])} to appear') | ||
| return False | ||
| self.device.click(btn) | ||
| self.device.sleep(interval) | ||
| self.device.screenshot() | ||
| for t in targets: | ||
| if isinstance(t, Button): | ||
| if self.appear(t, threshold=threshold, similarity=similarity): | ||
| return t | ||
| elif isinstance(t, Template): | ||
| sim, btn = t.match_luma_result(self.device.image) | ||
| if sim >= similarity: | ||
| return btn | ||
| else: | ||
| logger.warning(f'Invalid target type: {type(t)}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已移除並優化流程於原 post_manage.py
module/config/argument/argument.yaml
Outdated
| _anchors: | ||
| mining_options: &mining_options | ||
| - disabled | ||
| - coal | ||
| - copper | ||
| - aluminum | ||
| lumbering_options: &lumbering_options | ||
| - disabled | ||
| - raw | ||
| - useful | ||
| - premium |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
用户设置过多,去找攻略看怎么玩,尽量做到无需设置直接运行 获得最大收益
不使用yaml 的 & * 语法
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已簡化設置,攻略這種東西不存在的
RT,需解鎖離島計畫和配置科技後才可使用,目前功能為自動領取和排程牧場、礦山、森林,僅會使用黃雞工人且牧場和礦山只能選擇前三種產物的其中一個。
因 OCR 功能的限制,當前固定結束後 100 分鐘重跑一次 (石炭/原木 x5 所需時間);當前只適配了日服的資源,其他服需要有玩的人協助補齊資源。
目前還在逐漸調適除錯完善中,先開 PR 主要想 review 大方向有什麼需要調整或更改的 code