Naum
2009-05-19 19:12:22
CloseWindow had a few problems of closing a window and making it click on the ground aswell, I have made my own CloseWindow which is shorter + Faster and works for any window. It also works for the new Equipment stats window, please test.
This is the cleaned version outputted from the combined efforts of Nava2 and Narcle.
This is the cleaned version outputted from the combined efforts of Nava2 and Narcle.
Function CloseWindow : Boolean;
Var
Col : TIntegerArray;
A, B : TPointArray;
Pa : TBox;
I : Integer;
Begin
Col := [1909802, 9678265, {Main typ 1}
8042720, 4160933, {Skill}
6854059, 2902100, {Quest}
10070193, 2503226]; {Main typ 2}
For I := 0 To (High(Col) Div 2) Do
Begin
FindColorsTolerance(A, Col[i*2], MSX1, MSY1, MSX2, MSY2, 1);
FindColorsTolerance(B, Col[i*2+1], MSX1, MSY1, MSX2, MSY2, 1);
If ((High(a) + High(b)) > 0) Then
Begin
Pa := GetTPABounds(CombineTPA(A, B));
Mouse(RandomRange(Pa.x1, Pa.x2), RandomRange(Pa.y1, Pa.y2), 0, 0, True);
Result := (Pa.x1 >= 100);
Exit;
End;
End;
End;