Microbot

repository·main·Indexed 41 days ago

https://github.com/chsami/microbot

A specialized RuneLite fork that provides an integrated environment for developing and running automation scripts via an always-on plugin. It includes a Queryable API for interacting with game entities, runtime agent tools such as a CLI wrapper and HTTP server, and a set of Entity Guides to prevent common implementation bugs.

Tokens
101.8K
Snippets
253
Records
506
Agent score
50%

What's inside Microbot

  1. Overview of Microbot

    main
    Microbot is a RuneLite fork featuring an always-on Microbot plugin designed for learning, building, and running automation scripts. It provides a runtime environment for executing scripts and a set of tools for interacting with the game client.
  2. Manage prayer abilities with Rs2Prayer

    main

    The Rs2Prayer class provides methods to interact with and manage prayer abilities in-game. You can use it to activate or deactivate specific prayers, check the current status of a prayer, verify if quick prayers are enabled, or check if the player has run out of prayer points. All prayer-specific operations require an Rs2PrayerEnum value to identify the target prayer.

    // Example of activating and deactivating a prayer
    Rs2Prayer.toggle(Rs2PrayerEnum.PIETY, true); // Activates Piety
    Rs2Prayer.toggle(Rs2PrayerEnum.PIETY, false); // Deactivates Piety
  3. Get started with Microbot

    main
    The Microbot documentation index provides access to core guides for architecture, development setup, installation, and advanced usage like the Agent Server and Agentic Testing Loop. Use these guides to understand how to build, deploy, and interact with the Microbot system.
  4. Use the Rs2Dialogue class to handle in-game dialogues

    main
    The Rs2Dialogue class provides static methods to detect and interact with in-game dialogue windows. Use these methods to automate responses to prompts like "Click here to continue" or to detect when a player is required to make a choice.
  5. Use the runelite-api library

    main

    The runelite-api module provides the public API artifacts used by runelite-client and various plugins. It contains essential interfaces, events, and data models. This is a library-only module and does not have a runtime main method.

    To use it in your own project, include the following dependency coordinates: net.runelite:runelite-api

    // Example dependency coordinate
    dependency {
        implementation 'net.runelite:runelite-api'
    }
  6. Manage player inventory with Rs2Inventory

    main

    The Rs2Inventory class is used to manage and interact with the player's inventory. It provides methods to check inventory status (e.g., if it is full or empty), retrieve specific items, and perform actions like dropping, combining, or interacting with items.

    Rs2Inventory.interact(12345, "Use");
    boolean hasItem = Rs2Inventory.contains("Magic potion");
    int emptySlots = Rs2Inventory.emptySlotCount();
  7. Use the runelite-gradle-plugin in your build

    main

    The runelite-gradle-plugin provides custom Gradle plugins used for assembling resources, indexing, and JAR signing during the client build process. These plugins are primarily consumed by runelite-client/build.gradle.kts.

    To use these capabilities, apply the following plugin IDs in your Gradle configuration:

    • net.runelite.runelite-gradle-plugin.assemble: For assembling resources.
    • net.runelite.runelite-gradle-plugin.index: For indexing.
    • net.runelite.runelite-gradle-plugin.jarsign: For JAR signing.
    // Example application in a build.gradle.kts
    plugins {
        id("net.runelite.runelite-gradle-plugin.assemble")
        id("net.runelite.runelite-gradle-plugin.index")
        id("net.runelite.runelite-gradle-plugin.jarsign")
    }
  8. Understand the Webwalker Improvement Plan tiers

    main

    The Webwalker improvement plan is organized into five tiers of priority to enhance the shortest-path functionality:

    • Tier 1 — Correctness bugs: High-priority fixes for functional errors (fix first).
    • Tier 2 — Pathfinder performance: Optimizations for pathfinding speed.
    • Tier 3 — Rs2Walker robustness: Improvements to walker stability, stall detection, and handling of specific game mechanics (doors, energy, etc.).
    • Tier 4 — Transport data completeness: Filling gaps in transport data (agility shortcuts, skill capes, diary toggles, etc.).
    • Tier 5 — Concurrency, observability, testing: Improving thread safety, logging, metrics, and unit test coverage.
  9. Simulate keyboard actions with Rs2Keyboard

    main

    The Rs2Keyboard class is used to simulate keyboard input by dispatching events directly to the game's canvas. It supports typing full strings, pressing individual characters, and managing key states (holding and releasing) using key codes from KeyEvent.

    Rs2Keyboard.typeString("Hello, world!");
    Rs2Keyboard.keyPress('a');
    Rs2Keyboard.holdShift();
    Rs2Keyboard.releaseShift();
    Rs2Keyboard.enter();
    boolean isShiftPressed = Rs2Keyboard.isKeyPressed(KeyEvent.VK_SHIFT);
  10. Manage combat settings with Rs2Combat

    main
    The Rs2Combat class provides a suite of static methods to programmatically control combat settings in-game. You can use it to manage attack styles, toggle auto-retaliate, handle special attack states, and check if the character is currently in combat.
  11. Interact with the Grand Exchange using Rs2GrandExchange

    main
    The Rs2GrandExchange class provides a comprehensive suite of static methods to automate Grand Exchange (GE) activities. You can use it to open the GE, buy or sell items, manage active offers, and collect completed offers into your bank or inventory.