shadowrecon Posted January 13, 2012 Share Posted January 13, 2012 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! Quote Link to comment Share on other sites More sharing options...
rsutton Posted January 13, 2012 Share Posted January 13, 2012 You must wait for them to be implemented. Im just making my own include file though 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. Quote Link to comment Share on other sites More sharing options...
FHannes Posted January 14, 2012 Share Posted January 14, 2012 You must wait for them to be implemented. Im just making my own include file though 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. Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted January 14, 2012 Author Share Posted January 14, 2012 (edited) 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 January 14, 2012 by shadowrecon Quote Link to comment Share on other sites More sharing options...