Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
shadowrecon

Some modified wait find color functions

Recommended Posts

I was looking for a wait function for colors and found wanted's version in the lib. i modified them for findobj and find color area i found them to be useful just posting maybe someone else will too? these should deff be included in the osi timing.scar =)

function WaitFindObjSpiral(var X, Y: Integer; Color,Tol,Width,Height: Integer; FindText: TStringArray; DesiredResult: Boolean; MinWait, MaxWait, MinTotalWait, MaxTotalWait: LongInt): Boolean;
var
 T: LongInt;
begin
 Result := True;
 T := GetSystemTime + RR(MinTotalWait, MaxTotalWait);
 while (GetSystemTime < T) do
   if (FindObjSpiral(X, Y, Color,Tol,Width,Height,FindText) = DesiredResult) then
     Exit
   else
     WaitRR(MinWait, MaxWait);
 Result := False;
end; 

function WaitFindColoredAreaTolerance(var X, Y: Integer; Color, X1, Y1, X2, Y2, MinPix, Tol: Integer; DesiredResult: Boolean; MinWait, MaxWait, MinTotalWait, MaxTotalWait: LongInt): Boolean;
var
 T: LongInt;
begin
 Result := True;
 T := GetSystemTime + RR(MinTotalWait, MaxTotalWait);
 while (GetSystemTime < T) do
   if (FindColoredAreaTolerance(X, Y, Color, X1, Y1, X2, Y2,MinPix, Tol) = DesiredResult) then
     Exit
   else
     WaitRR(MinWait, MaxWait);
 Result := False;
end; 

 

** Note i did not write these functions from scratch just simply modified wanted's original WaitFindColorTol() function to better fit my needs with other find color methods!

Share this post


Link to post
Share on other sites

You must wait for them to be implemented. Im just making my own include file though :P Seems I give suggestions for OSI but 1 or 2 things happen. 1 it needs to be implemented better than my code. 2. Its too dumb of an idea or too shity for OSI. or 3.... Just gets ignored lol.

Share this post


Link to post
Share on other sites
You must wait for them to be implemented. Im just making my own include file though :P Seems I give suggestions for OSI but 1 or 2 things happen. 1 it needs to be implemented better than my code. 2. Its too dumb of an idea or too shity for OSI. or 3.... Just gets ignored lol.

 

As I said, you're free to create your own include based on OSI and have it int he include system.

Share this post


Link to post
Share on other sites

lmao rsutton..

 

Thanks freddy for the idea, that really opens up alot of options, i love osi dont get me wrong, and i understand wanted worry's about it. As ive got the feeling its his 'Baby' and he wants it a certain way and doesnt want it to end up like srl did with shit scattered not documented ect.. which is all fine and dandy but for us people using scripts makes it hard to get lengthy code that we reuse out of our scripts. Anyways Thanks!

Edited by shadowrecon

Share this post


Link to post
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...