PDA

View Full Version : MinimapBuilder



bob_dole
06-12-2013, 01:03 PM
This script is for scripters/developers only. If you are an ordinary botter this script will not do anything for you.

While mapping out the abyss I quickly coded a script that will grab the minimap when smart is enabled and group them together into a file of several minimaps. The script is easy enough to use, simply load the SMART window and get to where you need it, then enable smart. Enabling smart will then capture the minimap.

Unfortunately it does not piece them together in a nice, usable map, but does save time if you were previously printscreening and cutting out the minimap that way.

Before starting I highly recommend you make your compass as north as possible for best results. Basically you look at the lines on the minimap and attempt to have them at a 180 degree angle, or completely straight. This way it is easy to plaster the maps over each other for the final product.


program MinimapBuilder;
{$DEFINE SMART8}
{$I SRL-OSR/SRL.Simba}

const
FileName = 'minimap1.bmp';
width = 2;
height = 2;


function circle(radius: integer; center: TPoint): integer;
var
color, bmp, i, j: integer;
begin

bmp := CreateBitmap(radius * 2, radius * 2);

for i := -radius to radius do
begin

for j := -radius to radius do
begin


if ((pow (i, 2) + pow (j, 2)) < pow (radius, 2)) then
begin
color := GetColor (center.x + i, center.y + j);
RectangleBitmap (bmp, IntToBox (i + radius ,j + radius ,i + radius ,j + radius ), color);
end;

end;

end;

result := bmp;
end;

function remainder(x, y:integer): integer;
var
i: integer;
begin
result := x - (floor(x / y) * y);
end;

function dim(i:integer): TPoint;
begin
result.x := 132 * remainder(i, width);
result.y := 132 * floor(i / width);
end;

Var
Minimap: TMufasaBitmap;
i, x, y, bmp_x, bmp_y, bmp: integer;
myloc, loc: tpoint;
Begin
setupSRL;

bmp := CreateBitmap((width * 132), (height * 132));

i := 0;

repeat

repeat
wait(1);
until (SmartEnabled);

loc := dim (i);
i := i + 1;

FastDrawTransparent(loc.x,loc.y, Circle (66, Point(642, 76)), bmp);
writeLn('Saved map number #' + inttostr(i) + '.');

if (i = (width * height)) then
break;

repeat
wait(1);
until (not (SmartEnabled));

until (i = (width * height));

SaveBitmap(bmp, FileName);

DrawBitmapDebugImg(bmp);
DisplayDebugImgWindow((width * 132), (height * 132));

End.

King
06-12-2013, 04:47 PM
Wow..pretty cool ;) you can use forcecompassnorth from Flight as well.

Ian
06-12-2013, 05:05 PM
I've always used the Snipping Tool that comes with Windows, just press the snip button, select your area, then copy and paste to a paint file. This would save time though, especially useful for making large maps :)