SRL Archive - OSR Help

Noob problem with "FindColorSpiralTolerance", Not picking up any colours in game?


JohnDoes

2013-09-01 00:39:57

Hello,

I'm having a problem with some code i'm trying to use on a application. I wrote a script to use it on the main menu to auto log me in but once i get into the program i was trying to write a new script but it doesn't pick up any colors.

After trying to get it to pick up different colors inside the application and none of it working i've reached the point where i'm completely lost and can't find anything in search. From my understanding this code should pick up any color on my screen… however it isn't.

If anyone could give me some help it'd be great.

Thanks



program LocateRod;

var
x, y:Integer;

procedure Cast;
begin

if FindColorSpiralTolerance(x, y, 5059883, 0, 0, 1919, 1078, 245) then
// Pick up any color on the screen
wait(500);
MoveMouse(765, 1045); // Problem, Does not run
ClickMouse(x, y, 1); // Problem, Does not run

end;

begin
MoveMouse(100,100);
ClickMouse(100,100,1);
repeat
Cast;
until(false);

end.

riwu

2013-09-01 01:15:40

You need a begin and end to indicate the statement block:

if ... then
begin
//statement1
// statement 2
//...
end;

JohnDoes

2013-09-01 01:24:12

Hello, Thank you for the help.

In the last script i made i didn't add a begin, end; at all and it worked fine. Doesn't matter thank you for the help again :).

Just to clarify, This is what you mean:

procedure Cast;
begin

if FindColorSpiralTolerance(x, y, 15990527, 993, 540, 1010, 550, 40)then
begin
wait(1000);
PressKey(2);
end;

end;

riwu

2013-09-01 01:58:22

Yeah. If you dont add the begin and end, the last 2 statements will always be executed regardless of whether the if statement returns true.

Your ClickMouse() won't work as intended because you move ur mouse to a static coord but ur ClickMouse() clicks on a very possibly different spot (hence it would do nth)

KingKong

2013-09-01 02:03:23

From: JohnDoes
Hello, Thank you for the help.

In the last script i made i didn't add a begin, end; at all and it worked fine. Doesn't matter thank you for the help again :).

Just to clarify, This is what you mean:

procedure Cast;
begin

if FindColorSpiralTolerance(x, y, 15990527, 993, 540, 1010, 550, 40)then
begin
wait(1000);
PressKey(2);
end;

end;


yes, if findcolorspiraltolerance returns true then everything in the begin…end will be executed instead of just the first line.
Also, what kind of application are you trying to get the color from? because if its a flash game or some fullscreen games, they don't work.