-
-
Notifications
You must be signed in to change notification settings - Fork 11
ZoneManager & SubZoneMapper
The ZoneManager is a domain-level utility, meaning it combines multiple other utilities to produce a higher level, feature specific abstraction.
Its purpose is to dynamically map out key UI zones, enabling more accurate and efficient detection of colour-based objects and image-based sprites on the game screen.
-
Initial Zone Detection (Template Matching)
TheZoneManageruses template matching to locate core UI regions:- Control panel (inventory, tabs, etc.)
- Mini-map area (orbs, compass, map)
- Chatbox
- Game view (calculated as the remaining screen space after subtracting the above)
-
Zone Expansion (SubZoneMapper)
Once the main regions are identified,ZoneManageruses the helper classSubZoneMapperto map additional sub-zones within each. These are derived using hardcoded offsets relative to the parent region. -
Final Output
The result is aMap<String, Rectangle>:- The
Stringkey is a semantic name, e.g.,"hpText". - The
Rectanglerepresents an exact screen region, e.g.,new Rectangle(zone.x + 4, zone.y + 55, 20, 13).
- The
controller().zones().getGameView();Returns a cropped BufferedImage of the game view region. This is not always a clean rectangle and therefore the work is done on behalf of the user.
controller().zones().getInventorySlots().get(27);Returns a List<Rectangle> representing each inventory slot, indexed 0–27 from left to right, then top to bottom.
Access all mapped zones via ZoneManager's public getters using their associated string keys.
Zone keys such as "hpText" are defined in
SubZoneMapper.
Because ZoneManager is stateful (e.g., depends on fixed vs resizable client), you must access it through the controller.
Rectangle hp = controller().zones().getCtrlPanel().get("hpText");
Rectangle runOrb = controller().zones().getMinimap().get("runOrb");
Rectangle chatbox = controller().zones().getChatTabs().get("chat");
Rectangle invSlot5 = controller().zones().getInventorySlots().get(5);
BufferedImage gameView = controller().zones().getGameView();Taking a screenshot of a zone
BufferedImage screenshot = ScreenManager.captureZone(invSlot5)-
Pre-requisite Installations
A ground-up tutorial on what to install and how! -
RuneLite Requirements
General requirements for configuring RuneLite to work with this project.
-
Making Your First Script
A beginner-friendly walkthrough of creating and running your first automation script. -
Intermediate Scripting: From Planning to Execution
Look into the theory and execution of a more difficult script, if you're looking to step it up.
-
Colour Picker
How to take a screenshot, define HSV ranges, and create reusable colour profiles. -
ZoneManager & SubZoneMapper
Explanation of how screen regions are mapped and the quirks of Zones. -
Discord Notifications
With less than 5 minutes of setup, send yourself notifications from within your scripts.
-
Contributing Guidelines
Code style, structure, licensing, and how to get involved in improving ChromaScape.