Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

Bot could mistake a reachable target as unreachable #146

Open
probabilitystatistic opened this issue Jun 6, 2020 · 0 comments
Open

Bot could mistake a reachable target as unreachable #146

probabilitystatistic opened this issue Jun 6, 2020 · 0 comments

Comments

@probabilitystatistic
Copy link

probabilitystatistic commented Jun 6, 2020

I found that sometimes the bot gets stucked and keeps swiping the screen in the formation screen if the previous target is unreachable.

After checking the code, I think the bot did so because, after clicking on the reachable target, the "Unable to reach the target" dialog from a precious attempt clicking on an unreachable target has not yet disappeared and is captured by the bot, making the bot believe the present reachable target is unreachable. See the figure below:

log

A: clicking on an unreachable target and detect unreachable dialog.
B: found a new target(reachable) and click on it.
C: capturing the screen to read the result for the click in B, but the unreachable dialog from A has not yet disappeared. Therefore the bot thinks the reachable target in B is unreachable.

Note that it takes only 2 second from A to C so it's very likely the "unable to reach..." dialog still remains on the screen.

After C the fleet reaches the target and enter the formation screen. But the bot tries to find the position of the fleet due to the call self.get_closest_target(self.blacklist), and stucked, swiping the screen endlessly.

I think this could be avoided by requiring the bot to wait for like 1~2 second before clicking the new found target to ensure the "Unable to reach..." dialog disappear. In unable_handler within combat.py I add Utils.script_sleep(1) before each Utils.touch and now it seems to work fine.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant