Results 1 to 7 of 7

Thread: TInvenItem uses

  1. #1
    Join Date
    Jul 2010
    Location
    Western US
    Posts
    387
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default TInvenItem uses

    So I came across this cool thing in inventory.

    GetInven(integer);

    but I am unsure of how to work it to my will. I would like to take the value it gives me and perhapse excract a piece, or compare it to something. but all I can seem to do is colect it, store it, and compare colected to stored. For example:

    Simba Code:
    var
      IT:TInvenItem;
    begin
      IT:=GetInven(1);
      writeln(IT(1)); //this is not valid :(
      writeln(IT)
      IT:=(20, 14, 62, (695, 438, 715, 452), (705, 444), 1);  //this is not valid :(
      writeln(IT);
    end;

    How can I input the data (20, 14, 62, (695, 438, 715, 452), (705, 444), 1) into a simple variable? how can I extract pieces from this data.

    If there is a tutorial for this, I will apologize, I could not find it.
    Of all the things I have lost, I miss my mind the most.
    Current Projects:
    Addy bar miner and superheater

  2. #2
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Wtf. I could not get one word you were saying. Um, is this in Reflection or something? Can you post the include file that this type TInvenItem is found in?
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  3. #3
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    SRL/SRL/core/Inventory.scar

    Code:
    program new;
    {$i SRL/SRL/Core/Inventory.scar}
    
    var
    i:Integer;
    p: TInvenItem;
    begin
    p:= GetInven(i);
    
    p.CenterPoint;
    p.Count
    p.ExistsItem
    p.Height
    p.ItemBox
    p.Width
    end.
    Do something like that... its just a quick write up.. next time u can just look at the include itself and it tells u the results...

    Now store those values in an array and whala..

    Yeah Yeah I know.. im missing writeln and stuff but im just showing the usage..

  4. #4
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    I'll write something up right now.

    In the mean time, check this out.

    Edit:

    Simba Code:
    program new;
    {$include SRL/SRL.scar}
    var
      Item : TInvenItem;
    begin
      SetupSRL;
      Item := GetInven(1);
      Writeln(Format('Item Slot: %d', [1]));
      Writeln('ExistsItem: ' + ToStr(Item.ExistsItem));
      if not Item.ExistsItem then
        exit;
      Writeln(Format('Width: %d, Height: %d', [Item.Width, Item.Height]));
      Writeln(Format('ItemBox: (x1=%d,y1=%d,x2=%d,y2=%d)', [Item.ItemBox.x1, Item.ItemBox.y1, Item.ItemBox.x2, Item.ItemBox.y2]));
      Writeln(Format('CenterPoint: (%d, %d)', [Item.CenterPoint.x, Item.CenterPoint.y]));
    end.
    TInvenItem is a record.
    Last edited by Sex; 04-07-2011 at 05:06 AM.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  5. #5
    Join Date
    Jul 2010
    Location
    Western US
    Posts
    387
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    p.CenterPoint;
    p.Count
    p.ExistsItem
    p.Height
    p.ItemBox
    p.Width
    This is the key, I have been working with matlab too much lately. I have grown use to the old IT(1) stuff. Guess I completely forgot about the .somthing stuff.

    thanks
    Of all the things I have lost, I miss my mind the most.
    Current Projects:
    Addy bar miner and superheater

  6. #6
    Join Date
    Oct 2011
    Posts
    805
    Mentioned
    21 Post(s)
    Quoted
    152 Post(s)

    Default

    I have problem with it:

    SCAR Code:
    program new;
    var
    InvPos : array[1..28] of TInvenItem;
    begin
    end.

    Code:
    Compiling failed.
    [Error] (4:11): Unknown type 'TInvenItem' at line 3

  7. #7
    Join Date
    Aug 2008
    Location
    Finland
    Posts
    2,851
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by beginner5 View Post
    I have problem with it:

    SCAR Code:
    program new;
    var
    InvPos : array[1..28] of TInvenItem;
    begin
    end.

    Code:
    Compiling failed.
    [Error] (4:11): Unknown type 'TInvenItem' at line 3
    Always remember to include SRL.
    Simba Code:
    program new;
    {.include srl/srl.scar}

    begin
    end.

Thread Information

Users Browsing this Thread

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

Posting Permissions

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