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. 第二十五篇 jQuery 学习7 获取并设置 CSS 类

    jQuery 学习7 获取并设置 CSS 类   jQuery动态控制页面,那么什么是动态呢?我们就说一下静态,静态几乎又纯html+css完成,就是刷新页面之后,不会再出现什么变动,一个实打实的静态 ...

  2. Linux服务器性能检查教程

    一.uptime命令 这个命令可以快速查看机器的负载情况.在Linux系统中,这些数据表示等待CPU资源的进程和阻塞在不可中断IO进程(进程状态为D)的数量.这些数据可以让我们对系统资源使用有一个宏观 ...

  3. 用NetHttpClient执行Post操作遇到的问题

    最近在做接口的调试,用NetHttpClient来进行相关操作.部分数据是用get方法来操作的,没有问题,但有个数据是用Post来操作的,始终报错,用了抓包分析工具发现没有发送数据出去.但找不出代码的 ...

  4. MySql学习笔记【二、库相关操作】

    命令规范 关键字.函数名称大写 数据库.表名.字段名小写 语句须以分号结尾 切换使用数据库 USE database_name 如:USE test 查看数据库列表 SHOW {DATABASES|S ...

  5. Windows问题

    常用工具 DisplayFusion 官网 电脑分屏,V9.4 Pro 破解版 问题解决 Win64位注册表导入方法 64位Windows操作系统注册表不同于32位Windows操作系统,Win64 ...

  6. centos 7 OpenResty®(lua-nginx-module)搭建可扩展的Web平台

    OpenResty®-英文官网地址:http://openresty.org/en/ OpenResty®-中文官网地址: http://openresty.org/cn/ OpenResty®> ...

  7. Linux工具之top

    top命令详解: 第一行:10:01:23----当前系统时间   126days,14:29------系统已经运行了126天14小时29分钟(在这期间没有重启过)   2users------当前 ...

  8. Python:类

    概述:类的特点 作用域和命名空间. 类的详解:(python官方教程摘录) 概述特性 Python在oop方面思想和Ruby一样.同样包括数据封装,继承和多态三大特点. 类 Python的类提供了面向 ...

  9. 常用到用css3实现的转换,过渡和动画

    为什么要用css动画替换js动画 导致JavaScript效率低的两大原因:操作DOM和使用页面动画. 通常我们会通过频繁的操作 DOM的CSS来实现视觉上的动画效果,导致js效率低的两个因素都包括在 ...

  10. easypoi 版本依赖关系

    <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactI ...