Results 1 to 7 of 7

Thread: Login Players

  1. #1
    Join Date
    Jul 2007
    Location
    UK
    Posts
    307
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default Login Players

    I Had to edit LoginPlayers; for a Tutorial Runner just wanted to know if I didet miss out anything major (Apart from the fact that searching for click here to play has been deleted)

    SCAR Code:
    procedure LoginPlayerSRL;
    var
      tx, ty, CHx, CHy, c, tmpMask, LastPlayer: Integer;
    begin
      if (not (LoggedIn)) then
      begin
        // Beginning player not active...
        if (not (Players[CurrentPlayer].Active)) then
        begin
          WriteLn('Current player is not Active...');
          LastPlayer := CurrentPlayer;
          repeat
            CurrentPlayer := Random(HowManyPlayers);
            Wait(100);
          until (Players[CurrentPlayer].Active);
          LoginPlayerSRL;
          Exit;
        end;
        x := 150;
        y := 173;
        if (FindClient) then
          FindWindowBySize(766, 504);
        ActivateClient;
        Wait(1000);
        ClickOption('Cancel', 1);
        ClickOption('Exist', 1);
        tmpMask := CreateBitmapMaskFromText('Username', upchars);
        if (FindBitmapMaskTolerance(tmpMask, x, y, 0, 0, 520, 340, 10, 50)) then
        begin
          Wait(25 + Random(50));
          Mouse(x + 24, y + 3, 3, 0, True);
          Wait(25 + Random(50));
          //SendKeysSilent(Players[CurrentPlayer].Name + chr(13) + Players[CurrentPlayer].Pass)
          WriteLn(Players[CurrentPlayer].Name);
          TypeSend(Players[CurrentPlayer].Name);
          Wait(100 + Random(100));
          Mouse(327, 272, 0, 0, True);
          TypeSend(Players[CurrentPlayer].Pass);
          Wait(100 + Random(100));
        end;
        ClickOption('Login', 1);
        // Waiting for Connecting to Server...
        MarkTime(Mark);
        while FindText(tx, ty, '...', upchars, 240, 180, 530, 240) do
        begin
          Wait(100);
          if TimeFromMark(Mark) > 20000 then Break;
        end;
        MarkTime(Mark);
        repeat
          Wait(1000);
          // Enter your username and password. If all failed...
          if FindText(tx, ty, 'nter you', upchars, 240, 180, 530, 240) then
          begin
            WriteLn('Enter your username and Password');
            LoginPlayerSRL;
            FreeBitmap(tmpMask);
            Exit;
          end else
          // Your account is already logged in.
          if FindText(tx, ty, 'lready', upchars, 240, 180, 530, 240) then
          begin
            WriteLn('Your account is already logged in');
            LastPlayer := CurrentPlayer;
            repeat
              CurrentPlayer := Random(HowManyPlayers);
              Wait(100);
            until (Players[CurrentPlayer].Active) and (CurrentPlayer <> LastPlayer);
            LoginPlayerSRL;
            FreeBitmap(tmpMask);
            Exit;
          end else
          // Invalid Username. 3 attempts. If fails, you haven't set your username/pass correct
            if FindText(tx, ty, 'nvalid', upchars, 240, 180, 530, 240) then
            begin
              WriteLn('Invalid Username.');
              SRL_Attempts := SRL_Attempts + 1;
              if SRL_Attempts > 3 then
              begin
                Players[CurrentPlayer].loc := 'L/P ERROR';
                NextPlayer(False);
              end;
              LoginPlayerSRL;
              FreeBitmap(tmpMask);
              Exit;
            end else
          // Login attempts exceeded. Please wait 1 minute and try again.
              if FindText(tx, ty, 'excee', upchars, 240, 180, 530, 240) then
              begin
                WriteLn('Login attempts exceeded. Please wait 1 minute and try again.');
                Wait(60000);
                LoginPlayerSRL;
                FreeBitmap(tmpMask);
                Exit;
              end else
          // World is full.
                if FindText(tx, ty, 'full', upchars, 240, 180, 530, 240) then
                begin
                  WriteLn('World is full.');
                  Wait(3000);
                  LoginPlayerSRL;
                  FreeBitmap(tmpMask);
                  Exit;
                end else
          // Unable to connect. Login Server offline.
                  if FindText(tx, ty, 'offl', upchars, 240, 180, 530, 240) then
                  begin
                    WriteLn('Unable to connect Login Server offline.');
                    Wait((6000) + Random(6000));
                    LoginPlayerSRL;
                    FreeBitmap(tmpMask);
                    Exit;
                  end else
          // Error Connecting.
                    if FindText(tx, ty, 'rror', upchars, 240, 180, 530, 240) then
                    begin
                      WriteLn('Error Connecting.');
                      Wait(10000);
                      LoginPlayerSRL;
                      FreeBitmap(tmpMask);
                      Exit;
                    end else
          // Error loading your profile. Will attempt to re-login 5 more times.)
                      if FindText(tx, ty, 'ontact', upchars, 240, 180, 530, 240) then
                      begin
                        WriteLn('Error loading your profile.');
                        Wait(2000);
                        LoginPlayerSRL;
                        FreeBitmap(tmpMask);
                        Exit;
                      end else
          // Login server rejected session.
                        if FindText(tx, ty, 'reject', upchars, 240, 180, 530, 240) then
                        begin
                          WriteLn('Login server rejected session.');
                          Wait(1000);
                          LoginPlayerSRL;
                          FreeBitmap(tmpMask);
                          Exit;
                        end else
          // Runescape has been updated.
                          if FindText(tx, ty, 'reload', upchars, 240, 180, 530, 240) then
                          begin
                            WriteLn('ERROR. RuneScape has been updated. Script Terminated.');
                            FreeBitmap(tmpMask);
                            TerminateScript;
                          end;
          // The Server is being updated. Please wait 1 minute.
          if FindText(tx, ty, 'updat', upchars, 240, 180, 530, 240) then
          begin
            WriteLn('The Server is being updated.');
            Wait(60000);
            LoginPlayerSRL;
            FreeBitmap(tmpMask);
            Exit;
          end else
          // Your account has been disabled.
            if FindText(tx, ty, 'disabled', upchars, 420, 180, 500, 220) then
            begin
              WriteLn('Your account has been disabled');
              Players[CurrentPlayer].loc := 'DISABLED';
              NextPlayer(False);
              FreeBitmap(tmpMask);
              Exit;
            end else
          // Waiting for Profile to be Transferred
              if FindText(tx, ty, 'trans', upchars, 240, 180, 530, 240) then
              begin
                WriteLn('Waiting for your Profile to be Transferred');
                Wait(2500);
              end else
          // You need a Members account...
                if FindText(tx, ty, 'member', upchars, 240, 180, 530, 240) then
                begin
                  WriteLn('You need a Members account...');
                  Players[CurrentPlayer].loc := 'Non-Member';
                  NextPlayer(False);
                  FreeBitmap(tmpMask);
                end else
          // Welcome to RuneScape. If all failed...
                  if FindText(tx, ty, 'elcom', upchars, 240, 180, 530, 240) then
                  begin
                    WriteLn('Welcome.');
                    LoginPlayerSRL;
                    FreeBitmap(tmpMask);
                    Exit;
                  end;

          if TimeFromMark(Mark) > 180000 then
          begin
            WriteLn('three minutes have passed');
            WriteFileString(TheFile, Chr(13) + 'THREE MINUTES HAVE PASSED!!!' +
              Chr(13));
            if (FindClient) then
              FindWindowBySize(766, 504);
            ActivateClient;
            ClickOption('Cancel', 1);
            ClickOption('Exist', 1);
          end;
        until (LoggedIn);
      end;
      FreeBitmap(tmpMask);
      if LoggedIn then
      begin
        PlayerStartTime := (GetSystemTime div 1000); // PlayerStartTime
        if NickNameBMP <> 0 then
          FreeBitmap(NickNameBMP);
        NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick,
          upchars); // Screenname
        WriteFileString(TheFile, Chr(13) + UpperCase(Players[CurrentPlayer].Name) +
          Chr(13)); //* Save NAME to file
      end;
    end;

  2. #2
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    No, it seems like you have everything.. But why did you edit it?

  3. #3
    Join Date
    Jul 2007
    Location
    UK
    Posts
    307
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    When you first make account it dose not go on the "Account Details" bit (Click Here To Play Bit) it just goes right on to the tutorial

  4. #4
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Oh yeah, i forgot about that..

  5. #5
    Join Date
    May 2007
    Posts
    468
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    why not just compare it to the core's script?
    Originally Posted by YoHoJo
    I like hentai.

  6. #6
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by llamaman View Post
    why not just compare it to the core's script?
    That's what i did, and i didn't find anything missing...

  7. #7
    Join Date
    Jul 2007
    Location
    UK
    Posts
    307
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    yeah I did that but i could miss a failsafe that could go unnoticed or a important loop.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to set up your players.
    By Wizzup? in forum Outdated Tutorials
    Replies: 189
    Last Post: 04-06-2013, 06:00 AM
  2. login players and changing
    By macromacro123 in forum OSR Help
    Replies: 3
    Last Post: 03-02-2007, 01:19 AM
  3. players login out
    By macromacro123 in forum OSR Help
    Replies: 10
    Last Post: 03-01-2007, 10:56 PM

Posting Permissions

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