SRL Archive - OSR Help

Find color from center?


NoUserName

2012-05-22 18:00:23

Hey all

im looking for a way to search from the center off the screen outwards for a color and having no luck finding it =[

any ideas guys?

looking to find a color that is close to the player if not the looking further away in a square radius

thanks

Main

2012-05-22 18:07:13

findcolorspiraltolerance

:)

NoUserName

2012-05-22 18:15:28

if(FindColorSpiralTolerance(X, Y, color, 270, 9, 450, 250, 10)) then 

at the moment but it still seams to click anywhere it wants

nickrules

2012-05-22 18:31:35

From: NoUserName
if(FindColorSpiralTolerance(X, Y, color, 270, 9, 450, 250, 10)) then 

at the moment but it still seams to click anywhere it wants


You mean, not from the point closest to the center?

Also, try findColorsSpiralTolerance. That lets you specify where to start searching from, though you'd need to store the results in a TPA, then click at TPA[0].x,TPA[0].y

eg:

findcolorsspiraltolerance(MSc1,MSc2,TPA,color,MSx1,MSy1,MSx2,MSy2,10);
if length(TPA) > 0 then
mouse(TPA[0].x,TPA[0].y,5,5,mouse_left);

YoHoJo

2012-05-22 18:33:13

I believe doing

X:=MSCX;
Y:=MSCY;
if(FindColorSpiralTolerance(X, Y, color, 270, 9, 450, 250, 10)) then
Mouse(X, Y, 5, 5, True);

will search from center outwards.
Ahhh good memories, I remember doing that little 'trick' back in the good ol' days!

Er1k

2012-05-23 06:11:37

From: YoHoJo
I believe doing

X:=MSCX;
Y:=MCCY;
if(FindColorSpiralTolerance(X, Y, color, 270, 9, 450, 250, 10)) then
Mouse(X, Y, 5, 5, True);

will search from center outwards.
Ahhh good memories, I remember doing that little 'trick' back in the good ol' days!


Minor corrections. Mainscreen center is MSCX, MSCY ;)

YoHoJo

2012-05-23 06:13:14

Fixed em thanks, just quickly typed out that example :D.