Results 1 to 10 of 10

Thread: Login.scar LoginPlayerToLob fix

  1. #1
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default Login.scar LoginPlayerToLob fix

    Just had to update where it checked to see if "Less Info" needed to be clicked as it was returning false positives after today's update.

    The MouseBox for the Login button was also changed in the update and that is now included in this fix as well.
    SCAR Code:
    function LoginPlayerToLob: Boolean;
    var
      Members, RetryLogin: Boolean;
      Actions: TVariantArray;
      T, Attempts: LongInt;
      TPA: TPointArray;
    label
      ProcStart;
    begin
      ActivateClient;
      Wait(100);
      TypeByte(vk_Escape);
      Wait(500);

             {Check for lobby screen already open/ already logged in}

      Result := ((LobbyScreen) or (LoggedIn));
      if (Result) then
        Exit;

                           {Check for active player.}

      if (not (Players[CurrentPlayer].Active)) then
      begin
        WriteLn('Player is not Active...');
        if (AllPlayersInActive) then
        begin
          WriteLn('All players not active!');
          Exit;
        end;
        NextPlayer(False);
        Exit;
      end;

                   {Wait for the client to finish loading.}

      T := GetSystemTime;
      repeat
        if (RSReady) then
          Break;
        if ((GetSystemTime - T) > 180000) then
        begin
          WriteLn('It has been 3 minutes and Runescape is not yet ready... Terminating.');
          TerminateScript;
        end;
        Wait(RandomRange(1000, 2000));
      until (False);
      WriteLn('Welcome to Runescape.');

                       {Click less info if needed.}

      if (not (SimilarColors(GetColor(382, 11), 14285562, 15))) then //Runescae sword green bead
      begin
        MouseBox(212, 479, 550, 495, 1); //Less info button
        Wait(RandomRange(1000, 2000));
      end;

                          {Click Members/free.}

      Members := Players[CurrentPlayer].Member;
      if (Length(Players[CurrentPlayer].WorldInfo) > 0) then
        Members := Players[CurrentPlayer].WorldInfo[0];

      ProcStart:

      if (GetColor(248, 359) <> 1381653) then //Black outline on forgotten pwd button.
      begin

        if (Members) then
          MouseBox(482, 420, 648, 447, 1) //Member's login button
        else
          MouseBox(299, 421, 463, 447, 1); //Free's login button

        T := GetSystemTime;                  //Black outline on forgotten pwd button.
        while ((GetSystemTime - T < 3000) and (GetColor(248, 359) <> 1381653)) do
          Wait(RandomRange(100, 200));

      end;

                           {Type in username}

      FindColors(TPA, clWhite, 255, 216, 511, 236);
      if (Length(TPA) > 0) then
      begin
        SortTPAFrom(TPA, Point(501, 225));
        Mouse(TPA[0].X + 20, TPA[0].Y, 5, 5, True);
      end
      else
        MouseBox(254, 216, 440, 234, 1); //Username box
      while (CountColor(16777215, 255, 215, 385, 230) > 0) do
      begin
        TypeByte(VK_BACK);
        Wait(50+Random(50));
      end;
      Wait(100 + Random(200));
      WriteLn(Capitalize(Players[CurrentPlayer].Name));
      TypeSend(Players[CurrentPlayer].Name);
      Wait(100 + Random(50));

                           {Type in password}

      while (CountColor(16777215, 255, 270, 385, 285) > 0) do
      begin
        TypeByte(VK_BACK);
        Wait(50 + Random(50));
      end;
      Wait(100 + Random(200));
      TypeSend(Players[CurrentPlayer].Pass);
      Wait(500 + Random(300));

                            {Check responses}

      T := GetSystemTime;
      repeat

        SetLength(Actions, 0);

        if ((GetSystemTime - T) > 60000) then
          Actions :=       ['One minute has passed...',              0,    0,    'PlayerFalse',   'Login Failed']
        else
        case (CountColor(16777215, 253, 170, 510, 290)) of //text colour points
                            // WriteLn Error                  Wait for   Retrys     Action      Player[CurrentPlayer].Loc
          949: Actions :=  ['Invalid Username / Password',           0,    2,    'PlayerFalse',   'Wrong User/Pass'];
          1222: Actions := ['Error Connecting.',                 20000,    9,    'Terminate',     'Error Connecting'];
          1316: Actions := ['Runescape has been updated.',           0,    0,    'Terminate',     'RS updated'];
          1506: Actions := ['Your account is already logged in',  5000,    0,    'PlayerTrue',    'Already logged in'];
          1608: Actions := ['Not a Members Account',                 0,    1,    'PlayerTrue',   ''];
          1610: Actions := ['Too many incorrect logins.',    5 * 60000,    2,    'PlayerFalse',    'Too many logins'];
          1994: Actions := ['Your account has been disabled',        0,    0,    'PlayerFalse',   'Acc Disabled'];
        end;
                                 {Respond}

        if (Length(Actions) > 0) then
        begin
          WriteLn(Actions[0]);
          if (Actions[0] <> 'Not a Members Account') then
          begin
            Wait(1000 + Random(500));
            TypeByte(vk_Escape);
          end;
          Wait(Actions[1] + Random(100));
          if (Actions[2] <> 0) then
            if (Attempts < Actions[2]) or (Actions[2] = -1) then
            begin
              if (Actions[0] = 'Not a Members Account') then
              begin
                Players[CurrentPlayer].Member := False;
                if (Length(Players[CurrentPlayer].WorldInfo) > 0) then
                  Players[CurrentPlayer].WorldInfo[0] := False;
                MouseBox(267, 321, 496, 350, 1); //Play free game instead button
                Wait(3000 + Random(2000));
                Result := True;
                Exit;
              end;
              RetryLogin := True;
              Wait(2000 + Random(1000));
              Break;
            end;
          if (Actions[4] <> '') then
            Players[CurrentPlayer].Loc := Actions[4];
          case Actions[3] of
            'PlayerFalse': NextPlayer(False);
            'PlayerTrue': NextPlayer(True);
            'Terminate': TerminateScript;
          end;
          Exit;
        end;
        Wait(100);
        Result := (LobbyScreen) or (LoggedIn);
      until (Result);

                         {Back to main screen if needed}

      if (RetryLogin) then
      begin
        RetryLogin := False;
        Inc(Attempts);
        goto ProcStart;
      end;

    end;
    Last edited by NCDS; 05-13-2010 at 01:46 PM.

  2. #2
    Join Date
    Mar 2008
    Posts
    19
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks mate

  3. #3
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    Comitted
    Verrekte Koekwous

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

    Default

    lol, ray just beat me to it.

    "Commit" -> File out of date -> wtf? -> show log -> raymond

    ~RM

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

  5. #5
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Rasta Magician View Post
    lol, ray just beat me to it.

    "Commit" -> File out of date -> wtf? -> show log -> raymond

    ~RM
    Winnor
    Verrekte Koekwous

  6. #6
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Committed the MouseBox fix also.

  7. #7
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    Committed the MouseBox fix also.
    That would be you first commit to SRL, congrats!
    Verrekte Koekwous

  8. #8
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by mastaraymond View Post
    That would be you first commit to SRL, congrats!
    Why thank you mastaraymond!

  9. #9
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Thanks guys

  10. #10
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by NCDS View Post
    Thanks guys
    No, thank you.

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
  •