Janilabo

Untitled

Aug 19th, 2012
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.74 KB | None | 0 0
  1. function MapPos(var map_pt: TPoint): Boolean;
  2. var
  3.   old_client, minimap, map: Integer;
  4. begin
  5.   old_client := GetImageTarget;
  6.   minimap := CreateBitmap(155, 115);
  7.   CopyClientToBitmap(minimap, 353, 72, 508, 187);
  8.   FastReplaceColor(minimap, 255, 0);
  9.   FastReplaceColor(minimap, 16711422, 0);
  10.   FastReplaceColor(minimap, 65535, 0);
  11.   FastReplaceColor(minimap, 16776960, 18183);
  12.   FastReplaceColor(minimap, 16776960, 40960);
  13.   SetTransparentColor(minimap, 0);
  14.   map := LoadBitmap(IncludePath + '\RSCS\map.bmp');
  15.   SetTargetBitmap(map);
  16.   Result := FindBitmap(minimap, map_pt.X, map_pt.Y);
  17.   if not Result then
  18.   begin
  19.     Result.X := -1;
  20.     Result.Y := -1;
  21.   end;
  22.   SetImageTarget(old_client);
  23.   FreeBitmap(map);
  24.   FreeBitmap(minimap);
  25. end;
Advertisement
Add Comment
Please, Sign In to add comment