feat(breakhandlerv2): implement play schedule feature for breaks#1640
feat(breakhandlerv2): implement play schedule feature for breaks#1640
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThis pull request introduces play schedule functionality to the BreakHandlerV2 plugin. Changes include: updating the microbot version to 2.1.4, modifying Gradle wrapper configuration with new timeout and validation settings, adding debug and standard test tasks to the Gradle build, extending BreakHandlerV2Config with play schedule configuration options, updating BreakHandlerV2Overlay to display schedule status, integrating play-schedule-aware logic into BreakHandlerV2Script to control break timing and logout behavior based on active schedules, adding utility methods to the PlaySchedule enum, and introducing comprehensive unit tests for play schedule functionality. Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/antiban/enums/PlaySchedule.java (1)
73-76: Critical: Overnight schedules (spanning midnight) are brokenThe
isOutsideSchedule()andtimeUntilScheduleEnds()methods don't correctly handle schedules that span midnight. For example,SHORT_NIGHT(23:00, 7:00):
- At 1:00 AM:
currentTime.isBefore(startTime)evaluates to1:00.isBefore(23:00) = true- This incorrectly marks 1:00 AM as outside the schedule, when it should be inside (between 23:00 and 7:00)
Impact: Four NIGHT schedule types span midnight and are broken (SHORT_NIGHT, MEDIUM_NIGHT, LONG_NIGHT, FIRST_NIGHT). SECOND_NIGHT and THIRD_NIGHT do not span midnight and work correctly. This causes the break handler to trigger breaks during scheduled play time and allow play during scheduled break time.
Fix needed: Both methods need logic to detect when
startTime > endTime(indicating an overnight schedule) and adjust the boundary checks accordingly.
📜 Review details
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
gradle.propertiesgradle/wrapper/gradle-wrapper.propertiesrunelite-client/build.gradle.ktsrunelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Config.javarunelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Overlay.javarunelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Script.javarunelite-client/src/main/java/net/runelite/client/plugins/microbot/util/antiban/enums/PlaySchedule.javarunelite-client/src/test/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2PlayScheduleTest.javarunelite-client/src/test/java/net/runelite/client/plugins/microbot/util/antiban/enums/PlayScheduleTest.java
🧰 Additional context used
📓 Path-based instructions (5)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*.java
📄 CodeRabbit inference engine (runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*.java: Always use @slf4j annotation and log.error/warn/info/debug for logging instead of System.out.println
Use camelCase for variable and method names
Use UPPER_SNAKE_CASE for constants
Use UpperCamelCase for class names
Use tabs for indentation, not spaces
Keep maximum line length to 120 characters
Place annotations on separate lines before class/method/field declarations
Use Lombok annotations extensively (@slf4j, @Getter, @Setter, @requiredargsconstructor, etc.) to reduce boilerplate
Use try-catch with specific exception types when possible instead of catching generic Exception
runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*.java: Use tabs for indentation and keep braces consistent with MicrobotPlugin.java style
Prefer lines under 120 characters
Name types with UpperCamelCase
Name members with lowerCamelCase
runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*.java: Use tabs for indentation and match brace style to MicrobotPlugin.java
Prefer lines under 120 characters in length
Pair a RuneLite Plugin class with a Script class that runs on a background thread
Never call sleep() on the client thread; only use sleep/sleepUntil on script background threads
Files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Overlay.javarunelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Config.javarunelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Script.javarunelite-client/src/main/java/net/runelite/client/plugins/microbot/util/antiban/enums/PlaySchedule.java
runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*Overlay.java
📄 CodeRabbit inference engine (runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md)
Use LoginScreenOverlay abstract class for creating overlays on login screen; never use standard Overlay system for login screens
Files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Overlay.java
**/*.java
📄 CodeRabbit inference engine (AGENTS.md)
**/*.java: Use Java 11 as the target version
Use UpperCamelCase for type names (classes, interfaces, enums)
Use lowerCamelCase for member variables and method names
Files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Overlay.javarunelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Config.javarunelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Script.javarunelite-client/src/main/java/net/runelite/client/plugins/microbot/util/antiban/enums/PlaySchedule.javarunelite-client/src/test/java/net/runelite/client/plugins/microbot/util/antiban/enums/PlayScheduleTest.javarunelite-client/src/test/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2PlayScheduleTest.java
runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*Config.java
📄 CodeRabbit inference engine (runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*Config.java: Config interface should be named [Name]Config.java and extend Config with @ConfigGroup annotation
Config item keys should be prefixed with plugin name for clarity (e.g., myPluginNpcName)
Provide sensible default values for all @configitem annotated config methods
Use @range annotation with min/max values for numeric config items
Use @ConfigSection annotation to organize related config items into collapsible groupsPrefix configuration classes with the plugin name (e.g., ExampleConfig)
Files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Config.java
runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*Script.java
📄 CodeRabbit inference engine (runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*Script.java: Never block the client thread with sleep() or long operations; always use sleepUntil()/sleep() only from script threads
Always check if on client thread before sleeping: if (!client.isClientThread())
Wrap client calls in runOnClientThread() when accessing from script thread
Always wait for actions to complete using sleepUntil() with timeout before proceeding to next action
Always wrap script logic in try-catch blocks to prevent exceptions from crashing the thread
Check Microbot.isLoggedIn() at the start of each script loop iteration before executing automation logic
Always call super.shutdown() first in the shutdown() method and clean up any resources (cancel scheduled futures, clear caches, unregister event listeners)
Use scheduled executor services (scheduleWithFixedDelay) instead of tight while loops for periodic background tasks
Use random delays between actions (sleep(100, 300)) for anti-ban behavior simulation
Check Microbot.pauseAllScripts.get() in the main loop and return early if true to respect pause state
Check Microbot.getBlockingEventManager().shouldBlockAndProcess() and return early to let blocking events execute
Script class should be named [Name]Script.java and extend Script class
Prefer new queryable API (Rs2NpcQueryable, Rs2TileObjectApi, GroundItemQueryable) over legacy direct utility access methods
Verify interaction success by checking return values from Rs2* utility methods (e.g., if (!Rs2Bank.openBank()))
Check animation state with Rs2Player.isAnimating() before performing actions and wait until animation completes
Null-check all game entity objects (NPCs, GameObjects, Items) before interacting with them
Use state machine pattern (enum-based states with switch statement) for complex multi-step bot behaviors
Cache frequently-accessed values (item counts, NPC lists) in local variables instead of re-querying repeatedly in loops
Use batch operations where availab...
Files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Script.java
🧠 Learnings (36)
📓 Common learnings
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md:0-0
Timestamp: 2025-12-27T15:23:22.156Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*Script.java : Respect BreakHandler plugin by checking Microbot.pauseAllScripts.get() state in main loop
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md:0-0
Timestamp: 2025-12-27T15:23:22.156Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*Script.java : Use scheduled executor services (scheduleWithFixedDelay) instead of tight while loops for periodic background tasks
📚 Learning: 2025-12-27T15:23:22.156Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md:0-0
Timestamp: 2025-12-27T15:23:22.156Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*Script.java : Respect BreakHandler plugin by checking Microbot.pauseAllScripts.get() state in main loop
Applied to files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Overlay.javarunelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Config.javarunelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Script.javarunelite-client/src/test/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2PlayScheduleTest.java
📚 Learning: 2025-12-27T15:23:22.156Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md:0-0
Timestamp: 2025-12-27T15:23:22.156Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*Plugin.java : Use LoginScreenOverlayManager to manage login screen overlay lifecycle (enable/disable) and handle game state events
Applied to files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Overlay.javarunelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Config.java
📚 Learning: 2025-12-27T15:23:22.156Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md:0-0
Timestamp: 2025-12-27T15:23:22.156Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*Script.java : Document complex automation logic with inline comments explaining game mechanics and decision points
Applied to files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Overlay.javarunelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Config.javarunelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Script.javarunelite-client/src/test/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2PlayScheduleTest.java
📚 Learning: 2025-12-27T21:31:28.340Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T21:31:28.340Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*Script.java : Wait for state changes after interactions by checking conditions like Rs2Bank.isOpen(), Rs2Player.isAnimating(), inventory/bank counts
Applied to files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Overlay.javarunelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Script.java
📚 Learning: 2025-12-27T15:23:22.156Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md:0-0
Timestamp: 2025-12-27T15:23:22.156Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*Script.java : Check animation state with Rs2Player.isAnimating() before performing actions and wait until animation completes
Applied to files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Overlay.javarunelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Script.java
📚 Learning: 2025-12-27T15:23:22.156Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md:0-0
Timestamp: 2025-12-27T15:23:22.156Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*Script.java : Use scheduled executor services (scheduleWithFixedDelay) instead of tight while loops for periodic background tasks
Applied to files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Overlay.javarunelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Config.javarunelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Script.javarunelite-client/src/main/java/net/runelite/client/plugins/microbot/util/antiban/enums/PlaySchedule.javarunelite-client/src/test/java/net/runelite/client/plugins/microbot/util/antiban/enums/PlayScheduleTest.javarunelite-client/src/test/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2PlayScheduleTest.java
📚 Learning: 2025-12-27T15:23:22.156Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md:0-0
Timestamp: 2025-12-27T15:23:22.156Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*Overlay.java : Use LoginScreenOverlay abstract class for creating overlays on login screen; never use standard Overlay system for login screens
Applied to files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Overlay.java
📚 Learning: 2025-12-27T15:23:22.156Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md:0-0
Timestamp: 2025-12-27T15:23:22.156Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*Script.java : Check Microbot.pauseAllScripts.get() in the main loop and return early if true to respect pause state
Applied to files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Overlay.javarunelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Config.javarunelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Script.java
📚 Learning: 2025-12-27T15:23:22.156Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md:0-0
Timestamp: 2025-12-27T15:23:22.156Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*Plugin.java : Handle login screen overlays in plugin's startUp() and shutDown() methods by creating and managing LoginScreenOverlayManager instance
Applied to files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Overlay.java
📚 Learning: 2025-12-27T15:23:22.156Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md:0-0
Timestamp: 2025-12-27T15:23:22.156Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*.java : Place annotations on separate lines before class/method/field declarations
Applied to files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Overlay.java
📚 Learning: 2025-08-31T19:19:07.691Z
Learnt from: chsami
Repo: chsami/Microbot PR: 1455
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/MicrobotVersionChecker.java:112-132
Timestamp: 2025-08-31T19:19:07.691Z
Learning: The Microbot project uses only numeric versioning (e.g., "1.2.3") without any alphanumeric suffixes like "-beta" or "-alpha", so simple integer parsing of version segments is safe.
Applied to files:
gradle.properties
📚 Learning: 2025-12-27T15:23:35.063Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/AGENTS.md:0-0
Timestamp: 2025-12-27T15:23:35.063Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/pom.xml : Target Java 11 via maven-compiler-plugin with `<release>11</release>`
Applied to files:
gradle.properties
📚 Learning: 2025-12-27T15:23:35.063Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/AGENTS.md:0-0
Timestamp: 2025-12-27T15:23:35.063Z
Learning: Run `mvn -pl runelite-client test` before committing
Applied to files:
runelite-client/build.gradle.kts
📚 Learning: 2025-12-27T15:23:35.063Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/AGENTS.md:0-0
Timestamp: 2025-12-27T15:23:35.063Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/runelite-client/src/test/java/**/*Test.java : Write JUnit 4 tests named with `*Test` suffix mirrored under `runelite-client/src/test/java`
Applied to files:
runelite-client/build.gradle.ktsrunelite-client/src/test/java/net/runelite/client/plugins/microbot/util/antiban/enums/PlayScheduleTest.javarunelite-client/src/test/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2PlayScheduleTest.java
📚 Learning: 2025-12-27T15:23:22.156Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md:0-0
Timestamp: 2025-12-27T15:23:22.156Z
Learning: Use maven command 'mvn -pl runelite-client test' to run unit tests before commits
Applied to files:
runelite-client/build.gradle.kts
📚 Learning: 2025-12-27T15:23:35.063Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/AGENTS.md:0-0
Timestamp: 2025-12-27T15:23:35.063Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/docs/**/*.md : Document new APIs in `docs/api/` and cross-link from `docs/development.md`
Applied to files:
runelite-client/build.gradle.kts
📚 Learning: 2025-12-27T15:23:22.156Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md:0-0
Timestamp: 2025-12-27T15:23:22.156Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*Test.java : Plugin test classes should mirror the package structure and use JUnit 4 with Mockito for mocking
Applied to files:
runelite-client/build.gradle.ktsrunelite-client/src/test/java/net/runelite/client/plugins/microbot/util/antiban/enums/PlayScheduleTest.javarunelite-client/src/test/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2PlayScheduleTest.java
📚 Learning: 2025-12-27T15:23:22.156Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md:0-0
Timestamp: 2025-12-27T15:23:22.156Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*Config.java : Use ConfigSection annotation to organize related config items into collapsible groups
Applied to files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Config.java
📚 Learning: 2025-12-27T15:23:22.156Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md:0-0
Timestamp: 2025-12-27T15:23:22.156Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*Config.java : Provide sensible default values for all ConfigItem annotated config methods
Applied to files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Config.java
📚 Learning: 2025-12-27T21:31:28.340Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T21:31:28.340Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*Config.java : Prefix configuration classes with the plugin name (e.g., ExampleConfig)
Applied to files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Config.java
📚 Learning: 2025-12-27T15:23:35.063Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/AGENTS.md:0-0
Timestamp: 2025-12-27T15:23:35.063Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/Config.java : Prefix plugin configuration classes with the plugin name (e.g., `ExampleConfig`)
Applied to files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Config.java
📚 Learning: 2025-12-27T15:23:22.156Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md:0-0
Timestamp: 2025-12-27T15:23:22.156Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*Plugin.java : Provide Provides method to expose config to RuneLite's ConfigManager
Applied to files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Config.java
📚 Learning: 2025-12-27T15:23:22.156Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md:0-0
Timestamp: 2025-12-27T15:23:22.156Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*Config.java : Config item keys should be prefixed with plugin name for clarity (e.g., myPluginNpcName)
Applied to files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Config.java
📚 Learning: 2025-12-27T15:23:22.156Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md:0-0
Timestamp: 2025-12-27T15:23:22.156Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*Config.java : Config interface should be named [Name]Config.java and extend Config with ConfigGroup annotation
Applied to files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Config.java
📚 Learning: 2025-12-27T15:23:22.156Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md:0-0
Timestamp: 2025-12-27T15:23:22.156Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*Script.java : Integrate with Rs2Antiban utility for natural mouse movement, cooldowns, and random behaviors
Applied to files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Config.javarunelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Script.javarunelite-client/src/main/java/net/runelite/client/plugins/microbot/util/antiban/enums/PlaySchedule.javarunelite-client/src/test/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2PlayScheduleTest.java
📚 Learning: 2025-12-27T15:23:22.156Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md:0-0
Timestamp: 2025-12-27T15:23:22.156Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*Script.java : Check Microbot.getBlockingEventManager().shouldBlockAndProcess() and return early to let blocking events execute
Applied to files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Config.java
📚 Learning: 2025-12-27T15:23:35.063Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/AGENTS.md:0-0
Timestamp: 2025-12-27T15:23:35.063Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*.java : Name types with UpperCamelCase
Applied to files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Config.java
📚 Learning: 2025-12-27T15:23:22.156Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md:0-0
Timestamp: 2025-12-27T15:23:22.156Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*Script.java : Use random delays between actions (sleep(100, 300)) for anti-ban behavior simulation
Applied to files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Config.javarunelite-client/src/main/java/net/runelite/client/plugins/microbot/util/antiban/enums/PlaySchedule.javarunelite-client/src/test/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2PlayScheduleTest.java
📚 Learning: 2025-12-27T15:23:22.156Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md:0-0
Timestamp: 2025-12-27T15:23:22.156Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*Script.java : For complex pathfinding and questing scenarios, use Rs2Walker with quest helper integration if useQuestHelper config is enabled
Applied to files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Config.java
📚 Learning: 2025-12-27T15:23:22.156Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md:0-0
Timestamp: 2025-12-27T15:23:22.156Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*Script.java : Add custom blocking events to BlockingEventManager via Microbot.getBlockingEventManager().add()
Applied to files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Config.java
📚 Learning: 2025-12-27T21:31:28.340Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T21:31:28.340Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*.java : Pair a RuneLite Plugin class with a Script class that runs on a background thread
Applied to files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Config.javarunelite-client/src/test/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2PlayScheduleTest.java
📚 Learning: 2025-12-27T21:31:28.340Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-27T21:31:28.340Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*Script.java : Always guard script logic with Microbot.isLoggedIn() and super.run() checks; bail early when paused
Applied to files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Script.java
📚 Learning: 2025-12-27T15:23:22.156Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md:0-0
Timestamp: 2025-12-27T15:23:22.156Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*Script.java : Create private helper methods for complex action sequences (e.g., handleBanking(), handleMining()) in script class
Applied to files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Script.java
📚 Learning: 2025-12-27T15:23:22.156Z
Learnt from: CR
Repo: chsami/Microbot PR: 0
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md:0-0
Timestamp: 2025-12-27T15:23:22.156Z
Learning: Applies to runelite-client/src/main/java/net/runelite/client/plugins/microbot/**/*Script.java : Check Microbot.isLoggedIn() at the start of each script loop iteration before executing automation logic
Applied to files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Script.java
📚 Learning: 2025-08-25T07:26:53.623Z
Learnt from: Voxsylvae
Repo: chsami/Microbot PR: 1415
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/pluginscheduler/SchedulerPlugin.java:2341-2366
Timestamp: 2025-08-25T07:26:53.623Z
Learning: In SchedulerPlugin.startLoginMonitoringThread(), do not gate startup on isBreakHandlerEnabled(); rely on isOnBreak() to suppress the monitor only when a break is actually active. This avoids blocking login monitoring whenever BreakHandler is merely enabled.
Applied to files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Script.java
🧬 Code graph analysis (1)
runelite-client/src/test/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2PlayScheduleTest.java (1)
runelite-client/src/test/java/net/runelite/client/plugins/microbot/util/antiban/enums/PlayScheduleTest.java (1)
RunWith(104-205)
🔇 Additional comments (13)
gradle.properties (1)
34-34: LGTM - Version bump to 2.1.4The version increment is appropriate for this feature addition.
gradle/wrapper/gradle-wrapper.properties (1)
4-6: LGTM - Gradle wrapper configuration improvementsThe changes improve security (distribution URL validation) and add a reasonable network timeout. The switch from
-allto-binreduces download size.runelite-client/build.gradle.kts (2)
70-109: LGTM - Test task configurationThe new
runDebugTestsandrunTeststasks are properly configured with consistent timezone settings and appropriate test logging.
303-303: LGTM - Tests now enabled by defaultThis change aligns with the new test tasks and ensures tests run during the build process.
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Overlay.java (1)
69-89: LGTM - Play schedule display logicThe conditional rendering and dynamic label logic are correct. The overlay will properly display schedule information when enabled and adjust the label accordingly.
Note: The display will be affected by the overnight schedule bug in
PlaySchedule.javathat I flagged separately.runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Config.java (1)
243-271: LGTM - Play schedule configurationThe new configuration section follows established patterns and provides sensible defaults. The default
MEDIUM_DAYschedule is a good choice as it doesn't span midnight.runelite-client/src/test/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2PlayScheduleTest.java (1)
177-201: Missing test coverage for overnight schedulesWhile Line 177 verifies that all 18 schedule types exist (including the 6 NIGHT schedules), none of the functional tests actually exercise overnight schedules. This would have caught the critical overnight schedule bug I flagged in
PlaySchedule.java.Consider adding tests similar to
testMediumAfternoonScheduleTimes()but for overnight schedules like:
SHORT_NIGHT(23:00 to 7:00)- Testing times at 23:30 (inside), 1:00 AM (inside), 6:00 AM (inside), 8:00 (outside)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Script.java (5)
158-169: LGTM - Play schedule integration in waiting stateThe logic correctly checks for outside schedule and triggers breaks accordingly. When play schedule is enabled but inside schedule hours, it skips regular break checks.
Note: This depends on the
isOutsideSchedule()method which has the overnight schedule bug I flagged inPlaySchedule.java.
198-204: LGTM - Logout logic respects play scheduleThe logic correctly forces logout when outside play schedule or when configured to logout on break. The logging provides clear context about why logout is occurring.
643-656: LGTM - Schedule-aware break schedulingThe scheduling logic properly differentiates between play schedule mode (using schedule end time) and regular mode (using randomized playtime). The logging is informative.
Note: The
timeUntilScheduleEnds()call will be affected by the overnight schedule bug inPlaySchedule.java.
670-678: LGTM - Break duration respects play scheduleThe logic correctly calculates break duration based on whether we're outside the play schedule (wait until next schedule) or inside (use random duration).
746-748: LGTM - Helper method for schedule checkingClean helper method that consolidates the play schedule check logic.
runelite-client/src/test/java/net/runelite/client/plugins/microbot/util/antiban/enums/PlayScheduleTest.java (1)
1-351: LGTM! Comprehensive test coverage with consistent logic.The test suite thoroughly validates PlaySchedule behavior including:
- Boundary conditions (inclusive start/end times)
- Time calculations with proper day wrapping
- Consistency between
isOutsideSchedule()andtimeUntilNextSchedule()- Duration calculations for
timeUntilScheduleEnds()All test expectations align with the implementation logic, and the parameterized tests provide excellent coverage of edge cases.
Based on learnings, this follows the JUnit 4 conventions for plugin test classes.
No description provided.