错误1 赋值问题

貌似编译器版本有点低,无法识别C#的高级语法糖

属性的初始值,必须是public bool IsEnabled { get{return true;} }

不能写成public bool IsEnabled { get; }=true;

Control

Compiler Error: \Plugins\AutoConcede\AutoConcede.cs(75,38) :

error CS0840: 'AutoConcede.AutoConcede.Control.get' must declare a body because it is not marked abstract or extern. Automatically implemented properties must define both get and set accessors.
Compiler Error: c:\Users\clu\Desktop\Hearthbuddy 0.3.1446.417\Plugins\AutoConcede\AutoConcede.cs(76,40) : error CS0840: 'AutoConcede.AutoConcede.Settings.get' must declare a body because it is not marked abstract or extern. Automatically implemented properties must define both get and set accessors.

2019-07-16 14:22:58,834 [14] DEBUG Logger (null) - [AutoConcede] Initialize

自动投降不工作,提示是

2019-07-16 15:10:03,568 [5] INFO Logger (null) - [Concede] GameState == null.
2019

public static bool Concede(bool logReason)
{
bool result;
try
{
if (GameState.Get() == null)
{
if (logReason)
{
TritonHs.ilog_0.InfoFormat("[Concede] GameState == null.", Array.Empty<object>());
}
result = false;
}
else if (!GameUtils.CanConcedeCurrentMission())
{
TritonHs.ilog_0.InfoFormat("[Concede] !GameUtils.CanConcedeCurrentMission().", Array.Empty<object>());
result = false;
}
else
{
GameState.Get().Concede();
using (TritonHs.Memory.ReleaseFrame(true))
{
Thread.Sleep();
}
result = true;
}
}
catch (Exception ex)
{
if (logReason)
{
TritonHs.ilog_0.InfoFormat("[Concede] An exception occurred. {0}", ex.ToString());
}
result = false;
}
return result;
}

关于在选牌阶段,以及回合开始投降

https://tieba.baidu.com/p/5929349383?red_tag=2707770290

Hearthbuddy\Routines\DefaultRoutine\DefaultRoutine.cs

public async Task MulliganLogic(MulliganData mulliganData)

public async Task OurTurnLogic()

DefaultRoutine继承了Triton.Bot.IRoutine接口

public interface IRoutine : IRunnable, IAuthored, IBase, IConfigurable
{
// Token: 0x06001185 RID: 4485
void SetConfiguration(string name, params object[] param); // Token: 0x06001186 RID: 4486
object GetConfiguration(string name); // Token: 0x06001187 RID: 4487
Task<bool> Logic(string type, object context);
}

主要逻辑的入口,都是在Logic函数里面

/// <summary>
/// The routine's coroutine logic to execute.
/// </summary>
/// <param name="type">The requested type of logic to execute.</param>
/// <param name="context">Data sent to the routine from the bot for the current logic.</param>
/// <returns>true if logic was executed to handle this type and false otherwise.</returns>
public async Task<bool> Logic(string type, object context)
{ // The bot is requesting mulligan logic.
if (type == "mulligan")
{
await MulliganLogic(context as MulliganData);
return true;
} // The bot is requesting emote logic.
if (type == "emote")
{
await EmoteLogic(context as EmoteData);
return true;
} // The bot is requesting our turn logic.
if (type == "our_turn")
{
await OurTurnLogic();
return true;
} // The bot is requesting opponent turn logic.
if (type == "opponent_turn")
{
await OpponentTurnLogic();
return true;
} // The bot is requesting our turn logic.
if (type == "our_turn_combat")
{
await OurTurnCombatLogic();
return true;
} // The bot is requesting opponent turn logic.
if (type == "opponent_turn_combat")
{
await OpponentTurnCombatLogic();
return true;
} // The bot is requesting arena draft logic.
if (type == "arena_draft")
{
await ArenaDraftLogic(context as ArenaDraftData);
return true;
} // The bot is requesting quest handling logic.
if (type == "handle_quests")
{
await HandleQuestsLogic(context as QuestData);
return true;
} // Whatever the current logic type is, this routine doesn't implement it.
return false;
}

无法识别Object,必须改成小写的object

如何确定插件是否加载成功

查看plugins的tab那边是否显示了相应的插件,如果没有显示,就说明插件编译失败。可以去日志文件看细节

需要依据GameEventManager 中的事件,来决定如何写代码

public class GameEventManager : IRunnable, IResetable

2019-07-17 11:51:33,227 [19] DEBUG Logger (null) - [AutoConcede] ConcedeThread for loop, index = 1
2019-07-17 11:51:33,228 [14] INFO Logger (null) - [GameEventManagerOnMulliganConfirm]
2019-07-17 11:51:49,782 [14] ERROR Logger (null) - [Tick] Exception during execution:
GreyMagic.InjectionDesyncException: Process must have frozen or gotten out of sync: Injection Finished Event was never fired
at GreyMagic.Executor.WaitForInjection(Int32 timeout)
at GreyMagic.Executor.SharedExecuteLogicEnd(Int32 timeout)
at GreyMagic.Executor.Execute(Int32 timeout)
at GreyMagic.Executor.GrabFrame()
at GreyMagic.ExternalProcessMemory.AcquireFrame(Boolean isHardLock)
at Triton.Bot.BotManager.smethod_1(IBot ibot_1)
2019-07-17 11:51:49,785 [14] DEBUG Logger (null) - [BotThreadFunction] An InjectionDesyncException was detected.

