Jump to content
Drenferalis

Very odd script behavior (Findcolortolerance vs. findcolorspiraltolerance)

Recommended Posts

So im not sure if this is a bug or not.

 

Client is selected and screen size is being set manually.

When using spiral the color is not found (even with a LARGE tolerance) even though I had used the color picker to find the color and the color is picked within the range set.

When NOT using spiral the color IS found at the most top right of the set range, using the following code it returns " Found color at: 52,1281. It is this color:-1".

writeln('Found color at '+inttostr(x)+','+inttostr(y)+'. It is this color:'+inttostr(getcolor(x,y)));

Can someone explain why scar cannot find colors with the application I am running it on? (It CAN find some colors but not all of them, it finds the "client is open" overlay but not what I need it for.)

 

Below is the current code I am using.

 

 

program New;
var x,y,x2,y2,tol,w, ran10, ran50: integer; //Some integers to be used later!
begin
repeat
if(findcolorTolerance(x,y,7961012,13,33,14,34,0))then
begin
writeln('x'); //Client overlay is found. Works.
if(findcolorspiralTolerance(x,y,0,52,1281,52,1026,29990))then
Begin
writeln('Found color at '+inttostr(x)+','+inttostr(y)+'. It is this color:'+inttostr(getcolor(x,y)));
if(findcolorspiralTolerance(x2,y2,139,x,y,(x+100),(y+10),0))then
Begin
writeln('Found center');
MoveMouse(x2,y2);
writeln('Move mouse to '+inttostr(x2)+','+inttostr(y2));
//ClickMouse(x2,y2,True);
wait(randomrange(100,170));
end;
end;
end;
wait(10);
until(iskeydown('\'));
end.

 

Fixed. Retarded mistake. (GetColor is still returning -1 even though x,y is within canvas co-ords though)

Found color at 670,498. It is this color:-1

Edited by Drenferalis
Link to comment
Share on other sites

You could try doing this for w/e you are trying to search on. But you probably know about it, the wiki has some documentation on this:

http://wiki.scar-divi.com/index.php?title=Category:Color_Functions

http://wiki.scar-divi.com/index.php?title=Category:Tolerance_Functions

[sCAR]

FindWindow('Notepad', false); // Finds a window called Notepad ( exactly, use FindWindowTitlePart for non exactness )

ActivateClient; // Sets focus to notepad ( if notepad was even found )

[/sCAR]

Edited by LordJashin
Link to comment
Share on other sites

Please use scar tags when posting code. [-Scar-] // script code goes here [-/Scar-] Remove the "-"

[scar]

Prgram New;

 

begin

end;

[/scar]

 

 

Referring to your problem, you need to check and make sure your client is set, so try using GetColor(X, Y) and writeln the color it returns to make sure the client is active.

 

~ ShadowRecon

Edited by shadowrecon
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...