Results 1 to 7 of 7

Thread: Autologin Script

  1. #1
    Join Date
    May 2007
    Posts
    25
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Autologin Script

    This is my first script that I made to practice finding colors, moving and clicking the mouse, timed delays, debugging, and standards. I wanted to make something generic that could be built on for later scripting.

    Update in v0.2: Chat modes are changed, compass is set, special bar is set if on members world and holding a weapon with that option.

    What It Does
    • Turns annoying splashscreen music off if desired (control by a constant)
    • Selects the most quiet member world, or f2p if a constant is changed
    • Logs in using the SRL login procedure
    • Sets run energy to ON after login


    Notes:
    credit for the music procedure goes to Nikize, although it was modified

    To do list:
    Make antirandom
    Decide on what in-game skill procedures to use

    Done checklist:
    Change chat modes
    Set special bar if the correct weapon is equipped


    Please say if this is a good or bad start. (Oh and tell me how I can make this efficient.) Also I was looking around and saw that the WorldSwitcher SRL scarscript wasn't mentioned in the wiki. Could someone care to explain the WorldSelect function in it a little better? thanks!


    SCAR Code:
    { Auto login script by Deathie
        Description:Turns off annoying music button, picks a quiet world, logs in, and sets run to true.
                    New in v0.2: Also sets up chat and special attack settings.
       
      To setup this script go to the procedure DeclarePlayers, scroll down,
      and set username and password.
    }

    program LoginNow;
    {.include SRL\SRL.scar}

    // Variables
    var
      x, y, WorldColor: integer;
     
    {.include SRL\srl\misc\WorldSwitcher.scar}

    // Constants
    const
      MembWorld = True; //True: Find quiet member world -- False: Find quiet free world
      MusicOff = True; //True for splash screen music off, false to keep it on
      Sign = 1315974; //Constant used in music procedure (red cancel mark color)

    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1; //How many players there are
      NumberOfPlayers(HowManyPlayers); //Leave this alone
      CurrentPlayer := 0;  //The player to start with
      Players[0].Name := 'cookie monster'; //Player username
      Players[0].Pass := 'c is for cookie'; //Player password
      Players[0].Nick := 'ooki'; //3-4 letters of username, NO capitals or spaces
      Players[0].Pin := 0000; //Runescape bank pin number. If none just enter 0000
      Players[0].Active := True; //Do you want to use this player?

      //Multiplayer can be added by adding on to the array...
    {
      Players[1].Name := ''; //Alt. Player username
      Players[1].Pass := '';  // Alt. Player password
      Players[1].Nick := ''; //3-4 letters of username, NO capitals or spaces
      Players[1].Pin := 0000; //Runescape bank pin number. If none just enter 0000
      Players[1].Active := True;
    }

      NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
    //  Writeln ('There are ' + Inttostr(HowManyPlayers)+ ' Player(s)');
    end;


    //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\\
    procedure SplashScreen; begin
    cleardebug;
    WriteLn('//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\\');
    WriteLn('//  Autologin Script for Runescape 2 by Deathie');
    WriteLn('//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\\');
    end;
    //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\\

    // Credit to Nikize for the music procedure -- modified by Deathie
    procedure Music;
     begin
    Writeln('*******Music procedure*************');
     if (MusicOff=False) then
      begin
    Writeln('You have requested to put music on.');
     if (FindColor(x,y,Sign,734,482,741,491))
      then begin
      Writeln('Music is currently set to off..');
      Writeln('Setting music on..');
      MMouse(740+random(5),480+random(5),2,4);
      Wait(25+random(144)); //Simulate real human delay in click
      Mouse(742+random(2),482+random(2),1,3,true);
     end
      Writeln('***********************************');
    end;
      if (MusicOff=True) then begin
        if (FindColor(x,y,Sign,734,482,741,491)) then
       begin
        Writeln('Color found, music is already off!');
        Writeln('**********************************');
     end else
      Mouse(731+random(10),472+random(20),0,0,true);
      Writeln('Logging in with music off.');
      Writeln('****************************************');
      end;
    end;

    //Find least populated world and autologin
    procedure WorldLogin;
    begin
    //  Mouse(8+random(15),352+random(30),0,0,true); //Move mouse near World Select button
      Music;
      Wait(100+random(99));
      ClickWorldSwitchButton;
      OrderBy('players', 'down');
      if(MembWorld=True) then
        begin
        WriteLn('Searching for quiet member world.')
        WorldColor := 5143442; //11711154 = f2p worlds, 5143442 = member world
        OrderBy('type', 'up');  //orderby type: up = sort membs top, down = sort f2p top
        end;
      if(MembWorld=False) then
        begin
        WriteLn('Searching for quiet f2p world.')
        WorldColor := 11711154; //11711154 = f2p worlds, 5143442 = member world
        OrderBy('type', 'down');  //orderby type: up = sort membs top, down = sort f2p top
        end;
      if(FindColor(x,y,WorldColor,0,0,200,200)) then begin
        Mouse(x+3+random(75),y+3+random(5),0,0,true);
        WriteLn('Found a World');
        WriteLn('****************************************');
        WriteLn('Logging In');
        LoginPlayer;
     end;
    end;

    procedure SpecAttack(SetSpec:Boolean);
    var
      x,y:Integer;
    begin
      GameTab(1);
      if SetSpec then
      begin
        If not FindColor(x,y,65535,575, 420, 710, 425) then
        begin
          Mouse(666,421,8,8, True);
          WriteLn('Activated Spec');
        end;
      end;
      if not SetSpec then
      begin
        If FindColor(x,y,65535,575, 420, 710, 425) then
        begin
          Mouse(666,421,8,8, True);
          WriteLn('Deactivated Spec');
        end;
      end;
    end;


    procedure SetupIngame;
    begin
      Makecompass('N');
      HighestAngle;
      if (not(LoggedIn)) then Exit;;
      Writeln('Setting chats and run');
      SetChat('on', 1); //Set public chat: on, off, hide
      Wait(200+random(700));
      SetChat('friends', 2); //Set private chat: on, friends, off
      Wait(200+random(700));
      SetChat('off', 3); //Set trade messages: on, friends, off
      Wait(200+random(700));
      SetChat('off', 4); //Set clan chat: on, off
      Wait(200+random(700));
      SetRun(true);
      if (MembWorld=True) then
      begin
        SpecAttack(true);
      end;
    end;

    procedure Proggy; //Make a progress report in debugger
    begin
      SRLRandomsReport;
      Writeln('Script Exited Normally');
    end;

    procedure MainLoop;
    begin
      SplashScreen;
      ActivateClient;
      Wait(250);
      SetUpSRL;
      DeclarePlayers;
      if(not(loggedin))then begin
        WorldLogin;
        SetupIngame;
      end;
      Proggy;
    end;

    begin
      MainLoop;
    end.

  2. #2
    Join Date
    Oct 2007
    Location
    http://ushort.us/oqmd65
    Posts
    2,605
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    not bad for a first script! I think you did quite well.
    I do visit every 2-6 months

  3. #3
    Join Date
    Oct 2007
    Posts
    28
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by zasz View Post
    not bad for a first script! I think you did quite well.
    Pretty good, but there are already tons of these but good starting scripts

  4. #4
    Join Date
    Oct 2007
    Posts
    28
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Very clever to have music off. Nice script.

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

    Default

    Good script. You thought of some interesting features to make it better than expected.

  6. #6
    Join Date
    Jun 2006
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Very impressed, for first script. good start

  7. #7
    Join Date
    May 2007
    Posts
    25
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for the support, I really appreciate it.

    Updates in v0.2:
    I made it so changing worlds for either memb or f2p is a lot easier, just a boolean now. Also made a function to set special atk bar on just because I felt like it heh. Oh and of course, compass changing and setting up chat modes.

    I'm currently playing with radialwalk and loving it. Still deciding what skill library to make my 2nd script with.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. 0wnzz AutoLogin (First Script)
    By 0wn 4 skill in forum First Scripts
    Replies: 27
    Last Post: 07-09-2008, 07:26 AM
  2. first script autologin
    By Dumpin in forum First Scripts
    Replies: 19
    Last Post: 09-09-2007, 06:23 PM
  3. AutoLogin Script
    By AndyxD in forum First Scripts
    Replies: 5
    Last Post: 08-08-2007, 05:03 AM
  4. AutoLogin Script.
    By chwiggy in forum First Scripts
    Replies: 5
    Last Post: 04-26-2007, 10:57 PM
  5. plz critic my autologin script
    By Bramble in forum OSR Help
    Replies: 6
    Last Post: 12-01-2006, 12:22 AM

Posting Permissions

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