Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function MapPos(var map_pt: TPoint): Boolean;
- var
- old_client, minimap, map, w, h: Integer;
- begin
- old_client := GetImageTarget;
- minimap := CreateBitmap(155, 115);
- CopyClientToBitmap(minimap, 353, 72, 508, 187);
- FastReplaceColor(minimap, 16777215, 0); // Whitedot player
- FastReplaceColor(minimap, 16711422, 0); // Whitedot player
- FastReplaceColor(minimap, 18440 , 0); // Whitedot player
- FastReplaceColor(minimap, 255, 0); // Items on map
- FastReplaceColor(minimap, 65535, 0); // NPCs on map
- SaveBitmap(minimap, (AppPath + 'MAPS\minimap.bmp'));
- map := LoadBitmap(AppPath + '\MAPS\Map.bmp');
- FastReplaceColor(map, 24495, 16776960);
- FastReplaceColor(map, 40960, 16776960);
- SetTransparentColor(map, 0);
- SetTargetBitmap(map);
- GetClientDimensions(w, h);
- Result := FindBitmapToleranceIn(minimap, map_pt.X, map_pt.Y, 0, 0, (w - 1), (h - 1), 10);
- if Result then
- begin
- CopyClientToBitmap(minimap, map_pt.X, map_pt.Y, (map_pt.X + 154), (map_pt.Y + 114));
- SaveBitmap(minimap, (AppPath + 'MAPS\minimap.bmp'));
- end else
- begin
- map_pt.X := -1;
- map_pt.Y := -1;
- end;
- SetImageTarget(old_client);
- FreeBitmap(map);
- FreeBitmap(minimap);
- end;
Advertisement
Add Comment
Please, Sign In to add comment