Results 1 to 8 of 8

Thread: tabBackpack not working correctly

  1. #1
    Join Date
    Dec 2017
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default tabBackpack not working correctly

    Hi i just started scripting and i ran into a problem with the tabBackpack function I am trying to use these two simple codes.

    Begin
    If tabBackpack.isFull() then
    writeLn ('Full')
    End

    or this one

    Begin
    writeLn (tabBackpack.count());
    End

    it keeps throwing the same thing in the debug

    Compiled successfully in 7312 ms.
    SRL: Logfile = C:\Simba\Includes\SRL-6/logs/SRL log (11-12-17 at 05.39.06 PM).txt
    ---- TRSGameTab.__initTabs(): Setup gametab properties
    25
    -- Freeing gametabs bitmaps...
    Successfully executed.

    Not sure if the Tab functions are broken or what is going on here is a pic of the setup and what i have open on the smart client.
    RStrouble.png

  2. #2
    Join Date
    Oct 2007
    Posts
    187
    Mentioned
    7 Post(s)
    Quoted
    61 Post(s)

    Default

    could you link the entire script so I can take a look?

  3. #3
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    6,136
    Mentioned
    28 Post(s)
    Quoted
    17 Post(s)

    Default

    True, it is not working correctly. While we wait for a fix, you can use the one i wrote to circumvent this. It is very simple due to my KISS principle (it counts till 30 f.i.), but CountInv > 27 should be the same as tabBackpack.isFull().

    Code:
    Function CountInv:Integer;
    var Row, column, x,y,a,b,c:Integer;
    begin
    
    for Row := 0 to 4 do
    begin
      For Column := 0 to 5 do
      begin
        x := 580 + (Row * 42);
        y := 338 + (Column * 35);
        if FindColor(a,b,131072, x, y, x + 42, y + 35) then
        begin
          IncEx(c,1);
         end;
      end;
    end;
    Result := c;
       Writeln('CountInv Returned: ' + IntToStr(c));
    end;
    WT
    SRL is a Library of routines made by the SRL community written for the Program Simba.
    We produce Scripts for the game Runescape.

  4. #4
    Join Date
    May 2012
    Posts
    499
    Mentioned
    23 Post(s)
    Quoted
    228 Post(s)

    Default

    Thanks for reporting, I'll have a look this weekend.


    *edit*
    Works just fine:
    Code:
    tabBackpack.open();
    writeln('active tab: ' + toStr(gameTabs.getActiveTab()));
    writeln('is backpack active: ' + toStr(gameTabs.isTabActive(TAB_BACKPACK)));
    writeln('is backpack open: ' + toStr(tabBackpack.isOpen()));
    writeLn('backpack count: ' + toStr(tabBackpack.count()));    
    *
    *
    *
    active tab: 2
    is backpack active: True
    is backpack open: True
    backpack count: 4
    Remember transparancy changed/got reset so make sure you set it to 0% again.
    Also game tabs changed with the ribbon update, make sure to update to latest SRL.

  5. #5
    Join Date
    Nov 2012
    Posts
    161
    Mentioned
    2 Post(s)
    Quoted
    72 Post(s)

    Default

    Quote Originally Posted by Thomas View Post
    Thanks for reporting, I'll have a look this weekend.


    *edit*
    Works just fine:
    Code:
    tabBackpack.open();
    writeln('active tab: ' + toStr(gameTabs.getActiveTab()));
    writeln('is backpack active: ' + toStr(gameTabs.isTabActive(TAB_BACKPACK)));
    writeln('is backpack open: ' + toStr(tabBackpack.isOpen()));
    writeLn('backpack count: ' + toStr(tabBackpack.count()));    
    *
    *
    *
    active tab: 2
    is backpack active: True
    is backpack open: True
    backpack count: 4
    Remember transparancy changed/got reset so make sure you set it to 0% again.
    Also game tabs changed with the ribbon update, make sure to update to latest SRL.
    Thomas,

    When only the backpack is open (and NO other tabs) the backpack works. However, I still get "is backpack active: FALSE". If another tab is open, all slots get shifted down to make room for the backpack icon and other icons and tabbackpack no longer works. I also get backpack count as 6.

    EDIT: if other tabs are open, slot 28 becomes slot 23.
    EDIT 2: even if the backpack is the only thing open, it thinks slot 2 is slightly higher than it is. Guessing that is because the ribbon is larger now.
    EDIT 3: No current updates.

  6. #6
    Join Date
    May 2012
    Posts
    499
    Mentioned
    23 Post(s)
    Quoted
    228 Post(s)

    Default

    Quote Originally Posted by nkd2009 View Post
    Thomas,

    When only the backpack is open (and NO other tabs) the backpack works. However, I still get "is backpack active: FALSE". If another tab is open, all slots get shifted down to make room for the backpack icon and other icons and tabbackpack no longer works. I also get backpack count as 6.

    EDIT: if other tabs are open, slot 28 becomes slot 23.
    EDIT 2: even if the backpack is the only thing open, it thinks slot 2 is slightly higher than it is. Guessing that is because the ribbon is larger now.
    EDIT 3: No current updates.
    Well regardless of what I try, it all works.
    It opens backpack if backpack is not open, and it counts items in backpack correct.

    Perhaps SRL-github updates didn't come through viq Simba. Either way I'm pretty sure I submitted all my changes to the SRL-github.

    *edit*
    Seems like layouts got changed.
    Reset the quick load layout to oldschool (within the options menu, get there by pressing escape)

    Then try these changes:
    srl-6\lib\interfaces\gametabs\Gametab.simba, change line 178 (add the +12 twice)
    Simba Code:
    __tabSelectionArea := [581, 296 + 12, 796, 319 + 12];

    srl-6\lib\interfaces\gametabs\Backpack.simba, change lines 140 and 141 (add the +13 once on both lines)
    Simba Code:
    __slots[0] := grid(5, 6, 33, 31, 42, 36, point(gameTabs.tabArea.x1 + 25, gameTabs.tabArea.y1 + 22 + 13));
        __slots[1] := grid(5, 6, 33, 31, 42, 36, point(gameTabs.tabArea.x1 + 25, gameTabs.tabArea.y1 + 50 + 13));

    This should add the correct offsets with new oldschool layout.
    Please try this and report back.

  7. #7
    Join Date
    Nov 2012
    Posts
    161
    Mentioned
    2 Post(s)
    Quoted
    72 Post(s)

    Default

    Quote Originally Posted by Thomas View Post
    Well regardless of what I try, it all works.
    It opens backpack if backpack is not open, and it counts items in backpack correct.

    Perhaps SRL-github updates didn't come through viq Simba. Either way I'm pretty sure I submitted all my changes to the SRL-github.

    *edit*
    Seems like layouts got changed.
    Reset the quick load layout to oldschool (within the options menu, get there by pressing escape)

    Then try these changes:
    srl-6\lib\interfaces\gametabs\Gametab.simba, change line 178 (add the +12 twice)
    Simba Code:
    __tabSelectionArea := [581, 296 + 12, 796, 319 + 12];

    srl-6\lib\interfaces\gametabs\Backpack.simba, change lines 140 and 141 (add the +13 once on both lines)
    Simba Code:
    __slots[0] := grid(5, 6, 33, 31, 42, 36, point(gameTabs.tabArea.x1 + 25, gameTabs.tabArea.y1 + 22 + 13));
        __slots[1] := grid(5, 6, 33, 31, 42, 36, point(gameTabs.tabArea.x1 + 25, gameTabs.tabArea.y1 + 50 + 13));

    This should add the correct offsets with new oldschool layout.
    Please try this and report back.
    Awesome, the fixes you suggested appear to fix all my issues. tabBackpack.isFUll works as well as the correct isItemInSlot checks. really appreciate it man. Of note if you dont have 3 or 4 tabs open the ribbons change size and the backpack functions no longer work. no issue for me but just general knowledge for others reading the thread.

  8. #8
    Join Date
    May 2012
    Posts
    499
    Mentioned
    23 Post(s)
    Quoted
    228 Post(s)

    Default

    Quote Originally Posted by nkd2009 View Post
    Awesome, the fixes you suggested appear to fix all my issues. tabBackpack.isFUll works as well as the correct isItemInSlot checks. really appreciate it man. Of note if you dont have 3 or 4 tabs open the ribbons change size and the backpack functions no longer work. no issue for me but just general knowledge for others reading the thread.
    For me it works correctly both with only backpack gametab open and with multiple gametabs open?

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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