Two new functions i made today:
isMoving
Returns true if your player is moving (based on points on the minimap)
waitUntilStopMoving
Waits until your player has stopped moving (similar to fFlag(0) but uses points on the minimap)
SCAR Code:
function isSpecCol(col: integer): boolean;
begin
case col of
1310462: result := true; //NPCs
982782: result := true;
195836: result := true;
62965: result := true;
56797: result := true;
60909: result := true;
52428: result := true; //End of NPCs
16711422: result := true; //Players
15527148: result := true;
13816530: result := true;
14869218: result := true;
12961221: result := true; //End of Players
3553023: result := true; //Drops
789758: result := true;
2105598: result := true;
395004: result := true;
233: result := true;
241: result := true;
206: result := true;
217: result := true;
188: result := true; //End of Drops
16777215: result := true; //Your player
65536: result := true; //Bottom of drop dots
255: result := true; //Flag
284358: result := true;
1127261: result := true; //End of flag
end;
//if(result) then
// writeln(intToStr(col));
end;
function isMoving: boolean;
var
NumOfPoints: integer;
numDone: integer;
Points: array of record
x, y, color: integer;
end;
x, y: integer;
color: integer;
i: integer;
begin
NumOfPoints := 20;
numDone := 0;
setLength(points, NumOfPoints);
repeat
wait(1);
x := random(MMX2 - MMX1) + MMX1;
y := random(MMY2 - MMY1) + MMY1;
if(not isOnMinimap(x, y)) then
continue;
color := getColor(x, y);
if(isSpecCol(color)) then
continue;
points[numDone].x := x;
points[numDone].y := y;
points[numDone].color := color;
numDone := numDone + 1;
if(numDone = NumOfPoints) then
break;
until(false)
wait(100 + random(50));
for i := 0 to NumOfPoints - 1 do
begin
wait(1);
color := getColor(points[i].x, points[i].y);
if(color <> points[i].color) then
begin
if(not isSpecCol(color)) then
begin
//writeln('Yea ' + intToStr(color) + ', ' + intTOStr(points[i].color) + ' ' + intToStr(points[i].x) + ', ' + intToStr(points[i].y));
result := true;
exit;
end;
end;
end;
end;
procedure waitUntilStopMoving;
var
t1, t2: integer;
begin
T1 := GetTickCount;
repeat
T2 := GetTickCount;
Wait(100);
if T2 - T1 > 30000 then
begin
Mouse(MMCX, MMCY, 0, 0, True);
Break;
end;
if Random(20) = 1 then IdleTime(500, 1000, 0.01);
until (not isMoving);
end;