SRL Archive - OSR Help

TPAs & Tolerance


DeSnob

2011-11-05 20:45:15

Hey, I'm asking a slightly confusing question so let me explain.

When you search for colors using TPAs/ATPAs, you store them in arrays. Most of the time you use tolerance. That means a wide variety of colors can be found.

How can you find the color that was found at TPA(i)?

KingKong

2011-11-05 21:01:01

getcolor(tpa.x, tpa.y)

Wizzup?

2011-11-05 21:15:17

Or GetColors(tpa);

but… if you don't call them directly after the TPA finding functions you may find that runescape has redrawn the screen and you'll be grabbing wrong pixels. I've run into this countless of times.

Simba has a special feature to counter this. Two functions: Freeze & UnFreeze. See http://docs.villavu.com/simba/scriptref/window.html#freeze

DeSnob

2011-11-05 21:27:10

Thank you, both of you.
From: Wizzup?
Or GetColors(tpa);

but… if you don't call them directly after the TPA finding functions you may find that runescape has redrawn the screen and you'll be grabbing wrong pixels. I've run into this countless of times.

Simba has a special feature to counter this. Two functions: Freeze & UnFreeze. See http://docs.villavu.com/simba/scriptref/window.html#freeze

Freeze seems really useful, but for my situation it's most likely not needed.

Nava2

2011-11-05 21:55:25

From: DeSnob
Thank you, both of you.

Freeze seems really useful, but for my situation it's most likely not needed.


Freeze is also VERY MUCH a speed boost for multiple searches over the same frame.

DeSnob

2011-11-05 23:12:10

From: Nava2
Freeze is also VERY MUCH a speed boost for multiple searches over the same frame.


Yes, for things that don't move often, but Freeze wouldn't work too well with constantly moving chickens.

Wizzup?

2011-11-06 09:00:41

From: DeSnob
Yes, for things that don't move often, but Freeze wouldn't work too well with constantly moving chickens.


I don't really want to hammer on using Freeze, but I just want to say that Freeze is really fast. Essentially, it takes less time than a single FindColor() over the entire client. So it really shouldn't add any overhead if you do:


Freeze;
FindColorsTolerance(...);
tpatricks();
GetColors(tpa);
UnFreeze;