Skip to content

修复活动无法刷活动票任务,增加自动切换门票,100体,体力爬塔活动任务;结界式神添加智能放入;增加每日任务的一键收菜#1522

Closed
rwerplus wants to merge 30 commits into
runhey:devfrom
rwerplus:gfw/develop
Closed

修复活动无法刷活动票任务,增加自动切换门票,100体,体力爬塔活动任务;结界式神添加智能放入;增加每日任务的一键收菜#1522
rwerplus wants to merge 30 commits into
runhey:devfrom
rwerplus:gfw/develop

Conversation

@rwerplus
Copy link
Copy Markdown
Contributor

@rwerplus rwerplus commented May 4, 2026

Summary by Sourcery

通过增强活动爬塔自动化中的票券/体力处理、支持 AP100、优化战斗流程,并为结界添加智能式神摆放以及新增一键庭院收菜日常任务。

New Features:

  • 新增 AP100(100 体力)爬塔子流程,包含独立入口、资源检查、队伍预设和战斗循环。
  • 引入基于体力的爬塔路径,当票券耗尽时自动回退,同时保留现有的基于票券的爬塔路径。
  • 增加每日免费票券弹窗的自动处理,并改进进入活动主战场和票券战斗的导航流程。
  • 提供新的“一键庭院收菜(全部领取)”日常任务,用于收取奖励并处理相关弹窗。
  • 在结界开启中引入智能式神摆放,利用一键清空和训练界面中的智能填充功能。

Bug Fixes:

  • 修复在跳过不支持的爬塔类型时活动爬塔类型索引不同步的问题,避免错误读取配置。
  • 提高剩余票券/AP 数量 OCR 的鲁棒性,通过重试数字识别和调整 ROI,避免识别为 0 或误计数。
  • 确保战斗进入和等待流程能够正确检测失败/被阻塞状态,并进行恢复或退出,而不是无限循环,包括 AP100 奖励界面。
  • 修正活动资源坐标和页面识别锚点,以更可靠地识别主战场和战斗 UI。
  • 修复在非整数 ROI 上进行 OCR 裁剪时的问题,先将 ROI 转为整数再进行图像切片。

Enhancements:

  • 统一票券与体力爬塔循环,共享战斗逻辑,同时允许各模式使用特定的资源门槛与恢复行为。
  • 扩展队伍锁定/解锁处理,支持爬塔类型特定的锁图标,包括 AP100 布局。
  • 优化结界满级式神替换逻辑,从逐格手动操作改为依赖智能摆放。
  • 调整开发测试脚本与资源测试,使用新的配置和活动 OCR 目标,以简化调试。
Original summary in English

Summary by Sourcery

Enhance activity climb automation with robust ticket/stamina handling, AP100 support, and smarter battle flows, while adding smart shikigami placement for Kekkai and a new one-tap courtyard harvest daily task.

New Features:

  • Add AP100 (100 stamina) climb subflow with dedicated entry, resource checks, team presets, and battle loop.
  • Introduce stamina-based climb path that automatically falls back when no tickets remain, alongside the existing ticket-based climb.
  • Add automatic daily free-ticket popup handling and improved navigation into the activity main battlefield and ticket battles.
  • Provide a new one-tap courtyard harvest (claim all) daily task that collects rewards and handles related popups.
  • Introduce smart shikigami placement in Kekkai activation using one-click remove and intelligent fill in the training view.

Bug Fixes:

  • Fix activity climb type index desynchronization when skipping unsupported climb types, preventing misrouted configuration reads.
  • Improve OCR robustness for remaining tickets/AP counts by retrying digit recognition and adjusting ROIs, avoiding false zeros and miscounts.
  • Ensure battle entry and wait flows correctly detect failure/blocked states and recover or exit instead of looping indefinitely, including AP100 reward screens.
  • Correct activity asset coordinates and page detection anchors to more reliably recognize the main battlefield and battle UIs.
  • Fix OCR cropping on non-integer ROIs by casting to integers before slicing images.

Enhancements:

  • Unify ticket and stamina climb loops to share battle logic while allowing mode-specific resource gates and recovery behaviors.
  • Extend team lock/unlock handling to support climb-type specific lock icons, including AP100 layouts.
  • Refine Kekkai max-level shikigami replacement to rely on smart placement instead of manual per-slot operations.
  • Adjust dev test scripts and asset tests to use new configs and activity OCR targets for easier debugging.

gfwong and others added 30 commits November 12, 2025 21:50
…, improve OCR handling, and introduce daily free ticket popup processing.
…igami management, with assets and task flow enhancements.
@rwerplus
Copy link
Copy Markdown
Contributor Author

rwerplus commented May 4, 2026

#1520

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

你好,我在下面给出了一些高层面的反馈:

  • _goto_main_battlefield 中包含一个 while 1 循环:如果在 main_clicks < max_main_clicks 的情况下,一直没有检测到任何一个被跟踪的锚点(I_CHECK_BATTLE_MAIN/_2、I_TO_BATTLE_MAIN_2、I_TO_BATTLE_MAIN),那么循环体可能会在不增加计数器、也不休眠的情况下空转;建议添加 sleep 调用和/或额外的退出条件,以避免在意料之外的 UI 上出现紧密的无限循环。
  • 默认配置 profile 在 ActivityShikigami 和 DailyTrifles 的测试/入口代码中都从 “oas1” 改成了 “欢哥”;如果这是用户或环境相关的设置,最好改为可配置,或者保持一个中性的默认值,以避免把某个开发者的个人 profile 写死在代码里。
面向 AI 代理的提示
Please address the comments from this code review:

## Overall Comments
- _goto_main_battlefield contains a `while 1` loop where, if none of the tracked anchors (I_CHECK_BATTLE_MAIN/_2, I_TO_BATTLE_MAIN_2, I_TO_BATTLE_MAIN) appear and `main_clicks < max_main_clicks`, the body can spin without incrementing counters or sleeping; consider adding a sleep and/or an additional escape condition to avoid a tight infinite loop on unexpected UIs.
- The default config profile has been changed from 'oas1' to '欢哥' in both ActivityShikigami and DailyTrifles test/entry code; if this is user- or environment-specific, it would be better to make it configurable or keep a neutral default to avoid hardcoding one developer's profile.

Sourcery 对开源项目是免费的——如果你觉得这次的代码审查有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈来改进后续的审查。
Original comment in English

Hey - I've left some high level feedback:

  • _goto_main_battlefield contains a while 1 loop where, if none of the tracked anchors (I_CHECK_BATTLE_MAIN/_2, I_TO_BATTLE_MAIN_2, I_TO_BATTLE_MAIN) appear and main_clicks < max_main_clicks, the body can spin without incrementing counters or sleeping; consider adding a sleep and/or an additional escape condition to avoid a tight infinite loop on unexpected UIs.
  • The default config profile has been changed from 'oas1' to '欢哥' in both ActivityShikigami and DailyTrifles test/entry code; if this is user- or environment-specific, it would be better to make it configurable or keep a neutral default to avoid hardcoding one developer's profile.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- _goto_main_battlefield contains a `while 1` loop where, if none of the tracked anchors (I_CHECK_BATTLE_MAIN/_2, I_TO_BATTLE_MAIN_2, I_TO_BATTLE_MAIN) appear and `main_clicks < max_main_clicks`, the body can spin without incrementing counters or sleeping; consider adding a sleep and/or an additional escape condition to avoid a tight infinite loop on unexpected UIs.
- The default config profile has been changed from 'oas1' to '欢哥' in both ActivityShikigami and DailyTrifles test/entry code; if this is user- or environment-specific, it would be better to make it configurable or keep a neutral default to avoid hardcoding one developer's profile.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@LGG686
Copy link
Copy Markdown
Contributor

LGG686 commented May 4, 2026

一键收菜重启任务里已经有了

@rwerplus
Copy link
Copy Markdown
Contributor Author

rwerplus commented May 4, 2026

一键收菜重启任务里已经有了

一直没看到呢,可能我的客户端没更新呢

@runhey runhey closed this May 4, 2026
@runhey runhey reopened this May 4, 2026
@runhey
Copy link
Copy Markdown
Owner

runhey commented May 4, 2026

太多了,你让ai拆分成几个pr

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Change Summary

  • 新增 AP100(100体力/雪山修行)爬塔子流程,含独立入口、资源检查、阵容切换与战斗循环
  • 重构 AP 槽位为门票爬塔与体力爬塔两个子模式,通过主战场 OCR 资源量自动选择路径
  • 新增每日赠票弹窗自动处理(横幅关闭 + 主界面关闭)
  • 修复非整数 ROI 导致 OCR 裁剪错误的问题(base_ocr.py)
  • 修复跳过不支持爬塔类型时 run_idx 与 climb_type 失步的问题
  • 修复活动资源坐标偏移,提升主战场与战斗界面识别稳定性
  • 结界挂卡引入智能放入(I_SMART_REMOVE + I_SMART_PLACE)替代逐格手动操作
  • 新增每日任务"一键收菜"(run_claim_all)

