"subregions" defining, and why it's a bad idea for public/shared wa scripts - Botting.rs - Open Source Runescape Bots "subregions" defining, and why it's a bad idea for public/shared wa scripts - Botting.rs - Open Source Runescape Bots "subregions" defining, and why it's a bad idea for public/shared wa scripts - Botting.rs - Open Source Runescape Bots

"subregions" defining, and why it's a bad idea for public/shared wa scripts

OSRS-User-39229

OSRS-User-39229

Member
Developer
Joined
Oct 26, 2019
Messages
35
Credits
1,456
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:

lesson.jpg
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.
 
D

DuckInDisguise

New member
Joined
Oct 11, 2019
Messages
11
Credits
970
Great post here, just wanted to add that another benefit of defining subregions for personal scripts is that WinAutomation will find images much faster if it only has to search a small subregion instead of the entire screen.
 
jesus

jesus

New member
Joined
Nov 14, 2019
Messages
8
Credits
40
por favor necesito un bot de gremio minero que extraiga mineral de hierro y lo guarde en el banco, por favor amigos
 
Asentrix

Asentrix

Administrator
Staff member
Developer
Joined
Oct 2, 2019
Messages
211
Credits
5,885
por favor necesito un bot de gremio minero que extraiga mineral de hierro y lo guarde en el banco, por favor amigos
It has already been made and we sent you the link :p
 
faladord

faladord

New member
Joined
Oct 21, 2019
Messages
6
Credits
36
It's really not a problem as long as you just edit the subregions.

To make this easier just comment where ever you put a subregion search and tell the user to edit it.
 
Top Bottom