Results 1 to 6 of 6

Thread: Need help with a function

  1. #1
    Join Date
    Feb 2015
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default Need help with a function

    Hello! I got this function:
    Code:
    function R_GetInventoryItems2: TInventoryItemArray2;
    var
      _Inventory, _InventorySlot, _ItemID, _ItemQuantity: Integer;
    begin
      _Inventory := R_GetWidget2(149, 0);
      SetLength(Result, 28);
      for _InventorySlot := 0 to 27 do begin
        _ItemID := SmartGetFieldArrayInt(SmartCurrentTarget, _Inventory, Widget_getItems, _InventorySlot);
        if (_ItemID > 0) then begin
          _ItemQuantity := SmartGetFieldArrayInt(SmartCurrentTarget, _Inventory, Widget_getStackSizes, _InventorySlot);
          with Result[_InventorySlot] do begin
            ID := _ItemID;
            Quantity := _ItemQuantity;
            Slot := _InventorySlot + 1;
          end;
        end;
      end;
      SmartFreeObject(SmartCurrentTarget, _Inventory);
    end;
    I think Widget_getItems is outdated? I can't really find anything in the api cause there is no real structure (classes, documentatio, etc).

    Thx for help!

  2. #2
    Join Date
    Oct 2006
    Posts
    6,752
    Mentioned
    95 Post(s)
    Quoted
    532 Post(s)

    Default

    Well that entire include, reflection for pascal script is not being developed any longer. I would suggest you check out the lape include in the reflection forum which is being actively developed. If you have an questions on it you can post about it there. The link to the forum is in my signature.
    “The long-lived and those who will die soonest lose the same thing. The present is all that they can give up, since that is all you have, and what you do not have, you cannot lose.” - Marcus Aurelius

  3. #3
    Join Date
    Feb 2015
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Thx. One question: Does a pascal script work with lape reflection?

  4. #4
    Join Date
    Oct 2006
    Posts
    6,752
    Mentioned
    95 Post(s)
    Quoted
    532 Post(s)

    Default

    Quote Originally Posted by Alpha11833 View Post
    Thx. One question: Does a pascal script work with lape reflection?
    Lape works with Lape reflection and pascal script works with pascal script reflection
    “The long-lived and those who will die soonest lose the same thing. The present is all that they can give up, since that is all you have, and what you do not have, you cannot lose.” - Marcus Aurelius

  5. #5
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default

    Quote Originally Posted by Alpha11833 View Post
    Thx. One question: Does a pascal script work with lape reflection?
    To clarify a bit on elfyyy's post, PascalScript and Lape (as referred to in this case) are interpreters. They're kind of like what reads the code to your computer so it can understand it.
    The old Reflection was written with PascalScript, which is completely incompatible with Lape. The new Reflection is written in Lape, which is completely incompatible with PascalScript.

    If you ever run a RS3 script - they run under SRL-6 which is written in Lape. Currently, all components of SRL use Lape with the exception of SRL-OSR.
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Bad™ before everyone gets laser pistols

  6. #6
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    U can easily convert any script that supports PS to Lape within a minute, only some minor changes needed....

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
  •