SRL Archive - OSR Help

FindColorSpiralTolerance won't work properly for me


rsbots2013

2013-06-21 05:12:39

I'm trying to use FindColorSpiralTolerance.

When it's called for in my script it finds a color and moves my mouse to it.

Problem is: It finds the wrong color and goes to the top left of the box I told it to look in.

What did I do wrong?

euphemism

2013-06-21 09:13:56

First question: is the top left bound of your search box (0, 0) ? Regardless, if it is mousing in the top-left corner of the client, that means your color was not found. Why is this? The variables you used to store the x and y coordinate of where the color is found are by default initialized to 0. If the color is not found, then those variables are never changed and are still 0's. So, you should use a boolean check to make sure the color was found. i.e.

if (not FindColorSpiralTolerance()) then
writeln('color not found.');