GithubHelp home page GithubHelp logo

deopster / mercenaries-hearthstone-game-bot Goto Github PK

View Code? Open in Web Editor NEW
59.0 59.0 15.0 264 MB

bot for hearthstone mercenaries mode

License: Apache License 2.0

Python 99.78% Batchfile 0.10% Shell 0.12%
ahk bot hearthstone mss opencv

mercenaries-hearthstone-game-bot's People

Contributors

deopster avatar kiiiiiingdom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mercenaries-hearthstone-game-bot's Issues

2 new ideas about the game bot

2 new ideas getting more coins through the game bot
These idea are based on the fact that most heros have reached LV.30 and players lack the coin to upgrade their skills and equipments.

  1. Form a group which only consist 1 hero and play the easiest game level( the first checkpoint)
    No special or complicated skills needed
    Only take a short time to finish

Each time you finished the level, you will get about 5-15 coins of the hero you used.

  1. Surrender to each other when the PVP mode reached 6000 points.
    This is actually what is happening in Chinese Community. Great numbers of players around 6000 points playing in PVP mode are competing for who surrenders faster in the game.

This is the fastet way to get the reward of PVP reward(coins),beacuse

  1. The player who surrender faster can lower the MMR, but his point will not drop. (6000 is the minimum point)
  2. The player who surrender slower wins the game. Players can get the PVP reward after this occasion happens 5 times.
  3. Single game only takes less than 1 minute and the winning rate are expected to be close to 50% (actually a bit lower than that) if every player is doing that.
    In this case,
    Every 5-10 minutes, player can get the PVP reward which consists of 5 piles of coins.
    Players who wants to play ture PVP will soon reached 6500 points or above to compete with others. Player above 6500 points rarely surrender in the beginning.

However, this kind of method needs a lot of players in the community to reach a consensus. (Chinese do)

Maybe you can write a program and randomize the time of surrender to implement the game bot.

Second run

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.

[Bug] the bot doesn't start a new battle on the quest map

Hi,

