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.