Results 1 to 2 of 2

Thread: This inventory snippet o' mine.

  1. #1
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default This inventory snippet o' mine.

    Basically, the meaning of this function is to return all the stuff in inventory, which is not supposed to be there.

    SRL Members, etc dont propably need advice on how it works, but anyways,

    Set the "Range" to the range from the middle of inventory slot, to the max area away from your DTM.

    It does following to every inventory slot:

    Creates the "box" around current slot, checks if the DTM of "Item Supposed to Exist" is there, if not, it saves it to an array, gets the name.

    Returns names of "Bad stuffs" to the "Stuffs", and returns the points of them as the result.

    SCAR Code:
    function BadStuff(ExceptForDTM: TIntegerArray; Range: Integer;
     var Stuffs: TStringArray): TPointArray;
    var
      I, Inv, Ix1, Iy1, Ix2, Iy2, X, Y, Stringz: Integer;
    var
      Item: TPoint;
    begin
      for Inv := 1 to 28 do
      begin
        Item := ItemCoords(Inv);
        Ix1 := Item.x - Range;
        Iy1 := Item.y - Range;
        Ix2 := Item.x + Range;
        Iy2 := Item.y + Range;
        for I := 0 to GetArrayLength(ExceptForDTM) - 1 do
        begin
          if(FindDTM(ExceptForDTM[i], X, Y, Ix1, Iy1, Ix2, Iy2))then
          begin
            SetArrayLength(Result, Length(Result) + 1);
            Result[Length(Result) - 1].x := X;
            Result[Length(Result) - 1].x := X;
          end;
        end;
      end;
      Item.x := 0;
      Item.y := 0;
      for Stringz := 0 to GetArrayLength(Result) - 1 do
      begin
        Item := Result[stringz];
        MMouse(Item.x, Item.y, 3, 3);
        SetArrayLength(Stuffs, Length(Stuffs) + 1);
        Stuffs[Length(Stuffs) - 1] := GetTextAtEx(7, 7, 100, upchars, True, True, 0,
         2, 3569100, 50, False, tr_AllChars);
      end;
    end;

    Umm, havent tested... Anyways, in theory it should propably work.

  2. #2
    Join Date
    Jun 2007
    Location
    NSW, Australia.
    Posts
    541
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Couldn't you just drop everything that isn't the DTM though?
    Quote Originally Posted by RAM View Post
    I sam sofa king wee todd did ! ~RAM
    My SRL Army Blog.


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Inventory Empty
    By Cstrike in forum OSR Help
    Replies: 9
    Last Post: 10-14-2008, 10:54 PM
  2. Items in inventory help
    By wtf i sp4nk in forum OSR Help
    Replies: 2
    Last Post: 05-20-2007, 09:58 PM
  3. What are the coords for the inventory?
    By Johura in forum OSR Help
    Replies: 4
    Last Post: 04-02-2007, 11:53 AM
  4. Inventory
    By 3Garrett3 in forum OSR Help
    Replies: 5
    Last Post: 03-18-2007, 01:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •