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

Second run #15

Open
asakurato opened this issue Oct 31, 2021 · 21 comments
Open

Second run #15

asakurato opened this issue Oct 31, 2021 · 21 comments

Comments

@asakurato
Copy link

asakurato commented Oct 31, 2021

So, I know that finishok button is bugged right now, but if you move the mouse, the bot continues like normal. Except, when it starts the loop again, it gets stuck in the level selection menu. I have selected level 5 heroic in Barrens, but after the first run, bot gets stuck in the loop, just looking for "fir" and "ser" buttons and clicking them nonstop, resulting in an infinite loop. Relaunching the bot makes it continue like normal. This is on 1920x1080 res.
Edit: Looks like the problem is that the bot can't select the level that is already selected. The log says it can't find the level button, level 5 in my case.

@Efemache
Copy link
Contributor

Efemache commented Nov 19, 2021

Hi,
I had the same problem with some levels. It's related to the image used which show too much thing.
When the level is already selected, the blue halo isn't find on the picture.
It's easy to get it right :

  • take a screenshot (with the level selected) and cut only the upper part with the boss and the level and replace the original image (ex: files/1920x1080/level/5.png) (/!\ don't take the blue line or the bot won't recognize it when it's not already selected)
  • Deopster is little busy (my commit take too much time to be commit) => you can use my fork if you want. /!\ there is less tests because I'm using Linux (can't test on windows) but for what is not plaform specific (like your bug), it should work

Or You can use the branch "ForDeveloppement" (from the actual repo) which is newer (I put a lot of code which is not in "main")

My fork : https://github.com/Efemache/Mercenaries-Hearthstone-game-bot ('ill create a new branch like "improvement" for next commits)
I'll be back on this repo when Deopster will be available.

[Edit][new-url] https://github.com/Efemache/Mercenaries-Farm-bot

@Efemache
Copy link
Contributor

Efemache commented Nov 19, 2021

Better support for The Barrens and Felwood (normal and heroic) added :
https://github.com/Efemache/Mercenaries-Hearthstone-game-bot/tree/improve2
[Edit][new-url] https://github.com/Efemache/Mercenaries-Farm-bot

@asakurato
Copy link
Author

So, I tried your version, but it seems to be stuck on prize selection. When I look at cmd window, it seems to fail to find "presents" in UI_ellements. Granted, I'm trying Level 5 heroic from barrens, and only "presents" picture has 4 presents in them, so it probably fails because of that. I could try farming default level 27 felwood, but the bot is definitely not ready to for high-level bounties, because 1. The logic behind it lacks, often resulting in bad decisions, which results in a loss. 2. Most of the time, bot can't use moves (usually it's the middle one, in my case Samuro).

All I'm saying, that the bot is still not ready.

@Efemache
Copy link
Contributor

Hi,
I use the bot at level 27 (with only 3 heroes at level 30) and it beats the boss most of the time.
But you're right, the bot is not ready for each Heroes. It doesn't have any logic except "turn 1, do this; turn 2, do this" for some heroes and for others it's only "use the first button". And I think we are far far far away from this point.

There is a lot of bugs (i'm trying to solve them and each day I find new ones). So I'm trying to solve these bugs before to go for new features.

I'll try to look at this bug you're talking. The "present" image isn't needed.

@asakurato
Copy link
Author

Hi, I use the bot at level 27 (with only 3 heroes at level 30) and it beats the boss most of the time. But you're right, the bot is not ready for each Heroes. It doesn't have any logic except "turn 1, do this; turn 2, do this" for some heroes and for others it's only "use the first button". And I think we are far far far away from this point.

There is a lot of bugs (i'm trying to solve them and each day I find new ones). So I'm trying to solve these bugs before to go for new features.

I'll try to look at this bug you're talking. The "present" image isn't needed.

Honestly, even just working bot without logic and just using 1 button would be fine to farm low level bounties for coins.

@Efemache
Copy link
Contributor

Efemache commented Nov 21, 2021

Hello,

That's fine now : https://github.com/Efemache/Mercenaries-Hearthstone-game-bot/tree/improve2
[Edit][new-url] https://github.com/Efemache/Mercenaries-Farm-bot
I did a lot of tests with Barrens/heroic/level5 and Felwood/normal/level27 and it's working.

I changed a lot of code (not related to your bug) so I couldn't test everything (like Boon, Mysterious Encounter, group creation,...) but for rewards, battle, treasure, level selection, ... everything is fine.
With the previous code, bot was getting stuck a lot of time on the "road" (battle / encounter selection). With my 5-6 runs with this new code, I had 0 problem.

ps : I support only 1920x1080 and English language (for now)

@asakurato
Copy link
Author

Tried it again. Now it did choose all the rewards, but after that, it went to the main menu and kept looking for back button and pressing it, resulting in loop.

@Efemache
Copy link
Contributor

Tried it again. Now it did choose all the rewards, but after that, it went to the main menu and kept looking for back button and pressing it, resulting in loop.

Hi,
Yes I saw it and it's already fixed in a new version.

@asakurato
Copy link
Author

ok, I think it works now. The remaining problem I have is, sometimes bot doesn't use on of my heroes (I run Xyrella, Samuro and Cariele). I think it's because it tries to use second ability, but Samuro has that ability on cooldown.

@Efemache
Copy link
Contributor

Efemache commented Nov 21, 2021

ok, I think it works now. The remaining problem I have is, sometimes bot doesn't use on of my heroes (I run Xyrella, Samuro and Cariele). I think it's because it tries to use second ability, but Samuro has that ability on cooldown.

It's weird, the bot only uses 2 (or 3) abilities for 3 heroes.
For the other ones, it only uses the first ability. So for Samuro, it should use the first one.

I remember, I already saw the bot to doesn't use one of my hero.
It's from the previous code. I didn't touch this part for now (I already had a lot of things to make it work for full run and loop)
On this part, I only worked on two bugs :

  • one where the bot was clicking between two enemies so it didn't attack with any hero
  • another one where it wasn't clicking on "ready" button
    I know that sometimes, even if there are enemies, the bot don't "detect" them and write "Battle error,please write what happend on github issue"

You can open a new bug; We'll see if somebody can look at it.
I already changed a lot of code and made it easier (to read and modify), so I would like to work on this part for now.

I'll look into battle code latter.

@asakurato
Copy link
Author

Looks like I still can't get consistent second runs. I have two thing happening:

  1. The bot is either going back to main menu (reason unknown)
  2. The bot is works well until it goes to boss selection, but it gets stuck, because it keeps searching for "Botwork" party name, instead of choosing the boss.

@Efemache
Copy link
Contributor

Looks like I still can't get consistent second runs. I have two thing happening:

  1. The bot is either going back to main menu (reason unknown)
  2. The bot is works well until it goes to boss selection, but it gets stuck, because it keeps searching for "Botwork" party name, instead of choosing the boss.

Hi,
Yes I just found this one this morning.
I thing it's related to "tempo" (time.sleep()).
If I bring a quick patch, we'll find another one. I need more time to test / change how the bot is waiting and how long.

@Efemache
Copy link
Contributor

I pushed a quick/dirty patch but not tested.
I'll do better later.

@Efemache
Copy link
Contributor

A new version is available.
I tested it with 3 runs and it works well. I added new features, more information here :
#40 (comment)

@asakurato
Copy link
Author

I'll test it today, thanks.

@Efemache
Copy link
Contributor

Efemache commented Nov 23, 2021

Sometimes the second run doesn't start and I know why. When the "mercenaries menu" (where you can choose to see tasks, go to battle, see your mercenaries, etc...) is loaded, it takes some seconds before to be clickable.
I think you can add after line 954 a time.sleep(3) (or more if you want). It should be someting like this :
waitForItOrPass(chekers[21], 6) # chekers 21: 'menu'
time.sleep(3)
travelToLevel()

Try different values (3, 4, 5, 6 ...).
I'll change the code so the bot can resume wherever it is.

@Efemache
Copy link
Contributor

@asakurato since you are the only one to ask / answer :) , do you need the feature to (auto) create group ?
I think it's unnecessary, so maybe I'll delete this from a future version to make the file smaller and delete unwanted/unnecessary code.

@asakurato
Copy link
Author

@asakurato since you are the only one to ask / answer :) , do you need the feature to (auto) create group ? I think it's unnecessary, so maybe I'll delete this from a future version to make the file smaller and delete unwanted/unnecessary code.

Actually no, I don't need it, I mainly want the bot to farm coins, not level up.

@Efemache
Copy link
Contributor

Efemache commented Nov 25, 2021

Hi,
I decide to start a "new" project : https://github.com/Efemache/Mercenaries-Farm-bot
I continued with my fork and I decided to create a new project because :

  • I'm the only one to dev
  • Because working with the previous code, I can see we are not working on the same thing. The "previous" bot (the one in this repo) only to level up your heroes to 30 and create groups to do it. My purpose is to use a group to win some coins and to achieve the campfire tasks (because I haven't the time to do it each day)
    Feel free to use it or to use the one on this repo.

@Efemache
Copy link
Contributor

@asakurato
Copy link
Author

That's what I would like, I guess we continue there.

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

No branches or pull requests

2 participants