Skip to content
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

修正大世界4C战斗,红椿导致无法移动的问题 #279

Closed
wants to merge 2 commits into from

Conversation

Cidala0910
Copy link

@Cidala0910 Cidala0910 commented Jan 11, 2025

修正大世界4C战斗,红椿无法移动的问题

问题: 椿组队自动战斗过程中,战斗结束后有概率红椿不切人进行传送,导致下个boss无法正常开怪或者原地发呆被打死

@Cidala0910 Cidala0910 changed the title Update FarmWorldBossTask.py 修正大世界4C战斗,红椿无法移动的问题 Jan 11, 2025
@Cidala0910 Cidala0910 changed the title 修正大世界4C战斗,红椿无法移动的问题 修正大世界4C战斗,红椿导致无法移动的问题 Jan 11, 2025
@ok-oldking
Copy link
Owner

战斗结束如果是椿按理说会切角色, 搜一下Camellya on_combat_end

@Cidala0910
Copy link
Author

Cidala0910 commented Jan 13, 2025

战斗结束如果是椿按理说会切角色, 搜一下Camellya on_combat_end

实际有概率战斗后不切换角色, 暂时无法判断出现问题的具体原因,但是长时间必定会出现这个bug
test

@LiunianShuai
Copy link

确实有这个问题,我也遇到过

@b9348
Copy link
Contributor

b9348 commented Jan 13, 2025

确实有这个问题

@boqigao
Copy link

boqigao commented Jan 14, 2025

的确有这个问题,所以现在基本不敢用椿刷4c。

@BnanZ0
Copy link

BnanZ0 commented Jan 14, 2025

@ok-oldking
运行日志:
2025-01-14 23:25:52,635 INFO TaskExecutor BaseCombatTask:switch_next_char HavocRover -> Camellya has_intro True
2025-01-14 23:25:52,809 INFO TaskExecutor HavocRover:switch_out at full con set current_con to 0
2025-01-14 23:25:52,809 INFO TaskExecutor BaseCombatTask:switch_next_char end 0.174s
2025-01-14 23:26:01,188 ERROR TaskExecutor BaseCombatTask:too long a liberation, the boss was killed by the liberation
2025-01-14 23:26:01,222 INFO TaskExecutor BaseCombatTask:combat_once out of combat break too long a liberation, the boss was killed by the liberation
从这个日志来看问题大概率出在执行on_combat_end时角色处于无法切人的状态
self.get_current_char().on_combat_end(self.chars)
给on_combat_end内加入判断应该就行了

timeout = time.time() + 10
        while True:
            if time.time() > timeout:
                break
            in_team, current_index, count = self.task.in_team()
            if in_team:
                if self.task.chars[current_index].name == "Camellya":
                    self.task.send_key(next_char)
                else:
                    break
            self.sleep(0.2, False)

又找到一个bug,自动战斗都依赖于while self.in_combat()运行,但in_combat()本身的代码是不会抛出NotInCombatException,所以存在一种情况是self.get_current_char().perform()刚好运行到不会抛出NotInCombatException的位置,而后in_combat()回传false从而结束战斗且不运行on_combat_end()

@ok-oldking
Copy link
Owner

v2.0.20

@ok-oldking ok-oldking closed this Jan 15, 2025
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.

6 participants