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. export CommonJS AMD ES6

    export https://www.cnblogs.com/fayin/p/6831071.html 导入文件: a  -  b  -  c  ,对象隔代消失,可转成函数返回  导入模块对象(命名) ...

  2. postgres 表和库等信息大小统计

    一 .数据库大小的统计 1.单个库查询 select pg_database_size('zybdb'); 2.查询所有的库 方法一: select pg_database.datname, pg_s ...

  3. 第十一章、特性property

    目录 第十一章.特性property 一.property是一种特殊的属性,访问它时会执行一段功能(函数)然后返回值 二.为什么要用property 三.封装与拓展性 第十一章.特性property ...

  4. 第十一章· MHA高可用及读写分离

    一.MHA简介 1.1.作者简介 松信嘉範: MySQL/Linux专家 2001年索尼公司入职 2001年开始使用oracle 2004年开始使用MySQL 2006年9月-2010年8月MySQL ...

  5. linux tty终端个 pts伪终端 telnetd伪终端

    转:http://blog.sina.com.cn/s/blog_735da7ae0102v2p7.html 终端tty.虚拟控制台.FrameBuffer的切换过程详解 Framebuffer Dr ...

  6. python如何编译py文件生成pyc、pyo、pyd以及如何和C语言结合使用

    python执行py文件的流程 当我们执行一个py文件的时候,直接python xx.py即可,那么这个流程是怎么样的呢.先说明一下,python执行代码实际上是先打开文件然后执行里面的代码,所以文件 ...

  7. Mysql(四)-1:单表查询

    一 单表查询的语法 SELECT 字段1,字段2... FROM 表名 WHERE 条件 GROUP BY field HAVING 筛选 ORDER BY field LIMIT 限制条数 二 关键 ...

  8. Java 通过Math.random() 生成6位随机数

    public static void main(String[] args) { String sjs=""; for (int i = 0; i < 6; i++) { i ...

  9. springboot自动装备date类型报错问题

    错误消息: Field error in object 'user' on field 'birthday': rejected value [2001-02-14]; codes [typeMism ...

  10. monkeyrunner录制和回放功能

    脚本录制 网上先是搜索了一下,说是SDK--tools目录下有monkey_recorder.py和monkey_playback.py的脚本,但是我的没有找到所以可以自己编辑个脚本保存即可~ 先编辑 ...