Stoker

版本 v0.0.2·更新於 2025-04-18

Cheat Manager and Console

截圖 共 1 張

模組介紹 作者原文

Stoker

A powerful cheat manager and console for Monster Train 2.

Features

  • In-game console with command completion
  • Command history navigation
  • Real-time command suggestions
  • Support for subcommands and options
  • Customizable command system
  • Log viewer with different message types (Info, Warning, Error)
  • Fluent API for easy command creation

Installation

  • Install BepInEx for your game
  • Install Trainworks
  • Place the Stoker plugin in the BepInEx/plugins directory
  • Start the game

How to Use

Opening the Console

  • Press the backtick key (`) to toggle the console

Basic Usage

  • Type commands and press Enter to execute them
  • Use Up/Down arrows to navigate command history
  • Press Tab to cycle through command completions
  • Press Shift+Tab to cycle backwards through completions

Command Structure

Commands follow this general structure:

command [subcommand] [options] [arguments]

Available Commands

Help Command

help

Displays a list of all available commands and their descriptions.

Echo Command

echo

Echoes back the provided message.

Card Commands

card add [options]

card remove [options]

Manage cards in the game.

Gold Command

gold

Add or remove gold. The amount can be positive or negative.

Relic Commands

relic add [options]

Add relics to your collection.

Command Completion

The console features intelligent command completion:

  • Press Tab to cycle through available completions
  • Completions are shown in semi-transparent gray
  • Suggestions update in real-time as you type
  • Supports completing:
  • Command names
  • Subcommands
  • Option names
  • Option values
  • Argument values

Development

Using the Fluent API

The Fluent API provides a clean, readable way to create commands. Here are some examples from the codebase:

Basic Command

var command = new CommandBuilder("echo").WithDescription("Echo a message").WithArgument("message").WithDescription("The message to echo").WithParser((xs) => xs).Parent().SetHandler((args) => {

if (!args.Arguments.ContainsKey("message"))

throw new Exception("Missing argument");

var message = args.Arguments["message"];

if (message is null)

return Task.CompletedTask;

Plugin.Logger.LogInfo(message.ToString());

return Task.CompletedTask;

}).UseHelpMiddleware();

Command with Options

var command = new CommandBuilder("gold").WithDescription("Manage gold").WithArgument("amount").WithDescription("The amount of gold to add").WithParser((xs) => xs).WithDefaultValue("100").WithSuggestions(() => ["100", "+100", "-100"]).Parent().SetHandler((args) => {

var arguments = args.Arguments;

if (!arguments.ContainsKey("amount"))

throw new Exception("Missing argument");

if (arguments["amount"] is not string amount)

throw new Exception("Invalid argument");

Plugin.Logger.LogInfo($"Adding {amount} gold to the player");

AccessTools.Method(typeof(CheatManager), "Command_AdjustGold").Invoke(null, [amount]);

return Task.CompletedTask;

}).UseHelpMiddleware();

Command with Subcommands

var command = new CommandBuilder("card").WithDescription("Manage cards").WithSubCommand("add").WithDescription("Add a card to the deck").WithArgument("name").WithDescription("The name of the card to add").WithSuggestions(() => [.. Railend.GetContainer().GetInstance>().GetAllIdentifiers(RegisterIdentifierType.ReadableID).Select(c => c.ToString())]).WithParser((xs) => xs).Parent().SetHandler((args) => {

var arguments = args.Arguments;

if (!arguments.ContainsKey("name"))

throw new Exception("Missing argument");

if (arguments["name"] is not string cardName)

throw new Exception("Invalid argument");

Plugin.Logger.LogInfo($"Adding card: {cardName}");

CheatManager.Command_AddCard(cardName);

return Task.CompletedTask;

}).UseHelpMiddleware().Parent();

Adding New Commands (In-Depth)

To add a new command, you can either use the Fluent API (recommended) or implement the ICommand interface directly for more control:

public class MyCommand: ICommand

{

public string Name

安裝與使用 安裝:按包內說明操作

  1. 解壓本站下載的壓縮包,先讀包內的 readme / 說明檔案。
  2. 多數模組依賴遊戲的模組載入器:常見做法是用社群模組管理器(如 r2modman)選中本遊戲安裝,由管理器自動處理載入器與依賴。
  3. 手動安裝時,把模組檔案放進遊戲目錄下對應的 Mod / plugins 資料夾。
  4. 啟動遊戲確認載入成功;帶「前置依賴」的模組需要把依賴一併安裝。

不同模組的安裝位置差異較大,包內說明是最可靠的依據。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

BepInEx-BepInExPackMT2-Trainworks_Reloaded

檔案與校驗

檔案名稱
Stoker-0.0.2.zip
檔案大小
171.8 KiB