Results 1 to 5 of 5

Thread: Login.Scar Fix

  1. #1
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default Login.Scar Fix

    I know I posted this in another thread, but I tested what I put in the thread and it all works, so this should be committed, here's the debug:

    SCAR Code:
    Successfully compiled (3260 ms)
    SRL Compiled in 0 msec
    SMART Initialized.
    Loaded: Server 114, Members: True, Signed: True, Super Detail: False.
    World: 114, Players: 643, Members: False, PvP: False
    *********    (account name)
    Not high enough total level, need 1000 or higher
    *********
    Not high enough total level, need 1000 or higher
    *********
    Not high enough total level, need 1000 or higher
    NextPlayer
    SwitchToPlayer(PlayerNo: 0, Active: False);
    Player is not Active...
    NextPlayer[/CODE]

    Here is the script I used to test it if you want to:

    [CODE]program LoginTester;
    {.include SRL/SRL/Misc/SMART.Scar}
    {.include SRL/SRL.scar}

    const
     World = 114;       //114 P2P 113 F2P
     Membs = True;      // Members = True

    procedure DeclarePlayers;
    begin
      ActivateClient;
      NumberOfPlayers(1);

      Players[0].Name :='';
      Players[0].Pass :='';
      Players[0].Nick :='';
      Players[0].Active := True;
     
      if(not(LoggedIn)) then LoginPlayer;
    end;

    {*******************************************************************************
    function ChangeWorlds(W: Integer; Members, PVP: Boolean): Boolean;
    By: Baked0420
    Description: Chooses the inputted world and whether to members or not
                 If W=0 then it chooses a random world.
    *******************************************************************************}

    function ChangeWorlds(W: Integer; Members, PVP: Boolean): Boolean;
    begin
      ActivateClient;
      if(LoggedIn) then
        Exit;
      if(w=0) then
        Result := SelectWorld(RandomWorld(Members, PVP))
      else
        Result := SelectWorld(W);
    end;

    begin
      {$IFDEF SRL_SMART}
      Smart_Server:= World;
      Smart_Signed:= True;
      Smart_Members:=True;
      {$ENDIF}
      SetUpSRL;
      ChangeWorlds(World, True, False);
      DeclarePlayers;
      repeat
        wait(100);
        if(not(LoggedIn))then
          LoginPlayer;
      Until(IsFKeyDown(2));
    end.

    I used to use that to keep me logged in, that's why there's a repeat login until F2 is pressed

    then to see if what I did works, you need to open login.scar and put this:

    620: Actions:= ['Not high enough total level, need 1000 or higher', 0, 2, 'NextPlayer', 'Login Failed'];

    on line 376, if you are up to date on the DEV SVN, otherwise you need to look for in the LoginPlayer Function for this:

    SCAR Code:
    760: Actions := ['Too many incorrect logins.', 5 * 60000, 2, 'NextPlayer', ''];
            536: Actions := ['Login limit exceeded. Please wait 1 minute and try again.', 60000, 2, 'NextPlayer', ''];
            711: If (CountColor(16711680, 341, 219, 391, 233) = 128) then
                   Actions := ['Your account has been disabled', 0, 0, 'NextPlayer', 'Acc Disabled'];
            598: Actions := ['Invalid Username / Password', 0, 2, 'NextPlayer', 'Wrong User/Pass'];
            787: Actions := ['Not a Members Account', 0, 0, 'NextPlayer', 'Non-member'];
            408: Actions := ['World is full.', 5000, 20, 'RandomNextPlayer', ''];
            669: Actions := ['Your account is already logged in', 5000, 0, 'RandomNextPlayer', ''];
            555: Actions := ['The Server is being updated.', 60000, 4, 'Terminate', 'Server Updating'];
            218: Actions := ['Error Connecting.', 20000, 9, 'Terminate', 'Error Connecting'];
            335: Actions := ['Unable to connect Login Server offline.',(20000) + Random(6000), 4, 'Terminate', 'Login Server Offline'];
            512: Actions := ['RuneScape has been updated. Script Terminated.', 0, 0, 'Terminate', 'RS Updated'];
            489: Actions := ['Connection timed out.', 0, 4, 'Terminate', 'Connection Timed Out'];
            737: Actions := ['You are standing in a members-only area.', 0, 0, 'NextPlayer', 'In Mems-Only Area'];

    and add my line beneath it.

    Someone should commit this tiny update, when you don't have it, it just sits there with the tiny white text, I didn't wait to see how long though, I'm guessing it probably waits 3 minutes then it debugs RS is still not ready... etc.



    EDIT:

    From previous thread (deleted now and pic is in here and some info):

    I think login.scar needs something to be added for the two new worlds. I don't know if this has been mentioned yet, but I don't think it has, if so then sorry. But there are two worlds (one P2P one F2P) where you needed a skill level of 1000 or higher to login. So if people try botting on that world from choosing it randomly and don't have that level, it won't let them login. I'm pretty sure the login.scar checks the text runescape writes when you can't login like error connecting to server, etc. So here's the text it says when you can't login:

    "You must have a total skill level of
    1000 or greater to enter this world."

    without the quotes. And here's a pic too:





    Just checked login.scar, looks like you actually check how much of the text color is there to see what error it is I think.

    It has:

    case (CountColor(12509695, 288, 205, 475, 247)) of

    then the errors below it (by the way, I really like that, pretty creative) in an array, with the integer of how many times it finds the given color, I ran a script to writeln the CountColor in that area and got 620. So you just need to add into the case/of something like:

    620: Actions:= ['Not high enough total level, need 1000 or higher', 0, 2, 'NextPlayer', 'Login Failed']

    You can change it however you like, just gave a base for it cause I'm bored.

    Once again, if this was mentioned already then I apologize.
    Last edited by Narcle; 11-10-2009 at 03:35 PM.

  2. #2
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Awesome. I'll add it on next commit which will be soon.
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

  3. #3
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    k, cool. I was bored, gave me something to do, good to see I actually did something that came to good use for once

    you can just lock this thread, no point in it being open for posts since it's resolved.

  4. #4
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Also, someone make one for PVP worlds please?

  5. #5
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    Also, someone make one for PVP worlds please?
    There is a check for PvP worlds already..
    Let me get it for you

    Here:
    SCAR Code:
    if (GetColor(315, 239) = 197552) then //Check for pvp warning and click
          if AllowPVP then
            MouseBox(434, 416, 481, 425, 1)
          else
          begin
            SRL_Warn('LoginPlayer', 'Attempted to log into PVP World when AllowPVP was false. Terminating.', Warn_AllVersions);
            TerminateScript;
          end;

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
  •