https://github.com/ChuckFork/HearthstoneBot

Sigmund

Card game automation framework

Hooks game and loads plugins as they are modified (or explicitly requested to be reloaded). All plugins are run in separate threads (which are killed if the plugin is reloaded). Plugin libraries are rewritten to have different names to allow loading of multiple versions (thus the psuedo reload mechanic).

Developers just need to hit rebuild when working on a plugin to immediately see the effects in game.

Setup

  1. If needed, update ext/ with new Assembly-CSharp.dll, Mono.Cecil.dll (match the version Unity uses internally), and UnityEngine.dll
  2. Fix hardcoded paths in Injector.cs and Sigmund.cs (basically, point to location of ext/ and plugins/)
  3. Run injector to create patched Assembly-CSharp.dll which loads Sigmund.dll
  4. Start game launcher. It will revert all game files to the originals
  5. Rebuild the plugin or Sigmund, this will cause the patched Assembly-CSharp.dll to get copied to game directory
  6. Start game and click through until you reach main Hub menu.

You can open the dev console (Ctrl-Enter) and type "echo my message" to display "my message" to the screen.

1.首先是替换ext目录下的dll文件

Mono.Cecil的版本可以从nuget拿

<packages>
<package id="Mono.Cecil" version="0.9.6.0" targetFramework="net40" />
</packages

2. 修改2个cs文件中硬编码的路径

3.

在编译Injector项目的时候,发现会顺便编译Sigmund项目

Sigmund会把ext文件夹下的文件,覆盖到炉石的安装包下面

rem copy /Y "$(SolutionDir)\ext\$(TargetFileName)" "C:\Program Files (x86)\Hearthstone\Hearthstone_Data\Managed\$(TargetFileName)"
rem copy /Y "$(SolutionDir)\ext\Assembly-CSharp.dll" "C:\Program Files (x86)\Hearthstone\Hearthstone_Data\Managed\Assembly-CSharp.dll"

copy命令的第一个参数是source,第二个参数是target,/Y是直接覆盖的意思

Usage

  1. TestPlugin will load automatically (comment out line in Sigmund.Main.Start to disable)
  2. Modify or create any files in plugins/ directory will cause them to be (re)loaded
  3. Open dev console (Ctrl-Enter) and type "run somePlugin" will (re)load the somePlugin.dll in plugins/

Projects

Injector: patches Assembly-CSharp.dll to load Sigmund.dll (our loader)

Sigmund: loader which watches filesystem and the game's dev console to trigger (re)loading plugins (after doing minor rewriting)

TestPlugin: example plugin to automate playing against practice AI

HearthstoneExtract: placeholder (you'll have to find it elsewhere) for disassembled source from an older version of the game. Kept in the solution for easy searching (eg. find all references) but not always 100% correct. Use Reflector on the current Assembly-CSharp to double check.

HearthstoneBot的更多相关文章

随机推荐

  1. vue下载后台传过来的乱码流的解决办法

    后台返回的乱码流 解决办法: 请求方式用的是axios,主要加关键的 {responseType: 'blob'} axios封装 export function postDownload(url, ...

  2. go语言json转map

    package util import ( "encoding/json" "fmt" ) // json转map函数,通用 func JSONToMap(st ...

  3. Delphi 使用数据库浏览器

    樊伟胜

  4. 详解python中的描述符

    描述符介绍 总所周知,python声明变量的时候,不需要指定类型.虽然现在有了注解,但这只是一个规范,在语法层面是无效的.比如: 这里我们定义了一个hello函数,我们要求name参数传入str类型的 ...

  5. ANSIBLE自动化管理工具

    ansible 基础 自动化运维工具 官网:https://www.ansible.com/ 官方文档:https://docs.ansible.com/ ansible 特性 1. 模块化:调用特定 ...

  6. 3.NIO_Buffer缓冲区

    1.缓冲区(Buffer) 一个用于特定基本数据类型的容器.由 java.nio 包定义的,所有缓冲区都是 Buffer 抽象类的子类,任何时候访问 NIO 中 的数据,都是通过缓冲区进行操作 在 J ...

  7. [AWS - EC2]如何使用 PuTTY 连接到 Amazon Linux 2 实例。How to Connect Amazon Linux 2 Instance from Windows Using PuTTY

    1. 下载 PuTTY 2. 安装到任意目录 3. 打开 PuTTYgen (注意不是 PuTTY), 如图: 选择 RSA , 点击 Load. 找到从 AWS 创建实例的时候生成的 key,要选择 ...

  8. EntityFrameworkCore

    left join var query = from log in logRepository.Table.Include(a => a.User) join user in logReposi ...

  9. less 分页显示文件内容

    1.命令功能 less 是more的增强版,可以分页显示文件内容,而且less打开文件的速度要比vi,more更快.less支持搜索功能,显示行号. 2.语法格式 less  option  file ...

  10. python小练手题1

    1. """ Write a program which can compute the factorial of a given numbers. The result ...