HearthBuddy Plugin编写遇到的问题的更多相关文章

  1. Bootstrap plugin编写

    滚动demo: <!doctype html> <html lang="en"> <head> <meta charset="U ...

  2. lua 5.3最简单plugin编写

    #include <windows.h> #include "lauxlib.h" /* Pop-up a Windows message box with your ...

  3. AS 自定义 Gradle plugin 插件 案例 MD

    Markdown版本笔记 我的GitHub首页 我的博客 我的微信 我的邮箱 MyAndroidBlogs baiqiantao baiqiantao bqt20094 baiqiantao@sina ...

  4. 使用 CodeIgniter 框架快速开发 PHP 应用(三)

    原文:使用 CodeIgniter 框架快速开发 PHP 应用(三) 分析网站结构既然我们已经安装 CI ,我们开始了解它如何工作.读者已经知道 CI 实现了MVC式样. 通过对目录和文件的内容进行分 ...

  5. 使用dropwizard(4)-加入测试-jacoco代码覆盖率

    前言 dropwizard提供了一个简单的测试框架.这里简单集成并加入jacoco测试. Demo source https://github.com/Ryan-Miao/l4dropwizard 本 ...

  6. 30分钟带你了解Docker

    最近一直在忙项目,不知不觉2个多月没有更新博客了.正好自学了几天docker就干脆总结一下,也顺带增加一篇<30分钟入门系列>.网上能够查到的对于docker的定义我就不再重复了,说说我自 ...

  7. MQTT---HiveMQ源代码具体解释(四)插件载入

    源博客地址:http://blog.csdn.net/pipinet123 MQTT交流群:221405150 实现功能 将全部放在plugins文件夹下的全部符合plugin编写规范的plugin ...

  8. 掘金 Android 文章精选合集

    掘金 Android 文章精选合集 掘金官方 关注 2017.07.10 16:42* 字数 175276 阅读 50053评论 13喜欢 669 用两张图告诉你,为什么你的 App 会卡顿? - A ...

  9. 什么是SpringBoot

    随着动态语言的流行(Ruby,Groovy,Scala,Node.js),Java的开发显得格外的笨重;繁多的配置,低下的开发效率,复杂的部署流程以及第三方技术集成难度大. 在上述环境 下,Sprin ...

随机推荐

  1. 将xml作为输入参数传递给存储过程

    1 查看存储过程的方式 exec sp_helptext 'GetTrackingFeedLogByMaxId' select definition from sys.sql_modules wher ...

  2. Python 之 random模块

    Python中的random模块用于生成随机数.1.random.random()  #用于生成一个0到1的随机浮点数:0<= n < 1.0>>> random.ran ...

  3. firefox(火狐中的兼容问题总结)

    1.firefox 下 默认情况 <input   type="number"> 只允许整数其他的都会报错,红色提示: 这时候可以添加参数 step="0.0 ...

  4. php底层的运行机制和原理

    php设计的理念及特点 PHP 被设计为一种适用于web开发的动态脚本语言,同时具有解释型和弱类型,底层完全由C语言实现. 解释型即程序边运行边解释,一行一行运行. 弱类型即变量类型一开始并不是确定的 ...

  5. Oracle笔记(七) 数据更新、事务处理、数据伪列

    一.数据的更新操作 DML操作语法之中,除了查询之外还有数据的库的更新操作,数据的更新操作主要指的是:增加.修改.删除数据,但是考虑到emp表以后还要继续使用,所以下面先将emp表复制一份,输入如下指 ...

  6. Linux sed命令 -- 三剑客老二

    格式: sed [OPTION]... {script-only-if-no-other-script} [input-file]... sed [OPTION]... ‘地址定界+[高级]编辑命令’ ...

  7. 蓝牙App漏洞系列分析之一CVE-2017-0601

    蓝牙App漏洞系列分析之一CVE-2017-0601 0x01 概要 2017年5月的 Android 安全公告修复了我们提交的一个蓝牙提权中危漏洞,这个漏洞尽管简单,但比较有意思,能够使本地恶意 A ...

  8. FASTCGI/CGI

    在了解这两个协议之前,我们先谈一下动态网页 动态网页 是指跟静态网页相对的一种网页编程技术.静态网页,随着html代码的生成,页面的内容和显示效果就基本上不会发生变化了--除非你修改页面代码.而动态网 ...

  9. java线程基础巩固---多线程与JVM内存结构的关系及Thread构造函数StackSize的理解

    继续学习一下Thread的构造函数,在上次[http://www.cnblogs.com/webor2006/p/7760422.html]已经对如下构造都已经学习过了: 多线程与JVM内存结构的关系 ...

  10. python+request+HTMLTestRunner+unittest接口自动化测试框架

    转自https://my.oschina.net/u/3041656/blog/820023 正在调研使用python进行自动化测试,在网上发现一篇比较好的博文,作者使用的是python3,但目前自己 ...