Skip to content

Conversation

@ken1882
Copy link
Contributor

@ken1882 ken1882 commented Oct 11, 2025

RT,需解鎖離島計畫和配置科技後才可使用,目前功能為自動領取和排程牧場、礦山、森林,僅會使用黃雞工人且牧場和礦山只能選擇前三種產物的其中一個。
因 OCR 功能的限制,當前固定結束後 100 分鐘重跑一次 (石炭/原木 x5 所需時間);當前只適配了日服的資源,其他服需要有玩的人協助補齊資源。

目前還在逐漸調適除錯完善中,先開 PR 主要想 review 大方向有什麼需要調整或更改的 code

Comment on lines 15 to 61
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)}')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已移除並優化流程於原 post_manage.py

Comment on lines 595 to 605
_anchors:
mining_options: &mining_options
- disabled
- coal
- copper
- aluminum
lumbering_options: &lumbering_options
- disabled
- raw
- useful
- premium
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用户设置过多,去找攻略看怎么玩,尽量做到无需设置直接运行 获得最大收益
不使用yaml 的 & * 语法

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已簡化設置,攻略這種東西不存在的

@LmeSzinc LmeSzinc added the feature request / 功能请求 New feature or requests label Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request / 功能请求 New feature or requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants