Results 1 to 16 of 16

Thread: LoginPlayer Re-written

  1. #1
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default LoginPlayer Re-written

    Just like SRL's. Instead of UpChars its statchars. I updated it.

    Enjoy:

    SCAR Code:
    Function LoginPlayerX : boolean;
    Label Check;
    Var
      TriesXX : Integer;
      Options : TStringArray;
      Actions : TVariantArray;
      I : Integer;
      OneActive : Boolean;
      LastPlayer : Integer;

    begin
      Result := False;
      OneActive := False;
      if LoggedIn = False then
      begin;
        if (not (Players[CurrentPlayer].Active)) then
        begin;
          WriteLn('Current player is not Active...');
          Repeat
            For I := 0 to HowManyPlayers - 1 do
              if players[I].Active = true then
                OneActive := True;
            if OneActive = True then
              Break;
            Wait(60000);
          until false
        end
     else
      Begin
        MouseBox(337, 162, 425, 177, 1);
          Repeat
            Wait(100+Random(200));
          Until(GetColor(364, 260) = 6063521);
         MMouse(364, 260, 14, 4);
          TypeSend(Players[CurrentPlayer].Name);
         MMouse(374, 327, 15, 5);
          TypeSend(Players[CurrentPlayer].Pass);
         Begin
           MouseBox(342, 356, 408, 374, 1);
             Repeat
               Wait(300+Random(400));
               TriesXX := TriesXX + 1;
             Until(GetColor(11, 25) = 24577) Or (TriesXX > 60);
           If TriesXX > 60 Then Goto Check
          else
            Wait(2000+Random(3000));
            Mouse(377, 352, 100, 10, True);
            Wait(2000+Random(3000));
            WriteLn('Sucessfully LoggedIn!');
          end;
        end;

    Check : Options := ['nter your','already','nvalid','excee','full','offl','rror','ontact','reject','reload',
                        'updat','disabled','member','incorrect'];

           For I := 0 to High(Options) do
              If FindTextTpa(12509695, 10, 279, 182, 482, 222, Options[I], StatChars, Nothing) Then
                begin;
                  OneActive := True;
                  Break;
                end;
              If OneActive Then
                Begin
                 SetLength(Actions,2);
                    Case Options[I] of
                          'reload'   : begin;   //Runescape updated
                                         WriteLn('ERROR. RuneScape has been updated. Script Terminated.');
                                         Terminatescript;
                                       end;
                          'disabled' : begin;  //Your account has been disabled..
                                         WriteLn('Your account has been disabled');
                                         Players[CurrentPlayer].loc := 'DISABLED';
                                         NextPlayer(False);
                                         Exit;
                                       end;
                          'member'   : begin;        // You need a Members account...
                                         WriteLn('You need a Members account...');
                                         Players[CurrentPlayer].loc := 'Non-Member';
                                         NextPlayer(False);
                                         exit;
                                       end;
                          'already'  : begin //Account already logged in
                                         Actions := ['Your account is already logged in',0];
                                         LastPlayer := CurrentPlayer;
                                         repeat
                                           CurrentPlayer := (CurrentPlayer + 1) mod HowManyPlayers;
                                           Wait(200);
                                         until (Players[CurrentPlayer].Active) and (CurrentPlayer <> LastPlayer);
                                       end;
                          'nvalid'   : begin;// Invalid Username. 3 attempts. If fails, username/pass incorrect
                                         Actions := ['Invalid Username \ Password',0];
                                         Inc(SRL_Attempts);
                                         if SRL_Attempts > 3 then
                                         begin;
                                           Players[CurrentPlayer].Loc := 'Login ERROR';
                                           SRL_Attempts := 0;
                                           Nextplayer(False);
                                           Exit;
                                         end;
                                       end;
                          'excee'    : Actions := ['Login attempts exceeded. Please wait 1 minute and try again.',60000];
                          'offl'     : Actions := ['Unable to connect Login Server offline.',(20000) + Random(6000)]; // Unable to connect. Login Server offline.
                          'nter your': Actions := ['Enter your username and password',0];//Login failed
                          'full'     : Actions := ['World is full.',5000]; //World is full =]
                          'rror'     : Actions := ['Error Connecting.',10000]; //Error, connection timed out?
                          'ontact'   : Actions := ['Error loading your profile.',2000]; // Error loading your profile. Will attempt to re-login 5 more times.)
                          'reject'   : Actions := ['Login server rejected session.',1000];  // Login server rejected session.
                          'updat'    : Actions := ['The Server is being updated.',60000]; // The Server is being updated. Please wait 1 minute.
                          'incorrect': Actions := ['To many incorrect logins.',60000 * 5]; //Wrong logins baby.
                        end;
                     end;
              If LoggedIn Then
                begin
                  PlayerStartTime := (GetSystemTime div 1000); // PlayerStartTime
                  if Length(Players[CurrentPlayer].NickTPA) < 2 then
                  begin;
                    Writeln('Creating the NickTPA.');
                    if Players[CurrentPlayer].Nick <> '' then
                      Players[CurrentPlayer].NickTPA := CreateTPAFromText(Players[CurrentPlayer].Nick, UpChars)
                    else
                    begin;
                      Writeln('Nickname isnt set, taking the username instead..');
                      Players[CurrentPlayer].NickTPA := CreateTPAFromText(Players[CurrentPlayer].Name, UpChars);
                    end;
                  end;
                  WriteFileString(TheFile, Chr(13) + 'Current player: '+ UpperCase(Players[CurrentPlayer].Name) + Chr(13)); //* Save NAME to file
                end;
               end;
          Begin
           Wait(1);
          WriteLn('Logged Player In');
        end;
      Exit;
    end;

  2. #2
    Join Date
    Oct 2007
    Location
    The deep web
    Posts
    2,496
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    were would i insert this?
    Did someone say GDK?

  3. #3
    Join Date
    Nov 2007
    Location
    The Netherlands
    Posts
    1,490
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Replace your current login.scar with it
    Nauman, it looks good
    But why not do a
    SCAR Code:
    wait(100+random(100));
    between the typesends?
    Because with the new update, type acc, enter , type pass, enter = login, is possible, and looks way more legit IMO.
    Also.. no randomness in waiting when a world is full or something like that
    (yes I know, it is also like that in login.scar, but I am also surprised by that)
    It looks good man

  4. #4
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Thanks, Typesend already has waits in it

  5. #5
    Join Date
    Nov 2007
    Location
    The Netherlands
    Posts
    1,490
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    But now you don't have to click on login, you can simply press enter, and that looks way more legit IMO.

    Also, why do you have mmouse in this?
    SCAR Code:
    MMouse(364, 260, 14, 4);
          TypeSend(Players[CurrentPlayer].Name);
         MMouse(374, 327, 15, 5);
          TypeSend(Players[CurrentPlayer].Pass);
    ?
    Isn't this ment to be mouse?
    I might be wrong, since I'm really tired atm

  6. #6
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Your tired

  7. #7
    Join Date
    Nov 2006
    Location
    'Pergamino, BA, Argentina';
    Posts
    473
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by pvh View Post
    Replace your current login.scar with it
    I think you only have to replace your LoginPlayer function INSIDE login.scar, not the whole file... correct me if i'm wrong, i don't have such a big scripting knowledge.
    Also, you'd have to rename the function to LoginPlayer, without the X at the end, in order not to have to edit any other stuff.

  8. #8
    Join Date
    Apr 2008
    Location
    Northwest england
    Posts
    1,179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    no shady you are correct =]
    Blank!

  9. #9
    Join Date
    May 2008
    Posts
    65
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by jakeyboy29 View Post
    were would i insert this?
    That's what she said.

  10. #10
    Join Date
    Nov 2007
    Location
    The Netherlands
    Posts
    1,490
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    That was what I ment, lol.
    Sorry for the misunderstanding

  11. #11
    Join Date
    Dec 2007
    Location
    New Zealand
    Posts
    117
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Won't press the First Log In button, and excuse for being a noob, but which line of code actually does ?

    I've scanned the code and can't the one which presses the very first Log In

    Thanks to SonsOfSheep for the Great Siggy ^^


  12. #12
    Join Date
    Mar 2007
    Posts
    937
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I have put NaumanAkhlaQ's Fix for Log in and BobboHobbo's Log out procedure in my Login.scar just replace login scar with this one...
    Exam period.

  13. #13
    Join Date
    Oct 2007
    Location
    If (Online) then Loc := ('On comp') else Loc := ('Somewhere else!');
    Posts
    2,020
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    good job Nauman

    @ashur i have also got it saved like that too!

  14. #14
    Join Date
    Sep 2007
    Location
    Sweden
    Posts
    765
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Yay, way to go Nauman, you're my scripting idol I love your tuts and scripts, you're a cool person also. Good job.


    ^LOL^

  15. #15
    Join Date
    May 2008
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Ashur2Good View Post
    I have put NaumanAkhlaQ's Fix for Log in and BobboHobbo's Log out procedure in my Login.scar just replace login scar with this one...
    This won't work for me! I get: unknown identifier "LoggedIn"
    Please help!

  16. #16
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by kor View Post
    Yay, way to go Nauman, you're my scripting idol I love your tuts and scripts, you're a cool person also. Good job.
    Love you too

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. LoginPlayer? wtf
    By ducels in forum OSR Help
    Replies: 5
    Last Post: 01-01-2008, 03:55 AM
  2. Its Been a While Since a New Mining Script Has Been Written...
    By mnagi85 in forum RS3 Outdated / Broken Scripts
    Replies: 2
    Last Post: 12-01-2007, 09:51 AM
  3. Is this written right??
    By Da Der Der in forum OSR Help
    Replies: 5
    Last Post: 11-15-2007, 04:51 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
  •