Gearsnare
2009-04-08 20:42:14
Here is my function which waits until player stops moving, it helps to overcome if the flags get stuck on the screen.
I'm new to scripting, is it correct to post stuff like this into this part of the forum?
Thanks
{*******************************************************************************
function WalkEnd: Boolean;
By: Gearsnare
Description: Waits until player walking or running stops.
*******************************************************************************}
function WalkEnd: Boolean;
var
c, c2, H, i, i2: Integer;
P: array [0..9] of array [0..3] of Integer;
BadColors: TIntegerArray;
begin
BadColors := [65536, 16711422, 12961221, 14869218, 16777215, 15527148, 195836,
56797, 60909, 52428, 13816530, 982782, 1310462, 62965, 2105598,
395004, 789758, 3553023, 217, 188, 241, 206, 233, 64768, 58880,
51456, 49152, 44800, 61440, 16215571, 9716750, 13129742];
repeat
i := 0;
c := 0;
c2 := 9;
repeat
if (not(LoggedIn)) then Exit;
if (not(GetColor(120, 175) = 0)) then
P[i][0] := 571 + Random(110);
P[i][1] := 33 + Random(100);
P[i][2] := GetColor(P[i][0], P[i][1]);
H := High(BadColors);
for i2 := 0 to H do
if (P[i][2] = BadColors[i2]) then Break;
i := i + 1;
until (i = 9);
Wait(1000);
i := 0;
for i := 0 to 9 do
begin
P[i][3] := GetColor(P[i][0], P[i][1]);
for i2 := 0 to H do
if (P[i][3] = BadColors[i2]) then c2 := c2 - 1;
if (P[i][2] = P[i][3]) then c := c + 1;
end;
if (c = 0) then Break;
until (c >= c2);
Result := True;
end;
I'm new to scripting, is it correct to post stuff like this into this part of the forum?
Thanks