Page 2 of 2 FirstFirst 12
Results 26 to 31 of 31

Thread: tabBackpack.isOpen

  1. #26
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Quote Originally Posted by Gunner View Post
    OK I'll give that a shot again. What was line 365 supposed to say? I just copied and pasted from github after I updated everything.

    My last attempt at updating was a clean install, then force a simba update, then update srl and sps. Pasted github, saved, closed and reopened simba. Am I doing something incorrect?

    Thanks for the help so far.
    can you like, pastebin me your gametabs.simba file?

  2. #27
    Join Date
    Dec 2011
    Posts
    266
    Mentioned
    16 Post(s)
    Quoted
    185 Post(s)

    Default

    Quote Originally Posted by Olly View Post
    can you like, pastebin me your gametabs.simba file?
    It looks like gametabs.simba was updated twice today if I'm reading the thread correctly? My gametabs file was 721 lines, and the gametabs file currently on github is 724 lines. I think what may have happened is I downloaded the previous fix from github, perhaps right before you updated it again? IDK for sure but the times listed on github and the times of my original posts on the script thread are right on top of each other. Regardless, I for sure now have the newest gametabs.simba file, the bot is clicking the correct inv slots now, but it's a little fast and sometimes clicks before the bank window closes, but I think that is a script issue, not a bot issue. So here is my current code for my gametabs.simba file.

    Code:
    (*
    Gametab
    =======
    
    The gametab file holds any global gametab data.
    
    The source for this file can be found `here <https://github.com/SRL/SRL-6/blob/master/lib/interfaces/gametabs/gametab.simba>`_.
    
    *)
    
    {$include_once ../interfaces.simba}
    {$include_once ../../core/text.simba}
    
    {$f-}
    
    
    const
      NAV_BUTTON_HERO = 0;
      NAV_BUTTON_GEAR = 1;
      NAV_BUTTON_POWERS = 2;
      NAV_BUTTON_SOCIAL = 3;
      NAV_BUTTON_OTHER = 4;
    
    (*
    Constant: Tabs
    ~~~~~~~~~~~~~~
    
    Integer constants that represent each gametab. DO NOT change values unless you
    know exactly what you're doing. Each value represents a box in a grid. The
    grid starts at the top left at 0, and counts across the rows and ends in the
    bottom right of the grid.
    
    Example:
    
    .. code-block:: pascal
    
        gameTabs.openTab(TAB_FRIENDS);
    *)
    const
      TAB_TASK = 0;
      TAB_STATS = 1;
    
      TAB_BACKPACK = 2;
      TAB_EQUIPMENT = 3;
    
      TAB_PRAYER = 4;
      TAB_MAGIC = 5;
      TAB_MELEE = 6;
      TAB_RANGED = 7;
      TAB_DEFENSIVE = 8;
    
      TAB_FRIENDS = 9;
      TAB_FRIENDS_CHAT = 10;
      TAB_CLAN_CHAT = 11;
    
      TAB_NOTES = 12;
      TAB_MUSIC = 13;
    
    {*
    type TRSGameTab
    ~~~~~~~~~~~~~~~
    
    Represents an individual gametab.
    *}
    type
      _TRSGameTab = record
        _bmp: integer; // bitmap of the tab (used for switching between tabs)
        _navBarID: integer; // the constant representing the nav bar
        _navBarBoxIndex: integer; // the index of the box of the nav bar (when it's moused over)
      end;
    
    (*
    type TRSGameTabs
    ~~~~~~~~~~~~~~~~
    
    A single type for manipulating the entire gametab system.
    *)
    type
      TRSGameTabs = record(TRSInterface)
        tabs: array of _TRSGameTab;
        isSetup: boolean;
        tabArea: TBox;
        __tabSelectionArea: TBox;
        navButtons: array [0..7] of TBoxArray;
      end;
    
    (*
    var gameTabs
    ~~~~~~~~~~~~
    
    An SRL global variable used to manipulate the gametabs in very general ways.
    
    Example:
    
    .. code-block:: pascal
    
        if (not gameTabs.isTabActive(TAB_BACKPACK)) then
          gameTabs.openTab(TAB_BACKPACK);
    *)
    var
      gameTabs: TRSGameTabs;
    
    {$IFNDEF CODEINSIGHT}
    procedure TRSGameTabs.__init();
    begin
      with self do
      begin
        name := 'RS GameTabs (Navigation)';
        ID := ID_INTERFACE_GAMETABS;
        parentID := -1;
        static := false;
        tabArea := [576, 292, 799, 599];
        __tabSelectionArea := [581, 296, 796, 319];
        isSetup := false;
    
        // TBox[0] is the actual button, the the next are the tab buttons when it's mouse-over'd
        self.navButtons[NAV_BUTTON_HERO] := grid(1, 3, 27, 27, 50, 36, point(612, 220));
        self.navButtons[NAV_BUTTON_GEAR] := grid(1, 3, 27, 27, 50, 36, point(662, 220));
        self.navButtons[NAV_BUTTON_POWERS] := grid(1, 6, 27, 27, 50, 36, point(762, 220));
        self.navButtons[NAV_BUTTON_SOCIAL] := grid(1, 4, 27, 27, 50, 36, point(612, 258));
        self.navButtons[NAV_BUTTON_OTHER] := grid(1, 3, 27, 27, 50, 36, point(762, 258));
      end;
    end;
    {$ENDIF}
    
    {*
    TRSGameTabs.__initTabs
    ~~~~~~~~~~~~~~~~~~~~~~
    
    .. code-block:: pascal
    
        procedure TRSGameTabs.__initTabs();
    
    Inits the gametabs, loads the bitmap, nav button ID and finally the nav box index.
    
    .. note::
    
        - by Coh3n
        - Last Updated: 26 July 2013 by Coh3n
    
    Example:
    
    .. code-block:: pascal
    
        addOnTerminate('__freeGameTabs');
    *}
    {$IFNDEF CODEINSIGHT}
    procedure TRSGameTabs.__initTabs();
    var
      i: integer;
    begin
      setLength(self.tabs, 14);
    
      with self.tabs[TAB_TASK] do
      begin
        _bmp := bitmapFromString(10, 4, 'meJyz+vje6uN7hdhGNWU5RwtNIHKx1bczVQciNzsDK7Cs9dmPfOFJUlKSElZO4kEREoEROhYOJnoqQHGIAr51d1jtgmWqJsNFZLx9gYJwLs/EnUAFIJGVJ8X8Q7W15QE4lDKB');
        _navBarId := NAV_BUTTON_HERO;
        _navBarBoxIndex := 2;
      end;
    
      with self.tabs[TAB_STATS] do
      begin
        _bmp := bitmapFromString(6, 7, 'meJyzsXgszPtBXVU9fg1nwjoQsrF4zMU5V91UBMIFIqACfqF003QOZBE+Ad2sZEG4CDvnCVUToYS1UG5OqgAvT72KMUKBSTaboJi/STo7XETFRBAAw3ol8A==');
        _navBarId := NAV_BUTTON_HERO;
        _navBarBoxIndex := 1;
      end;
    
      with self.tabs[TAB_BACKPACK] do
      begin
        _bmp := bitmapFromString(3, 8, 'meJxTss0x7d3Co2xpndScv+dpUudq/drpSrY5FrnrgSL8YkHCMrlABlANUAoo7lo5JWHDYaA4J58akARqBCIgAwC+OReT');
        _navBarId := NAV_BUTTON_GEAR;
        _navBarBoxIndex := 1;
      end;
    
      with self.tabs[TAB_EQUIPMENT] do
      begin
        _bmp := bitmapFromString(3, 12, 'meJzrbKrpbKpJTEnuhDG6+ycvXjIbIrJoYmdRRTWQDWQABYFsIMNSVw8oAmQrKagBGRA2BEG4QI1wE4CM+EhvIANoLADLWjI8');
        _navBarId := NAV_BUTTON_GEAR;
        _navBarBoxIndex := 2;
      end;
    
      with self.tabs[TAB_PRAYER] do
      begin
        _bmp := bitmapFromString(6, 6, 'meJx7dWHxqwuLP15d8fHayudnF947Ovv52UVfPr6EoM8fXjw+NR8oC+L++QtEQBGgyg+oIu+vLAcq+/T+OZAN0fjszIJbB6c/Ojnv47UVH64uf3p6ARABALyyXGE=');
        _navBarId := NAV_BUTTON_POWERS;
        _navBarBoxIndex := 1;
      end;
    
      with self.tabs[TAB_MAGIC] do
      begin
        _bmp := bitmapFromString(4, 10, 'meJxb6CS4EIxqbXmvpIsCyYVIIsgkEDlqcEHYsSY8QNI6qVlTnAvITnHVM+3dIiyTa2A/OalztWxCJ79YEJCdkXdFziqIj4tfXtXCUlcPYghQPRABAE1GIYc=');
        _navBarId := NAV_BUTTON_POWERS;
        _navBarBoxIndex := 2;
      end;
    
       with self.tabs[TAB_MELEE] do
      begin
        _bmp := bitmapFromString(4, 4, 'meJwTF+ScPnnKlz9/Fzz/PmfdFiBjz4mbSanJSbfeZfz4BWS42RtbrzzFNXW3S1SqmCAnANE4Gm4=');
        _navBarId := NAV_BUTTON_POWERS;
        _navBarBoxIndex := 3;
      end;
    
      with self.tabs[TAB_RANGED] do
      begin
        _bmp := bitmapFromString(2, 8, 'meJyzyFmrpaEpm9CpbBrEbZfNY+HGLxYkoGgAZCuaugFJUUlXYZlcISEDJdscfn4+ABAACfE=');
        _navBarId := NAV_BUTTON_POWERS;
        _navBarBoxIndex := 4;
      end;
    
      with self.tabs[TAB_DEFENSIVE] do
      begin
        _bmp := bitmapFromString(9, 4, 'meJxLTEkuqqh2dbBkZc2zsXg8YeKtXafufv75G0gmpiR3908GSvGLBRnYT87IuwKXBUotXjIbSAKlgBqBskmdq+umrQYqAApCEEQKiIRlcoEKgIYDAA/lL/8=');
        _navBarId := NAV_BUTTON_POWERS;
        _navBarBoxIndex := 5;
      end;
    
      with self.tabs[TAB_FRIENDS] do
      begin
        _bmp := bitmapFromString(8, 8, 'meJyrm7a6btrqaftuAVF5x0QLjzTWthimrfVwwajKydUrjwK58lZWQCkgA8KFKJi69wazJCd7tHVS52oIgsg6ufiyeOqwFToC2UATQKi4Rs4qCGI4UNy1cgpEPVwQSALFtcIzlGxzrJOageJALlAQgoB2zVm7FaieR9kSaB1EMRABAFrsUf8=');
        _navBarId := NAV_BUTTON_SOCIAL;
        _navBarBoxIndex := 1;
      end;
    
      with self.tabs[TAB_FRIENDS_CHAT] do
      begin
        _bmp := bitmapFromString(6, 8, 'meJwzmnLCaMqJ1Pf/THu3sEiKsbbFWH18b7n5qfXZj/xiQYwMDOzR1tan3gJF9GunM5ubsBU6AtUAZWWqJnNEZQDZTFvrgYJABXAukAQioIhsQidQO4QL0rXyFI+yJUQEqAWIgGYCrQAaCxSEIADzcDIO');
        _navBarId := NAV_BUTTON_SOCIAL;
        _navBarBoxIndex := 2;
      end;
    
      with self.tabs[TAB_CLAN_CHAT] do
      begin
        _bmp := bitmapFromString(7, 9, 'meJyzPvtRv3a6bEIn+9WvQMQzcSdz9STrladS3/+zTmrmiMrgW3cHKMJubmy5+SlQnJGdj9UuGCgCRKzmxkARoBogG6IMJJjWLFM1GcgFmgYXBCKgFUAuBEFsASKgSiAJ5MJFQCbAzIeYBkRAKyD2AhnICADvyUfz');
        _navBarId := NAV_BUTTON_SOCIAL;
        _navBarBoxIndex := 3;
      end;
    
      with self.tabs[TAB_NOTES] do
      begin
        _bmp := bitmapFromString(8, 6, 'meJxziUr9/PM3BD25cwNI7nv9rXrlUUYGBicXXyAbIgJBQHZ5x0SglLyV1a5Td4Ei818gpOqmrYbomrbvFlwLRAHQQCXbnNRpp5DFIQioOGHDYbg5AP/SZ+c=');
        _navBarId := NAV_BUTTON_OTHER;
        _navBarBoxIndex := 1;
      end;
    
      with self.tabs[TAB_MUSIC] do
      begin
        _bmp := bitmapFromString(6, 8, 'meJyb/+Jb3bTVTi6+LlGpUZWTkzpXT9t3C8gWExOSV7UAknxc/NUrjwJFgCRQCiILVAkk57/4tu81CEUV1wBVAgWBIkAFQAOBsvJWVkA2UJeSghojAwNQDcQEiAhQPZABQfl7nkIYQO0ANDdHLQ==');
        _navBarId := NAV_BUTTON_OTHER;
        _navBarBoxIndex := 2;
      end;
    
      self.isSetup := true;
      addOnTerminate('__freeGameTabs');
    
      for i := 0 to high(self.tabs) do
        setBitmapName(self.tabs[i]._bmp, 'Gametab Bitmap['+toStr(i)+']');
    
      print('TRSGameTab.__initTabs(): Setup gametab properties', TDebug.SUB);
    end;
    {$ENDIF}
    
    {*
    __freeGameTabs
    ~~~~~~~~~~~~~~
    
    .. code-block:: pascal
    
        procedure __freeGameTabs();
    
    Frees all the gametab's bitmaps. Called on script termination.
    
    .. note::
    
        - by Coh3n
        - Last Updated: 26 July 2013 by Coh3n
    
    Example:
    
    .. code-block:: pascal
    
        addOnTerminate('__freeGameTabs');
    *}
    {$IFNDEF CODEINSIGHT}
    procedure __freeGameTabs();
    var
      i: integer;
    begin
      print('Freeing gametabs bitmaps...');
    
      for i := 0 to high(gameTabs.tabs) do
        freeBitmap(gameTabs.tabs[i]._bmp);
    end;
    {$ENDIF}
    
    (*
    TRSGameTabs.getActiveTabArea
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    .. code-block:: pascal
    
        function TRSGameTabs.getActiveTabArea(): TBox;
    
    Returns the TBox of the active tab, will return a nil box if no tabs are active.
    
    .. note::
    
        - by Coh3n
        - Last Updated: 26 July 2013 by Coh3n
    
    Example:
    
    .. code-block:: pascal
    
        if (gameTabs.areMultiOpen()) then
          writeln('Multiple tabs are open');
    *)
    function TRSGameTabs.getActiveTabArea(): TBox;
    const
      COLOR_ACTIVE_TAB = 7037013;
    var
      b: TBox;
      tpa: TPointArray;
    begin
      if (not self.isSetup) then
        self.__initTabs();
    
      b := [gameTabs.__tabSelectionArea.x1, gameTabs.__tabSelectionArea.y1, // top of each gametab area
            gameTabs.__tabSelectionArea.x2, gameTabs.__tabSelectionArea.y1 + 5];
    
      result := [-1, -1, -1, -1];
    
      if (findColors(tpa, COLOR_ACTIVE_TAB, b)) then
      begin
        result := tpa.getBounds();
        incEx(result.y2, 20);
      end;
    end;
    
    (*
    TRSGameTabs.areMultiOpen
    ~~~~~~~~~~~~~~~~~~~~~~~~
    
    .. code-block:: pascal
    
        function TRSGameTabs.areMultiOpen(): boolean;
    
    Returns true if more than one tab is open.
    
    .. note::
    
        - by Coh3n
        - Last Updated: 26 July 2013 by Coh3n
    
    Example:
    
    .. code-block:: pascal
    
        if (gameTabs.areMultiOpen()) then
          writeln('Multiple tabs are open');
    *)
    function TRSGameTabs.areMultiOpen(): boolean;
    var
      b: TBox;
    begin
      b := self.getActiveTabArea();
      result := (b.x1 > -1) and (b.y1 > -1) and (b.x2 > -1) and (b.y2 > -1);
    end;
    
    (*
    TRSGameTabs.getTabAreas
    ~~~~~~~~~~~~~~~~~~~~~~~
    
    .. code-block:: pascal
    
        function TRSGameTabs.getTabAreas(): TBoxArray;
    
    Returns a TBoxArray of all the gametab tab boxes.
    
    .. note::
    
        - by Coh3n
        - Last Updated: 26 July 2013 by Coh3n
    
    Example:
    
    .. code-block:: pascal
    
        if (gameTabs.areMultiOpen()) then
          writeln('Multiple tabs are open');
    *)
    function TRSGameTabs.getTabAreas(): TBoxArray;
    const
      COLOR_NON_ACTIVE_TAB = 5458491;
    var
      i: integer;
      b, bounds: TBox;
      atpa: T2DPointArray;
      tpa: TPointArray;
    begin
      b := [gameTabs.__tabSelectionArea.x1, gameTabs.__tabSelectionArea.y1, // top of each gametab area
            gameTabs.__tabSelectionArea.x2, gameTabs.__tabSelectionArea.y1 + 5];
    
      if (findColors(tpa, COLOR_NON_ACTIVE_TAB, b)) then
      begin
        atpa := clusterTPAEx(tpa, 3, 1);
        filterTPAsBetween(atpa, 0, 5);
    
        if (length(atpa) > 0) then
          for i := 0 to high(atpa) do
          begin
            bounds := atpa[i].getBounds();
            incEx(bounds.y2, 20);
    
            insert(bounds, result);
          end;
      end;
    
      b := self.getActiveTabArea();
    
      if (b.x1 <> -1) then
        insert(b, result);
    end;
    
    (*
    TRSGameTabs._findTab
    ~~~~~~~~~~~~~~~~~~~~
    
    .. code-block:: pascal
    
        function TRSGameTabs._findTab(var p: TPoint; tab: integer; searchBox: TBox): boolean;
    
    Returns true if the gametab 'tab' is found in the 'searchBox'. Sets it's coordinates
    to 'p'.
    
    .. note::
    
        - by Coh3n
        - Last Updated: 26 July 2013 by Coh3n
    
    Example:
    
    .. code-block:: pascal
    
        if (gameTabs._findTab(p, TAB_BACKPACK, b)) then
        begin
          writeln('Opening the backpack tab');
          mouse(p.rand(5), MOUSE_LEFT);
        end;
    *)
    function TRSGameTabs._findTab(var p: TPoint; tab: integer; searchBox: TBox): boolean;
    begin
      if (not self.isSetup) then
        self.__initTabs();
    
      result := findBitmapToleranceIn(self.tabs[tab]._bmp, p.x, p.y, searchBox, 50);
    end;
    
    (*
    TRSGameTabs.isTabVisible
    ~~~~~~~~~~~~~~~~~~~~~~~~
    
    .. code-block:: pascal
    
        function TRSGameTabs.isTabVisible(tab: integer; out tabBounds: TBox): boolean;
    
    Searches for the gametab 'tab' to see if it's visible, if found will output the bounds
    in 'tabBounds'
    
    .. note::
    
        - by Olly
        - Last Updated: 21 November 2013 by Olly
    
    Example:
    
    .. code-block:: pascal
    
        writeln(gameTabs.isTabVisable(TAB_BACKPACK, b));
    *)
    function TRSGameTabs.isTabVisible(tab: integer; out tabBounds: TBox): boolean;
    var
      b: TBoxArray;
      p: TPoint;
      l, i: integer;
    begin
      b := self.getTabAreas();
      l := length(b);
    
      if (length(b) > 0) then
        for i := 0 to (l -1) do
          if (self._findTab(p, tab, b[i])) then
          begin
            tabBounds := b[i];
            exit(true);
          end;
    end;
    
    (*
    TRSGameTabs.isTabActive
    ~~~~~~~~~~~~~~~~~~~~~~~
    
    .. code-block:: pascal
    
        function TRSGameTabs.isTabActive(tab: integer): boolean;
    
    Returns true if the gametab 'tab' is active
    
    .. note::
    
        - by Olly
        - Last Updated: 21 November 2013 by Olly
    
    Example:
    
    .. code-block:: pascal
    
        writeln(gameTabs.isActiveTab(TAB_BACKPACK));
    *)
    function TRSGameTabs.isTabActive(tab: integer): boolean;
    var
      b: TBox;
      p: TPoint;
    begin
      b := self.getActiveTabArea();
    
      if (b.x1 = -1) then
        exit(false);
    
      result := self._findTab(p, tab, b);
    end;
    
    (*
    TRSGameTabs.waitTabActive
    ~~~~~~~~~~~~~~~~~~~~~~~~~
    
    .. code-block:: pascal
    
        function TRSGameTabs.waitTabActive(tab: integer; timeOut: integer): boolean;
    
    Waits up to 'timeOut' waiting for the gametab 'tab' to be the active tab
    
    .. note::
    
        - by Olly
        - Last Updated: 21 November 2013 by Olly
    
    Example:
    
    .. code-block:: pascal
    
        writeln(gameTabs.waitTabActive(TAB_BACKPACK, 1000));
    *)
    function TRSGameTabs.waitTabActive(tab: integer; timeOut: integer): boolean;
    var
      t: integer;
    begin
      result := false;
      t := (getSystemTime() + timeOut);
    
      while (t > getSystemTime()) do
      begin
        if (self.isTabActive(tab)) then
          exit(true);
    
        wait(20 + random(20));
      end;
    end;
    
    {*
    TRSGameTabs.__openViaNavBar
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    .. code-block:: pascal
    
        function TRSGameTabs.__openViaNavBar(tab: integer): boolean;
    
    Helper function for TRSGametabs.openTab(), Opens the tab via the navigation bar
    and moves the mouse to close the mouse-over menu.
    
    .. note::
    
        - by Olly
        - Last Updated: 21 November 2013 by Olly
    
    Example:
    
    .. code-block:: pascal
    
        gameTabs.__openViaNavbar(TAB_BACKPACK);
    *}
    {$IFNDEF CODEINSIGHT}
    function TRSGameTabs.__openViaNavBar(tab: integer): boolean;
    var
      p: TPoint;
      b: TBox;
    begin
      mouseBox(self.navButtons[self.tabs[tab]._navBarID][0], MOUSE_MOVE); // hover over the nav button
      wait(250 + random(250));
      mouseBox(self.navButtons[self.tabs[tab]._navBarID][self.tabs[tab]._navBarBoxIndex], MOUSE_LEFT, MOUSE_ACCURATE);
      wait(20 + random(200));
    
      b := self.navButtons[self.tabs[tab]._navBarID][0];
    
      if (random(2) = 1) then // move the mouse to the side so the menu closes
        p := point(b.x1 - 8 - random(5), b.y1 + randomRange(-10, 50))
      else
        p := point(b.x2 + 8 + random(5), b.y1 + randomRange(-10, 50));
    
      mouse(p);
    end;
    {$ENDIF}
    
    (*
    TRSGameTabs.openTab
    ~~~~~~~~~~~~~~~~~~~
    
    .. code-block:: pascal
    
        function TRSGameTabs.openTab(tab: integer): boolean;
    
    Will attempt to open the gametab 'tab'.
    
    .. note::
    
        - by Coh3n
        - Last Updated: 26 July 2013 by Coh3n
    
    Example:
    
    .. code-block:: pascal
    
        if (gameTabs._findTab(p, TAB_BACKPACK, b)) then
        begin
          writeln('Opening the backpack tab');
          mouse(p.rand(5), MOUSE_LEFT);
        end;
    *)
    function TRSGameTabs.openTab(tab: integer): boolean;
    var
      b: TBox;
    begin
      if (not inRange(tab, TAB_TASK, TAB_MUSIC)) then // check tab is vaild
      begin
        print('TRSGameTabs.openTab('+toStr(tab)+'): The tab isnt vaild!, result = '+toStr(result), TDebug.ERROR);
        exit(false);
      end;
    
      print('TRSGameTabs.openTab('+toStr(tab)+')', TDebug.HEADER);
    
      if (self.isTabActive(tab)) then
      begin
        print('Tab is already open, exiting');
        result := true;
        print('TRSGameTabs.openTab('+toStr(tab)+'): = '+toStr(result), TDebug.FOOTER);
        exit;
      end;
    
      if (self.areMultiOpen) then
        if (self.isTabVisible(tab, b)) then
        begin
          print('Tab is already visible, bringing to front');
          mouseBox(b, MOUSE_LEFT);
    
          wait(50 + random(100));
          result := true;
          print('TRSGameTabs.openTab('+toStr(tab)+'): = '+toStr(result), TDebug.FOOTER);
          exit;
        end;
    
      print('Opening tab via gametab navigation bar');
      self.__openViaNavBar(tab);
    
      result := self.waitTabActive(tab, 4000 + random(1000));
    
      print('TRSGameTabs.openTab('+toStr(tab)+'): result = '+toStr(result), TDebug.FOOTER);
    end;
    
    (*
    TRSGameTabs.getActiveTab
    ~~~~~~~~~~~~~~~~~~~~~~~~
    
    .. code-block:: pascal
    
        function TRSGameTabs.getActiveTab(): integer;
    
    Returns the active tab, returns the id of the constant
    
    .. note::
    
        - by Coh3n
        - Last Updated: 26 July 2013 by Coh3n
    
    Example:
    
    .. code-block:: pascal
    
        if (gameTabs.getActiveTab() = TAB_BACKPACK) then
          writeln('Backpack is open');
    *)
    function TRSGameTabs.getActiveTab(): integer;
    var
      b: TBox;
      i: integer;
      p: TPoint;
    begin
      result := -1;
      b := self.getActiveTabArea();
    
      if (b.x1 = -1) then
      begin
        print('TRSGametabs.getActiveTab(): There isn''t an active tab currently', TDebug.WARNING);
        exit;
      end;
    
      for i := 0 to high(self.tabs) do
        if (self._findTab(p, i, b)) then
          exit(i);
    
      print('TRSGametabs.getActiveTab(): Didn''t find any bitmap matches', TDebug.WARNING);
    end;
    
    begin
      gameTabs.__init();
    end;
    I really appreciate you taking the time all day to help me out, even though it looks like it was pretty much all on my end. I'll hit up Ashaman about the quick clicks and go from there. However if you do find something out of line in the code above let me know. Thanks again Olly.

  3. #28
    Join Date
    Feb 2012
    Location
    Canada
    Posts
    154
    Mentioned
    2 Post(s)
    Quoted
    34 Post(s)

    Default

    Quote Originally Posted by Gunner View Post
    It looks like gametabs.simba was updated twice today if I'm reading the thread correctly? My gametabs file was 721 lines, and the gametabs file currently on github is 724 lines. I think what may have happened is I downloaded the previous fix from github, perhaps right before you updated it again? IDK for sure but the times listed on github and the times of my original posts on the script thread are right on top of each other. Regardless, I for sure now have the newest gametabs.simba file, the bot is clicking the correct inv slots now, but it's a little fast and sometimes clicks before the bank window closes, but I think that is a script issue, not a bot issue. So here is my current code for my gametabs.simba file.

    I really appreciate you taking the time all day to help me out, even though it looks like it was pretty much all on my end. I'll hit up Ashaman about the quick clicks and go from there. However if you do find something out of line in the code above let me know. Thanks again Olly.
    I just copied and saved over the gamestab with this code (724 lines version) and now mine is working properly again too. I had just got home about 45 mins ago and tried manually updating SRL but had no luck, but now everything works fine.

  4. #29
    Join Date
    Dec 2011
    Posts
    266
    Mentioned
    16 Post(s)
    Quoted
    185 Post(s)

    Default

    Quote Originally Posted by Hadley View Post
    I just copied and saved over the gamestab with this code (724 lines version) and now mine is working properly again too. I had just got home about 45 mins ago and tried manually updating SRL but had no luck, but now everything works fine.
    Glad it's working for you. I'm still struggling with the script clicking too quickly while the inventory is still locked, but that should be easy enough to fix. At least now it's clicking the correct slots.

  5. #30
    Join Date
    Feb 2012
    Location
    Canada
    Posts
    154
    Mentioned
    2 Post(s)
    Quoted
    34 Post(s)

    Default

    Quote Originally Posted by Gunner View Post
    Glad it's working for you. I'm still struggling with the script clicking too quickly while the inventory is still locked, but that should be easy enough to fix. At least now it's clicking the correct slots.
    Locked as in your interface is locked or something else?

  6. #31
    Join Date
    Dec 2011
    Posts
    266
    Mentioned
    16 Post(s)
    Quoted
    185 Post(s)

    Default

    Quote Originally Posted by Hadley View Post
    Locked as in your interface is locked or something else?
    No, the lock that is over the inventory when the bank window is open. It hangs around for a couple milliseconds after the bank window closes, and the script is sometimes clicking on the inventory while it is still locked. So nothing actually happens until it re-opens the bank and tries again. About 50% of the time the lock gets out of the way before the script clicks.

Page 2 of 2 FirstFirst 12

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
  •