Reconstructed Intent

点击此处展开
  1. 修复票券爬塔失效:票券爬塔无法正常刷取活动票任务,根因包括 climb_type 失步、OCR 误读为 0、坐标偏移导致识别失败
  2. 扩展体力爬塔:在原有 AP 体力爬塔基础上新增 AP100(100体力)子模式,与门票爬塔并行存在
  3. 自动降级策略:当票券耗尽时自动切换到体力爬塔,无需用户手动干预
  4. 智能结界式神放置:用训练界面的一键卸下+智能放入替代满级式神的逐格手动替换
  5. 一键庭院收菜:新增独立任务自动领取庭院奖励,简化日常操作

Observed Constraints

点击此处展开
  1. AP100 依赖专属资源:需要 AP100 专属锁图标(as_ap100_lock.png)、AP100 专属入口(as_ap_100_check.png / as_ap_100_check_main.png)和 AP100 专属剩余次数 OCR(O_REMAIN_AP100_MAIN,ROI 在战斗界面顶部)
  2. 门票爬塔依赖透视模式:需要先点 I_TICKET_DOOR_CLOSE 打开 I_TICKET_DOOR_OPEN 才能识别 I_TICKET_ENTER / I_TICKET_ENTER_1
  3. run_sequence 隐式约束:run_sequence 从 "pass,boss,ap" 改为 "pass,ap100,boss,ap",ap100 插入位置会影响旧配置用户的实际行为
  4. 每日赠票弹窗依赖两个识别位:I_DAILY_FREE_TICKET(横幅)和 I_CHECK_MAIN_FREE_TICKET(主界面)需同时存在才能完整处理
  5. 智能放入依赖训练界面状态:_smart_place_shikigami 假设已在式神育成界面,且 I_SMART_REMOVE / I_SMART_PLACE 可见性依赖界面当前状态

Intent Alignment

  • 实现与推断 intent 基本一致
  • AP100 作为独立子流程正确实现,门票/体力自动切换逻辑合理
  • 每日赠票弹窗处理为可重入的子流程,不阻塞主战场进入
  • 智能放入逻辑从逐格操作改为依赖 UI 智能功能,方向正确但依赖训练界面状态
  • run_sequence 变更在 dev 分支,不影响现有用户配置(dev 分支本身是开发中状态)

Release Risk

  • 风险等级:
  • 风险点 1:AP100 入口坐标(as_ap_100_check.png ROI 65,195,98,30)和战斗界面坐标(as_ap_100_check_main.png ROI 86,15,138,41)依赖活动界面实际位置,不同活动副本位置可能偏移,需线上验证
  • 风险点 2:OCR 重试逻辑(_ocr_digit_reliable)在连续 3 次返回 0 时会真实返回 0,可能导致提前退出而非重试;建议确认 paddle OCR 对"雪山修行"等特殊文字的识别稳定性
  • 风险点 3:ticket_door 透视模式逻辑(_click_ticket_door_to_battle_area)在视角偏离时依赖 ap_reset_pos 兜底点击,无法直接验证是否成功归位

Validation Gaps

点击此处展开
  1. AP100 链路未完整验证:_run_ap100 在 _goto_main_battlefield 后 OCR O_REMAIN_AP100(主战场左侧栏),若该位置在不同活动中坐标不同会导致误判;缺少实际游戏数据验证
  2. 每日赠票弹窗只在主战场进入前处理:若在爬塔中途弹出每日赠票弹窗,代码没有兜底处理路径
  3. 智能放入的 I_RS_NO_ADD 信号:_smart_place_shikigami 中使用 "I_RS_NO_ADD 从屏幕上消失" 作为放入成功信号,但未验证该资产在不同育成界面状态下的稳定性
  4. OCR ROI 调整缺乏对比:O_REMAIN_PASS2 的 ROI 从 (750,17,88,29) 改为 (1136,17,88,29),x 偏移近 400px;需要确认这是正确的资产位置还是修改错误
  5. run_sequence 变更的向后兼容:原配置中 enable_pass/ap/boss=true 的用户迁移到新 run_sequence 格式后行为可能改变,需要明确迁移路径或配置警告

Generated by PR Review Intent for issue #1522 · ● 453K ·

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants