Giter Site home page Giter Site logo

hearthstonebot's Introduction

DISCONTINUED

https://github.com/HearthSim/Hearthstone-Deck-Tracker

May be a useful project for bot building.

Old README

This project is divided into 4 parts.

  • The bot plugin (Bot.dll), found at projects/Bot
  • The injector module (Injector.exe), found at projects/Injector
  • The commandline tool (LoaderCommandline.exe), found at projects/LoaderCommandline
  • The AI scripts, found at projects/Release/LuaScripts

The injector module, modifies the Blizzard dll file, Assembly-CSharp.dll, by injecting a reference to the Bot.dll file. This effectivly means that whenever Heartstone startup, it loads Bot.dll, which will be our hook into Heartstone.exe

The bot plugin, serves multiple purposes. 1. It allows us to send commands to Heartstone, from the commandline tool (via. a tcp server socket it opens). 2. It loads the lua enviroment, and fires off the ai lua script, also it triggers events in the ai scripts, whenever it makes sense to do so.

The commandline tool, is the interface to the entire system, it allows for easy inject into Heartstone, which involves invoking the injector module, copying the injected dll files, and any dependencies, that Bot.dll depends on. Also it's the tool for sending commands to Bot.dll, for instance starting the bot, stopping the bot, reloading the AI scripts, ect.

For a compresensive list of commands, please run the commandline tool, with --help.

The AI scripts are plain lua scripts, and an interface to interact with the game (implemented by hooks to C#).

Developer info:

  • error CS0006: Metadata file `Assembly-CSharp.dll' could not be found; This means you have not 'Assembly-CSharp.dll' into projects/Bot/lib, from the Hearthstone folder

hearthstonebot's People

Contributors

skeen 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  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hearthstonebot's Issues

Remove Autobotter

The autobotter subproject does not work, and is unlikely to ever do so. It should be removed entirely.

Work on the wiki

The wiki should have a gentle introduction to new developers, and a list of people to thank.
Possibly a history/timeline of the project.
Also the wiki could be used for developer discussion.

Random Enemy Spell Cards

The bot goes into an endless loop when it tries to use the hunter card Deadly Shot when there's no enemy on the field. The card requires at least one enemy minion on the board to activate, but the bot can't recognize that.

Mulligan errors and replace stray messages

Currently the mulligan phase, causes errors, and this results in stray "Replaced" messages, that do not disappear. It seems to be a timing issue, namely that mulligan is triggered before the game is able to handle mulligan. A hacky fix would be a pre-delay.

AI script

This bot need more improvement, spells other combo cards are not working properly
i mean it using arcane explosion while there is no minion on the battlefield

ill update whenever i found a bug or glitch
your work impressed me i am learning lua language now, thanks to you.

Sometimes not playing minions

Hi, first I want to say great work on what you have so far!
I ran the bot through a few AI games, and sometimes when the turn started I would hear the "sparkles" as if the bot was about to play a minion, but then would end its turn, even if there were minions already on the field that could have attacked. I also noticed that when this happened, the "end turn" button didn't flip over, it just stayed yellow through the AI turn.

LoaderGUI cleanup

The LoaderGUI currently invokes the LoaderCommaldline, while this works, it's not a pretty solution, we should instead separate the common functionality into a loader.dll file, and have the guis only be guis, not functionality!

This would also ease error handling in the GUI.

Duplicate Secrets

The bot keeps trying to play a secret even when the same secret has already been played. It hangs because you're only allowed one specific secret at a time on the board.

Giants

The bot doesn't seem to recognize when to play the card Molten Giant when it's mana requirement drops.

Choose an AI script on GUI?

I don't know if you plan to let the user choose the AI script?

What do you think about :

  • Separate Main.lua, API.lua & script_engine.lua (put it in /LuaScripts/Main or where you want) from AI scripts
  • Put all AI scripts on the same folder (ex. /LuaScripts/AIScripts)
  • List all AI scripts from this folder with a drop down menu
  • Load the choosen script when the user click on "Start bot"

Then the user can download or add differents AI scripts and manage it.

Minimax AI

The AI should be completely redesigned to use the minimax algorithm, via a game simulator, this will be the final goal of the AI subsystem.

Cleanup Readme.me

The readme file should be pretty, and have links to downloads, wiki, ect.

Remove the injector subproject

The injector is currently it's own executable, there is no real reason for this, it could as well just be a dll, or combined in the suggested loader dll from Ticket 23

C# Scripts.

Donovan has suggested having scripts written in C#, as these will easilier integrate with the system. These can be implemented via dynamic dll loading (and reloading).

External Connection, but no bot started

Sometimes the receiving socket is up, but starting the not is unavailable. This is maybe, according to Ticket 9, due to the use of the UIOutput in log.say

Humanlike mouse over

The bot should mouse over random cards, ect. to seem more 'human'. This will likely be easy to post hook, once the AI is changed to use a evaluation plan. An alternative would be random mouse over.

Hero Powers:

So I was screwing around, and Hero Powers that need targeting can be used by
if (cost <= available_crystals) then
local enemy_hero_card = GetCard(EnemyHero)
DoAttack(hero_power_card, enemy_hero_card)
end
and the ones that don't need targeting seems to work better if I use
if (cost <= available_crystals) then
DoAttack(hero_power_card, hero_power_card)
end
although I was wondering if there was a variable I can access to see if the hero power had already been used. I tried using a global variable in lua but it wasn't consistent.

Better Injection

Injection should be done into the running Hearthstone process, rather than via the loading process. We should also be able to update the bot, without restarting the Hearthstone process.

Replace commandline by interface

Good to see you there, dude.

I know that the project is just beginning, but will you change the commandline tool with a nice interface in a second time?

Explanation on how HB communicates to the HS client?

Hello,

Could you do some sort of write up or explanation on the nitty gritty specifics behind how HB communicates with the HS client? How to write an injector, how to do simple things such as click a button in an x,y coordinate. etc.

Remove injection

We have to remove the hook made by the injector when the application (hs.exe) is closed.

I think the best way is to copy the .dll from a backup folder to the application folder.
We just have to know when the hs.exe is closed.

Smarter Delaying

Currently delaying is done via the Delay call, which delays the next tick() call. This does however not delay at call time, we need an asynchronous sleeping mechanism which works alike Thread.Sleep(), but while returning to the callee. A solution alike coroutines in Lua. The concept we need for C# is continuations.

Log cleanup

Each of the sub projects currently have its own logging system, a combined system implemented via a common dll library, would ensure log consistency.

Delay between actions

You said the bot plays faster.

Maybe we can set a random delay at the start of our turn. Between 3 and 6 seconds?
And set this random delay between all actions?

Lock down userinput

It might be an idea to close off user input to the game, while the bot is running. This should be possible via the Inputmanager.

Conceding results in 'draw..?'

Currently when you, or the enemy concede a game, the text written to the screen, by the bot is "Draw...?". This can be improved a lot, by checking if a player has conceded, when this text is outputtet.

Autorun Unjector

Currently one has to explicitly launch the Unjector, while it could automatically be started, whenever the injector has been done, and Hearthstone is loaded. This would make it actually be used.

Enemy Minion Required Spell Cards

The bot goes into an endless loop when it tries to use spell cards that require an enemy on the board. The hunter card Deadly Shot requires at least one enemy minion while Multi Shot requires two. The bot doesn't recognize when it can't use those cards, but it keeps trying.

Playful Sprites

Some people seems to have the error "Playful sprites".
So they were disconnected from battle.net servers.

Some possibilities :

  • Battle.net app detect the injection and disconnect the user (seems impossible)
  • Battle.net servers are overloaded or anything else?
  • Lost of internet connection

So we could implement a reconnection feature?
Maybe a checkbox "Automatic reconnection" on the GUI?

How it should work:

  • The bot detect the "Playful sprites" or game crash
  • Kill hearthstone.exe
  • Unjection to avoid the update
  • Re-injection
  • Launch hearthstone.exe
  • Start a game

One other disconnection possibility, if the user is connected on another computer. If it's happend, I think there is no reconnection possible.

No mouse dependency

Currently the bot requires the mouse to be within the battlefield, in order to support attacking. This is a major issue, as it means the bot cannot run in the background.

This will require changes to the attack function of API.cs.

Error compiling

Hi, im trying compile the bot but dont compile correctly.

The code its for the lastest version of the game?

I get errors with this classes:
GameMode mode = ranked ? GameMode.RANKED_PLAY : GameMode.UNRANKED_PLAY;

Seem how the GameMode class dont exist into the assembly-csharp.dll.

It this code compilant for the release client of the game?

Thanks and if u need help to develop this let me know. At this moment i ripped all the code and start with a simple injection.
And im trying use a "stealth" injection via driver for avoid warden detection.

Pls contact with me to talk about the project : [email protected]

Updating the Lua scripts

Changing and updating the running Low scripts are currently quite cumbersome, as one has to run SCons, to first copy the changed scripts to the release folder, then actually run reload on the GUI.

Suggested solution, conditional compilation (Developer/Release), such that it loads the project/Release/Luascripts folder in developer mode, and does as currently in release mode.

AutoPulling dll files

Some of the DLL files required in the building process, namely unityengine.dll and assembly-csharp.dll have to be copied and updated manually, while the build system could be modified to pull these in automatically.

Inactivity disconnect.

According to Pkchu at OwnedCore one will be disconnected, if the mouse is not moved for 30 minuets, while in game, this means botting for extended periods of time require external scripting to do. It would be nice to have a (possibly integrated) solution for this on the repository, and distributed with the bot.

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.