Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function GetInvSpot(spot): TBox;
- begin
- if ((spot >= 1) and (spot <= 30)) then
- Result := IntToBox(265 + (((spot - 1) mod 5) * 49), 37 + (((spot - 1) div 5) * 34), 312 + (((spot - 1) mod 5) * 49), 69 + (((spot - 1) div 5) * 34));
- end;
- function InvSpotSearch(itemid, spot: Integer): Boolean;
- var
- bx: TBox;
- bmp: Integer;
- begin
- if ((spot < 1) or (spot > 30)) then
- begin
- WriteLn('Please enter a correct inventory spot!');
- Exit;
- end;
- if OpenGameTab(5) then
- begin
- Wait(100);
- if LoadItem(itemid, bmp, item_name) then
- begin
- bx := GetInvSpot(spot);
- Result := FindDeformedBitmapToleranceIn(bmp, X, Y, bx.X1, bx.Y1, bx.X2, bx.Y2, 0, 5, False, accuracy);
- if Result then
- WriteLn('Found ' + item_name + ' in inventory spot: ' + IntToStr(spot))
- else
- WriteLn('Could NOT locate ' + item_name + ' in inventory spot: ' + IntToStr(spot));
- FreeBitmap(bmp);
- end;
- end;
- end;
- function BoxCenter(bx: TBox): TPoint;
- begin
- if ((bx.X1 > bx.X2) or (bx.Y1 > bx.Y2)) then
- Exit;
- Result.X := Round(bx.X1 + ((bx.X2 - bx.X1) / 2));
- Result.Y := Round(bx.Y1 + ((bx.Y2 - bx.Y1) / 2));
- end;
Advertisement
Add Comment
Please, Sign In to add comment