Results 1 to 3 of 3

Thread: funtion TabCoord(i: Integer): TBox;

  1. #1
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default funtion TabCoord(i: Integer): TBox;

    Place in SRL\SRL\core\Globals.scar - Line 89:
    SCAR Code:
    const
      //Bank screen edge points
      BSX1 = 25;
      BSX2 = 480;
      BSY1 = 85;
      BSY2 = 295;
      //Bank screen centre point
      BSCX = 252;
      BSCY = 190;
      //Bank screen tab edge points
      BTX1 = 25;
      BTX2 = 255;
      BTY1 = 50;
      BTY2 = 85;

    Place in SRL\SRL\core\Bank.scar - Line 28:
    SCAR Code:
    // * function TabCoord(i: Integer): TBox;                                      // * by Dan's The Man

    {*******************************************************************************
    function TabCoord(i: Integer): TBox;
    By: Dan's The Man
    Description: Returns a TBox in which bank tab I is situated.
    *******************************************************************************}

    function TabCoord(i: Integer): TBox;
    var
      bIX, bIY: Integer;
    begin
      bIX := 50 * (i - 1);
      Result.X1 := BTX1 + bIX + 5;
      Result.X2 := BTX1 + bIX + 10;
      Result.Y1 := BTY1 + 10;
      Result.Y2 := BTY2 - 10;
    end;

    Descriptions:
    The added constants in Globals.scar are as follows:
    Code:
    BSX1 == Bank Screen Top Left Corner (X Axis)
    BSX2 == Bank Screen Bottom Right Corner (X Axis)
    BSY1 == Bank Screen Top Left Corner (Y Axis)
    BSY2 == Bank Screen Bottom Right Corner (Y Axis)
    
    BSCX == Bank Screen Centre Point (X Axis)
    BSCY == Bank Screen Centre Point (Y Axis)
    
    BTX1 == Bank Tab Area Top Left Corner (X Axis)
    BTX2 == Bank Tab Area Bottom Right Corner (X Axis)
    BTY1 == Bank Tab Area Top Left Corner (Y Axis)
    BTY2 == Bank Tab Area Bottom Right Corner (Y Axis)
    The added function, TabCoord (situated in Bank.scar), returns a box which surrounds the specified bank tab (by local identifier I: Integer). To click on the specified tab, you could do the following:
    With MouseBox -
    SCAR Code:
    var
      TB: TBox;
    begin
      TB := TabCoord(6);
      MouseBox(TB.X1, TB.Y1, TB.X2, TB.Y2, 1);
    end.
    With Mouse -
    SCAR Code:
    var
      TB: TBox;
    begin
      TB := TabCoord(6);
      Mouse(TB.X1, TB.Y1, 4, 4, True);
    end.

    Both those examples above click on tab 6.

    This function has been tested thoroughly and works well
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  2. #2
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    And the use of it is... ?

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  3. #3
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    The globals are too specific to be made globals, but afaik this is already in srl?
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

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
  •