Skip to content

Comments

fix(gradle): update microbot version to 2.1.11#1653

Merged
chsami merged 3 commits intomainfrom
development
Jan 17, 2026
Merged

fix(gradle): update microbot version to 2.1.11#1653
chsami merged 3 commits intomainfrom
development

Conversation

@chsami
Copy link
Owner

@chsami chsami commented Jan 17, 2026

allow stop plugin for breakhandler

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 17, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This pull request updates the Microbot version to 2.1.11 and extends Break Handler functionality with two new configuration options: plugin stopping during breaks and world-switching control. The BreakHandlerV2Config interface adds methods for selecting which plugin to stop and whether to ignore world switching. The BreakHandlerV2Overlay displays these settings in the UI. The BreakHandlerV2Script implements lifecycle hooks that manage stopping and restarting configured plugins at break boundaries and adjusts world selection logic based on the ignore-world-switching setting.

Possibly related PRs

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 45.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive PR title mentions version update to 2.1.11, but the primary changes are new break handler features (plugin stop/restart, world switching). Consider if title should reflect the main feature additions (e.g., 'feat: add plugin stop/restart lifecycle for break handler') rather than focusing solely on version bump.
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed Description 'allow stop plugin for breakhandler' directly relates to the main feature changes across the PR.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In
`@runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Config.java`:
- Around line 99-107: BreakHandlerV2Config references an unresolved type
MicrobotPluginChoice in the pluginToStop() config method causing build failure;
fix by either creating the missing enum/class named MicrobotPluginChoice with
the expected members (e.g., NONE and any plugin choices) or correcting the
import/reference to the existing type, then update pluginToStop() signature if
necessary so BreakHandlerV2Config::pluginToStop and any overlay/script usage
compile against the defined type.

In
`@runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Script.java`:
- Around line 568-574: selectWorld() currently returns -1 when
ignoreWorldSwitching() is true but no world is selected, which causes
handleLoginRequested() to treat this as an error and abort login; update
selectWorld() so it does not return -1 in this case—either return 0 (or another
sentinel that handleLoginRequested() treats as "no-op but allow login") or
adjust the logic so setWorld() is not skipped while still reusing the current
selection; change the return in selectWorld() (and the log message) to return 0
when currentWorld <= 0, and ensure handleLoginRequested() accepts that value and
continues the login flow.

Comment on lines +99 to +107
@ConfigItem(
keyName = "pluginToStop",
name = "Stop Plugin On Break",
description = "Select a Microbot plugin to stop automatically when a break begins.",
position = 2,
section = breakBehaviorOptions
)
default MicrobotPluginChoice pluginToStop() {
return MicrobotPluginChoice.NONE;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

MicrobotPluginChoice is undefined (build failure).

CI shows MicrobotPluginChoice cannot be resolved; this config (and dependent overlay/script usage) won’t compile until the enum/type exists or the import is corrected.

🧰 Tools
🪛 GitHub Actions: CI

[error] 106-106: cannot find symbol: MicrobotPluginChoice used in return type

🤖 Prompt for AI Agents
In
`@runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Config.java`
around lines 99 - 107, BreakHandlerV2Config references an unresolved type
MicrobotPluginChoice in the pluginToStop() config method causing build failure;
fix by either creating the missing enum/class named MicrobotPluginChoice with
the expected members (e.g., NONE and any plugin choices) or correcting the
import/reference to the existing type, then update pluginToStop() signature if
necessary so BreakHandlerV2Config::pluginToStop and any overlay/script usage
compile against the defined type.

Comment on lines 568 to +574
private int selectWorld() {
// When world switching is disabled, reuse whatever world is already selected
if (config.ignoreWorldSwitching()) {
int currentWorld = Microbot.getClient() != null ? Microbot.getClient().getWorld() : -1;
log.info("[BreakHandlerV2] World switching ignored; reusing current selected world {}", currentWorld);
return currentWorld > 0 ? currentWorld : -1; // -1 skips setWorld(), leaving client selection unchanged
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

ignoreWorldSwitching can short‑circuit login when no world is selected.

selectWorld() returns -1 when the current world isn’t set, but handleLoginRequested() treats -1 as an error and exits early. That means “stay on current world” can block login on fresh clients or after world selection resets.

🛠 Proposed fix
-		if (config.ignoreWorldSwitching()) {
-			int currentWorld = Microbot.getClient() != null ? Microbot.getClient().getWorld() : -1;
-			log.info("[BreakHandlerV2] World switching ignored; reusing current selected world {}", currentWorld);
-			return currentWorld > 0 ? currentWorld : -1; // -1 skips setWorld(), leaving client selection unchanged
-		}
+		if (config.ignoreWorldSwitching()) {
+			int currentWorld = Microbot.getClient() != null ? Microbot.getClient().getWorld() : -1;
+			if (currentWorld > 0) {
+				log.info("[BreakHandlerV2] World switching ignored; reusing current selected world {}", currentWorld);
+				return currentWorld;
+			}
+			log.warn("[BreakHandlerV2] World switching ignored but no current world selected; falling back");
+		}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
private int selectWorld() {
// When world switching is disabled, reuse whatever world is already selected
if (config.ignoreWorldSwitching()) {
int currentWorld = Microbot.getClient() != null ? Microbot.getClient().getWorld() : -1;
log.info("[BreakHandlerV2] World switching ignored; reusing current selected world {}", currentWorld);
return currentWorld > 0 ? currentWorld : -1; // -1 skips setWorld(), leaving client selection unchanged
}
private int selectWorld() {
// When world switching is disabled, reuse whatever world is already selected
if (config.ignoreWorldSwitching()) {
int currentWorld = Microbot.getClient() != null ? Microbot.getClient().getWorld() : -1;
if (currentWorld > 0) {
log.info("[BreakHandlerV2] World switching ignored; reusing current selected world {}", currentWorld);
return currentWorld;
}
log.warn("[BreakHandlerV2] World switching ignored but no current world selected; falling back");
}
🤖 Prompt for AI Agents
In
`@runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Script.java`
around lines 568 - 574, selectWorld() currently returns -1 when
ignoreWorldSwitching() is true but no world is selected, which causes
handleLoginRequested() to treat this as an error and abort login; update
selectWorld() so it does not return -1 in this case—either return 0 (or another
sentinel that handleLoginRequested() treats as "no-op but allow login") or
adjust the logic so setWorld() is not skipped while still reusing the current
selection; change the return in selectWorld() (and the log message) to return 0
when currentWorld <= 0, and ensure handleLoginRequested() accepts that value and
continues the login flow.

@chsami chsami merged commit e1d8d5d into main Jan 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant