
OSRS-User-39229
Member
Developer
Hello fellow botters, I have tinkered around with WinAutomation's subregions function enough to know that it's not able to be used in public shared scripts. Here is why:
-People have different resolution monitors.
That's really the only reason. Here is an image below to reference. Let's say you define the entire 3d world/chatbox/minimap/inventory areas as a single rectangle for a subregion of a "foreground window". You would click one corner of the game screen, and maneuver over to the opposite corner, and click, thus making a valid subregion to search inside. Great, right? Well, if you look at those coordinates you just generated, they will actually represent the absolute values of (x1, y1) of one corner and (x2, y2) of the other, measured in # of pixels away from the TOP-LEFT of the Focused Window (You should have focused OPRS or RuneLite Window previously in WA)(also means that a positive Y is really a negative direction, down). Here is what happens to the X1, X2 values on different resolutions:

Hopefully this gives a clearer image about using Subregions in WA.
PLEASE NOTE - for personal scripts, used on the same computer, with the same settings, it is perfectly fine to define subregions, and will work just as intended with the benefits of not finding an image on a random part of your screen.
-People have different resolution monitors.
That's really the only reason. Here is an image below to reference. Let's say you define the entire 3d world/chatbox/minimap/inventory areas as a single rectangle for a subregion of a "foreground window". You would click one corner of the game screen, and maneuver over to the opposite corner, and click, thus making a valid subregion to search inside. Great, right? Well, if you look at those coordinates you just generated, they will actually represent the absolute values of (x1, y1) of one corner and (x2, y2) of the other, measured in # of pixels away from the TOP-LEFT of the Focused Window (You should have focused OPRS or RuneLite Window previously in WA)(also means that a positive Y is really a negative direction, down). Here is what happens to the X1, X2 values on different resolutions:

Hopefully this gives a clearer image about using Subregions in WA.
PLEASE NOTE - for personal scripts, used on the same computer, with the same settings, it is perfectly fine to define subregions, and will work just as intended with the benefits of not finding an image on a random part of your screen.