Sometimes the bot fail to start a new battle. I found 2 patterns where it happens :

  1. when a task is finished after a fight (the bot try to click to find a new battle but HS didn't move the map at that time).
  2. when there is a button to revive a hero on the map => sometimes the bot click on it but you already on the next track

[Error] doesn't chose a character to fight and use only the one on the left

The bot start a game (level and normal/heroic found).
It doesn't chose any minion to put in the battle and click on start. So Hearthstone choose the 3 first minions.
After that, the bot click on your minion in the middle (the second) but do nothing and click on the first one (on your left) and choose to attack with this one but only with him; after that, it clicks on "battle/ready" button.

OS: Linux
Resolution: 1920x1080
Language : English
Fullscreen : no, because in fullscreen, the bot doesn't find chekers/menu.png (the screenshot is correct, though)

You'll find the logs / output below with the error "Battle error,please write what happend on github issue" :

start
['1920x1080', '27', 'Felwood', 'Normal', 'False', 'False', 1]
42
38
40
auto
auto
auto

[...]

['38.Natalie Seline.Blue', '40.Tamsin Roame.Blue', "42.Vol'jin.Blue", 'auto', 'auto', 'auto']
['Blue', 'Blue', 'Blue', 'auto', 'auto', 'auto']
204 38
212 32
151 32
Loop start
Found chekers/menu.png 1000 310
Битва
Found UI_ellements/battle.png 972 338
Not found UI_ellements/Felwood.png
Not found UI_ellements/normal.png
Not found chekers/levelstarted.png
Not found buttons/play.png
Found buttons/sta.png 1269 786
Found levels/27.png 811 758
Found buttons/start.png 1486 894
Not found chekers/find.png
Found chekers/find.png 411 410
Found buttons/start1.png 1432 921
Not found buttons/play.png
Not found buttons/submit.png
Not found buttons/play.png
Not found buttons/submit.png
Found buttons/play.png 1494 865
Not found buttons/num.png
Not found buttons/num.png
Not found buttons/num.png
Not found buttons/num.png
Not found buttons/num.png
Not found buttons/num.png
Not found buttons/num.png
Not found buttons/num.png
Not found buttons/num.png
Not found buttons/num.png
Not found buttons/num.png
Not found buttons/num.png
Found buttons/num.png 1524 531
(xp=0, yp=69, widthp=1920, heightp=1011)
Not found buttons/allready.png
Found buttons/onedie.png 1524 534
Not found chekers/win.png
Not found buttons/startbattle.png
Not found buttons/startbattle1.png
Not found buttons/onedie.png
Not found chekers/win.png
Not found buttons/startbattle.png
Not found buttons/startbattle1.png
Not found buttons/onedie.png
Not found chekers/win.png
Not found buttons/startbattle.png
Not found buttons/startbattle1.png
Not found buttons/onedie.png
Not found chekers/win.png
Not found buttons/startbattle.png
Not found buttons/startbattle1.png
Not found buttons/onedie.png
Not found chekers/win.png
Not found buttons/startbattle.png
Not found buttons/startbattle1.png
Not found buttons/onedie.png
Not found chekers/win.png
Found buttons/startbattle.png 1525 528
(xp=0, yp=69, widthp=1920, heightp=1011)
entered screenpart
Found UI_ellements/red.png 1070 415
Found UI_ellements/green.png 893 372
Found UI_ellements/blue.png 773 417
Not found UI_ellements/noclass.png
red: (1070, 415)
green: (893, 372)
blue: (773, 417)
noclass: (0, 0)
Not found UI_ellements/sob.png
entered screenpart
enter serch Red
Unsort Data of our heroes [['Red', 829, 816]]
['Red', 829, 816]
it wrote 829 in 0
enemiwiz now [829, 0, 0, 0, 0, 0]
herobattle now [['Red', 829, 816]]
[829, 0, 0, 0, 0, 0]
Sort Data of our heroes [['Red', 829, 816]]
enter serch Green
enter serch Blue
cords of my heroes
[['Red', 829, 816]]
print index ['Red', 829, 816]
Attack function
open Red
Red
Hero dump []
Not found buttons/allready.png
Not found buttons/allready.png
Not found buttons/allready.png
Not found buttons/allready.png
Not found buttons/allready.png
Not found buttons/allready.png
Not found buttons/allready.png
Not found buttons/allready.png
Not found buttons/allready.png
Not found buttons/allready.png
Not found buttons/allready.png
Not found buttons/allready.png
Battle error,please write what happend on github issue
Found buttons/startbattle.png 1524 529
Not found buttons/onedie.png
Not found chekers/win.png
Not found buttons/startbattle.png
Not found buttons/startbattle1.png
Not found buttons/onedie.png
Not found chekers/win.png
Not found buttons/startbattle.png
Not found buttons/startbattle1.png
Not found buttons/onedie.png
Not found chekers/win.png
Not found buttons/startbattle.png
Not found buttons/startbattle1.png
Not found buttons/onedie.png
Not found chekers/win.png
Found buttons/startbattle.png 1525 528
(xp=0, yp=69, widthp=1920, heightp=1011)
entered screenpart
Found UI_ellements/red.png 1070 415
Found UI_ellements/green.png 893 372
Found UI_ellements/blue.png 773 417
Not found UI_ellements/noclass.png
red: (1070, 415)
green: (893, 372)
blue: (773, 417)
noclass: (0, 0)
Not found UI_ellements/sob.png

[New version] a new version of the bot is available

Hi,

This repository is "freezed" for some times (no new commit).

I made a lot of improvements (bugs solved) on a new version.
If you want it t (we can all come back here when Deopster will be available), you can use my fork :
https://github.com/Efemache/Mercenaries-Farm-bot
(for now, my code will only be a fork and not a new project, so you need to use the "improve2" branch, no "main")

I added a Wiki :
https://github.com/Efemache/Mercenaries-Hearthstone-game-bot/wiki

Feel free to help (code, tests, screenshots, other ?)

[eidt] post updated with new project URL : https://github.com/Efemache/Mercenaries-Farm-bot
All my contribution will be on this bot/version

Question about resolution and screen size

Hi there! My screen is 4K 27 inch and I change the resolution to 1920*1080. And it doesn't work right. It can't find some UI elements. I've read your code. It seems that the program is looking for element position by resolution instead of size. I am not sure if this is a bug. Or maybe it baecase the matchTemplate func?

creat a HDT plugin?

I have a same idea about this project.

Maybe we can creat a HDT plugin to do this?

HDT under technology seem like "dll hook" and "capture web pkg".

If we use it to secondary dev is better?

finishok

The bot keeps getting stuck on finishok after a run through. At the end when it looks for "finishok.png" the mouse is stuck in the middle which hovers a character card covering the ok button.

Code commenting

Hi,

Could you put comments in your code please ?

Yesterday, I tried to change a part of the bot and I read ~1h30 to understand the code, functions, what the bot do, where it clicks and why, ... to find the only line I had to change.

When you, finally, understand each functions, returns, etc.... it's easy to find what you have to look for (and where) to change something, but when you don't know it, the code is very hard to understand.

[Bug] hero[n]_Number in settings.ini is buggy

You can't use a number greater than 6 in the section below :
[Heroes]
hero1_Number = 1
hero2_Number= 2
hero3_Number = 3
hero4_Number = auto
hero5_Number = auto
hero6_Number = -

The bot crashes with an error "out of range"

Hello! Question about the language.

I read this code briefly this morning and I am really curious about this.
Seems that this is based on opencv.
So if I want to use this, the Hearthstones' language option should be Ruassian?
Or I should change pictures into my own language?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.