deopster / mercenaries-hearthstone-game-bot Goto Github PK
View Code? Open in Web Editor NEWbot for hearthstone mercenaries mode
License: Apache License 2.0
bot for hearthstone mercenaries mode
License: Apache License 2.0
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.
Each time you finished the level, you will get about 5-15 coins of the hero you used.
This is the fastet way to get the reward of PVP reward(coins),beacuse
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.
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.
load here yr zips with screens
Hi,
Sometimes the bot fail to start a new battle. I found 2 patterns where it happens :
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
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
Actually, with Linux, the bot manipulate HS when it is in a window.
I don't know why but in fullscreen there is a problem :
Would be nice if the bot could work when Hearthstone is not in fullscreen.
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?
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?
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.
The bot check some enemies and sometimes, it doesn't know which one to choose.
Then, it clicks in the middle. It works when there is an even number of enemies.
If there is an odd number, it click between two enemies.
Hi,
I use Linux and AHK doesn't work (no AHK for Linux, others libraries needed or Wine needed and possibly a lot of headaches).
Could you use pynput ? https://pypi.org/project/pynput/
It works for Linux, MacOS and Windows :
https://pynput.readthedocs.io/en/latest/limitations.html
Regards
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.
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"
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.