I didn't feel like finishing it. But this 'tool' will make you immortal. Got to 200 on hard with then I quit. Could easily be made into a bot.
:p LAPE PEOPLE!
program new;
{$DEFINE DEBUG}
const
SP: TPoint = [3, 45];
EP: TPoint = [502, 375];
SIZE: TPoint = [500, 331];
var
Setup: Boolean;
area, clearArea: TPointArray;
procedure DisplayDebug(bmp: Integer);
begin
{$IFDEF DEBUG}
if(Setup) then
begin
writeln('setting up debug window');
DisplayDebugImgWindow(SIZE.x, SIZE.y);
Setup := False;
end;
ClearDebugImg;
DrawBitmapDebugImg(bmp);
{$ENDIF}
end;
procedure DisplayDebug(pts: TPointArray); overload;
var
bmp: Integer;
bounds: TBox;
begin
{$IFDEF DEBUG}
bounds := GetTPABounds(pts);
bmp := CreateBitmap(bounds.x2 + 1, bounds.y2 + 1);
DrawTPABitmap(bmp, pts, $FF00FF);
DisplayDebug(bmp);
FreeBitmap(bmp);
{$ENDIF}
end;
type
TButton = record
v: Integer;
end;
var
button: TButton;
function TButton.TryAgain: Boolean;
begin
end;
function GetArea(what: String): TPointArray;
begin
if(what = 'screen')then
TPAFromBoxWrap(IntToBox(0, 0, Size.x-1, Size.y-1), Result)
else
TPAFromBoxWrap(IntToBox(0, 0, 96, 96), Result)
end;
function CompareBmps(const bmp1, bmp2: Integer; var x, y: Integer): Boolean;
var
i: Integer;
colors1, colors2: TIntegerArray;
pts: TPointArray;
begin
Result := False;
colors1 := FastGetPixels(bmp1, area);
colors2 := FastGetPixels(bmp2, area);
for i := High(colors1) downto 0 do //loop through the colors
if(not(colors1[i] = colors2[i])) then //compare the colors
begin
SetLength(pts,Length(pts)+1);
pts[High(pts)] := Point(i div Size.y, i mod Size.y); //i to coords
end;
if Length(pts) < 1 then //if there is no change, continue
Exit;
ClearTPAFromTPAWrap(pts, clearArea, pts); //clears the score area
DisplayDebug(pts);
Result := True;
MiddleTPAEx(pts, x, y);
end;
procedure MainLoop();
var
newBmp, oldBmp, x, y: Integer;
ptsDif: TPointArray;
begin
oldBmp := CreateBitmap(SIZE.x, SIZE.y);
while not(button.TryAgain) do
begin
newBMP := CreateBitmap(SIZE.x, SIZE.y);
CopyClientToBitmap(newBmp, SP.x, SP.y, EP.x, EP.y);
CompareBmps(newBMP, oldBmp, x, y);
//MoveMouse(x, y);
FreeBitmap(oldBmp);
oldBmp := newBmp;
end;
end;
begin
Setup := True;
area := GetArea('screen');
clearArea := GetArea('clear');
ClearDebug;
MainLoop();
end.