Results 1 to 4 of 4

Thread: Players.scar > LoggedIn

  1. #1
    Join Date
    Feb 2009
    Posts
    1,447
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default Players.scar > LoggedIn

    SCAR Code:
    {*******************************************************************************
    function LoggedIn: Boolean;
    By: TRiLeZ & IceFire908
    Description: Detects if you're logged in and compensates for white screen lag,
    general lag, and false detections.
    *******************************************************************************}


    function LoggedIn: Boolean;
    var
      I: Integer;
    begin
      for I:= 1 to 40 do
      begin
        Result := (GetColor(567, 135) = 9288161);
        if (not Result) then
        begin
          if (GetColor(745, 93) = 3102893) then
          begin
            Result := False;
            Exit;
          end;
          Wait(500);
        end else
        Exit;
      end;
    end;

    This function checks if your loggedin, if a color from ingame isnt on the screen at one point, the function then checks if your on the login screen. If your on the login screen, the result is false, if your not then theirs a white screen or some lag, and will wait 500 ms then do the checks again and again until your ingame or on the login screen.

    If your not on either after 20 seconds of this function being called, this function will end and the result will be false.

    This function is very usefull. Before I made this, when my comp lag'd or when I brought up the smart screen resulting in a white screen (for ~2 seconds), SCAR would think Im logged out and the script would go to the next player or terminate.

    Now my scripts I have runs forever with this function That is until a random comes and SRL fails to solve it.
    Last edited by TRiLeZ; 08-26-2009 at 01:02 PM. Reason: 20 seconds instead of 10

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

    Default

    This is almost what I have been using!
    SCAR Code:
    function m_loggedin: boolean;
    var
      i: integer;
    begin
      for i := 0 to 19 do
        if loggedin then
        begin
          result := true;
          exit;
        end else
          wait(500);
    end;

  3. #3
    Join Date
    Feb 2009
    Posts
    1,447
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    So is this going to be added to the svn?
    It is really usefull especially for smart users.
    Without it, scripts wont run their full potential.

  4. #4
    Join Date
    May 2007
    Location
    NSW, Australia
    Posts
    2,823
    Mentioned
    3 Post(s)
    Quoted
    25 Post(s)

    Default

    Your not the only one that posted something like this.

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
  •