Janilabo

Untitled

Aug 19th, 2012
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.84 KB | None | 0 0
  1. function InvSpotSearch(itemid, spot: Integer): Boolean;
  2. var
  3.   bx: TBox;
  4.   bmp: Integer;
  5. begin
  6.   if ((spot < 1) or (spot > 30)) then
  7.   begin
  8.     WriteLn('Please enter a correct inventory spot!');
  9.     Exit;
  10.   end;
  11.   bx := IntToBox(265 + ((spot mod 5) * 49), 37 + ((spot div 5) * 34), 312 + ((spot mod 5) * 49), 69 + ((spot div 5) * 34));
  12.   if OpenGameTab(5) then
  13.   begin
  14.     Wait(100);
  15.     if LoadItem(itemid, bmp, item_name) then
  16.     begin
  17.       GetBitmapSize(bmp, width, height);
  18.       Result := FindDeformedBitmapToleranceIn(bmp, X, Y, bx.X1, bx.Y1, bx.X2, bx.Y2, 0, 5, False, accuracy);
  19.       if Result then
  20.         WriteLn('Found ' + item_name + ' in inventory spot: ' + IntToStr(s1))
  21.       else
  22.         WriteLn('Could NOT locate ' + item_name + ' in inventory spot: ' + IntToStr(s1));
  23.       FreeBitmap(bmp);
  24.     end;
  25.   end;
  26. end;
Advertisement
Add Comment
Please, Sign In to add comment