PDA

View Full Version : Complete Guide to Logging In



Richard
03-27-2008, 08:23 PM
Complete Guide to Logging In


People seemed to critisize my basics tut because I didn't have enough information on the declare players area so I thought I would make this to stop the confusion and then link it as this is going to be a very thorough tutorial on logging in your players and how to use DeclarePlayers.


Ok so lets start off with a completely empty script that looks like this:

program New;
begin
end.

That is what you get when you first open up SCAR.

First of all lets start by giving this script a name, as we are going to log in a player, we shall call it Login:

program Login;
begin
end.

Next we are going to have to include SRL into this script, SRL is a great include that makes SCAR a lot less detecable and is the only working include for SCAR. We add SRL into a script like this.

{.include SRL/SRL.scar}

We add this right under the program name and before anything else:

program Login;
{.include SRL/SRL.scar}

begin
end.

There we go, SRL has now been included.

Now we need to make the procedure for loging in, I personally name this procedure DeclarePlayers, because thats what it does, but you can call it anything you think is relevant.

We should now have this:

program Login;
{.include SRL/SRL.scar}

procedure DeclarePlayers;
begin
end;

begin
end.

So now we have the procedure started off we need to add the part of the script that declares players.

First of all we need to give some basic information to SCAR what the script should do with logging in. First we need to tell it how many players you have:

HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);

This will tell scar that we are using 1 player, change the 1 to however many players you want to use.

Next we need to tell SCAR what player to start on, normally you would start on player 1, but SCAR starts at 0 so we need to write 0 as the first player. Do this like this:

CurrentPlayer := 0;

Now we need to put this into our DeclarePlayers procedure, do this as follows:

program Login;
{.include SRL/SRL.scar}

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
end;

begin
end.

So we've told SCAR the basic information about all the players in general, now we need to tell SCAR the individual information about the players.

First we need to tell SCAR the username.

Players[0].Name := 'username';

See that once again you start at 0 not 1. Make sure that you always have the username in 's as the name must be a string (word or sentance) and we mark strings with 's.

Next we need to tell SCAR the password.

Players[0].Pass := 'password';

This again must be a string.

Now for the bit some people don't understand:

Players[0].Nick := 'nick';

This is basically is 3-4 letters of your username that must not be the beginning of words in your username and they must be all consecutive. SCAR uses this to detect talking randoms so if it sees those letters on the screen it will start a search for randoms.

Now to tell SCAR if we are using this player:

Players[0].Active := True;

Now this is what we call a boolean, which means either true or false, true meaning it is active, false meaning it isn't.

Now we have to put all this information together in a neat block, almost a paragraph. Do this as follows:

Players[0].Name := 'username';
Players[0].Pass := 'password';
Players[0].Nick := 'nick';
Players[0].Active := True;

So now we have it all together, lets put it into our DeclarePlayers procedure:

program Login;
{.include SRL/SRL.scar}

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := 'username';
Players[0].Pass := 'password';
Players[0].Nick := 'nick';
Players[0].Active := True;
end;

begin
end.

Now we have the procedure for the players completed, now we need to work on the main loop, which is the whole program put together. At the moment it is just

begin
end.

which will do nothing.

So lets start off by making sure SRL is include by adding this line.

SetupSRL;

And add that into out main loop:

begin
SetupSRL;
end.

Next we need to call that procedure that we made just a minute ago, all we need to do is put the name of out procedure in, then add a semicolon ( ; ).

So we should have the main loop looking like this once we've added that procedure:

begin
SetupSRL;
DeclarePlayers;
end.

Next we need to add something to change windows so it will be able to see the login screen, we do this by adding

ActivateClient;

But this can only work if you have dragger the crosshair (little crosshair that is on the SCAR toolbar) onto the client you are using.

So we should have

begin
SetupSRL;
DeclarePlayers;
ActivateClient;
end.

Next we have to call the logging in procedure, which looks like this:

LoginPlayer

To logout a player you just put

Logout

But we want to be logged in, so out main loop should look like this now

begin
SetupSRL;
DeclarePlayers;
ActivateClient;
LoginPlayer
end.

Now we've finished that we need to put the main loop into the script.

So we should have a script that looks like this:

program Login;
{.include SRL/SRL.scar}

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := 'username';
Players[0].Pass := 'password';
Players[0].Nick := 'nick';
Players[0].Active := True;
end;

begin
SetupSRL;
DeclarePlayers;
ActivateClient;
LoginPlayer
end.



So there you go, you have just made your first logging in script, hope this tut helped you log in your players.


Happy Logging In!

Torrent of Flame
03-27-2008, 08:25 PM
Looks good.

You really want that Tut Writers Cup dont you?

*Admires His Cup*

Looks like your just not good enough for it mate..



Joke. Haha. Writing in white is fun :]

skilld u
03-27-2008, 08:25 PM
very nice! maybe add how to switch players?

NextPlayer(true);
NextPlayer(false);

Richard
03-27-2008, 08:28 PM
Looks good.

You really want that Tut Writers Cup dont you?

*Admires His Cup*

Looks like your just not good enough for it mate..



Joke. Haha. Writing in white is fun :]

Yeah I do really want that cup, and yes, white writing is very fun :D


very nice! maybe add how to switch players?

NextPlayer(true);
NextPlayer(false);

The only reason I didn't add player switching is because I barely know how to do it and I've never put it into a script of mine. But maybe I should when I next have time because this took a while to write...

skilld u
03-27-2008, 08:31 PM
nextplayer(true); switches players leaving the current one true.
nextplayer(false); switches players making the current one false.
nextplayer(loggedin); switches players and if the current one is logged in than it leaves it true, if not logged in than it makes it false.

Richard
03-27-2008, 08:33 PM
Well I don't know how I would imply that into this tut, why don't you make a little tut about it as you seem to know how to use it.

Torrent of Flame
03-27-2008, 08:33 PM
^.^ But yeah, if you want the cup just keep writing. You'll get recognized.


EDIT: There. I made it not Spam. Sheesh

skilld u
03-27-2008, 08:36 PM
i guess i could do that. =s don't really want to. and spam much? ^

Richard
03-27-2008, 08:39 PM
No-one cares about members spamming :p *cough* hy *cough*

Its only really leechers that people have a go at lol

chrsk13
03-28-2008, 04:31 AM
Thanks for the guide! I'm probably going to start trying to learn to script this summer or soon. This will help considering I never had much of an idea on how to make people log in.

Richard
03-28-2008, 05:30 PM
Thanks, if you like it alot you can rep me :D just click the blue tick in the corner of the post which had the guide.

Torrent of Flame
03-28-2008, 05:37 PM
*Admires His Cup* Droool.

Haha. White is fun. Just playing =]

Richard
03-28-2008, 05:42 PM
Lols about white writing, you know it doesn't really work that well for me because I watch you post in iSpy and its all just in blue there :)

Torrent of Flame
03-28-2008, 05:43 PM
Aaah.

Ah well, never mind lol :D

Richard
03-28-2008, 05:51 PM
But white writing is still great fun though :)

I've seen hermpie on this thread for a while now. Please post on it :D

EDIT: W00t, Useful writer cup :D

permy
03-28-2008, 06:17 PM
very nice tutorial will look at right now:)

Richard
03-28-2008, 06:22 PM
Thanks :)

Don't forget to rep me by click the little blue cross in the corner of my post :)

DeSnob
04-05-2008, 05:11 PM
thank you dude :D i finally know how to login a player ... i thought i would have to start the script logged on

Cazax
04-05-2008, 05:14 PM
Nice one Dude, you should explain Players[0].Strings[0], Players[0].Integers[0], Players[0].Extendeds[0].

Richard
04-05-2008, 06:20 PM
Yeah, I might make that in another tut as this is just designed for logging in.

And to check, extended are numbers with decimals places right?

Cazax
04-05-2008, 06:21 PM
Yeah, I might make that in another tut as this is just designed for logging in.

And to check, extended are numbers with decimals places right?

Ok then, extended numbers = X,X. Read the SCAR Manual :rolleyes:

Richard
04-05-2008, 06:23 PM
I thoughted so, same as any other programming language, I just thought it best to check.

Pu3rto0wn
04-13-2008, 08:51 PM
I Really like your tuts :D

trav280
04-13-2008, 10:51 PM
a switching players guide would be nice, and thanks for this

Richard
04-14-2008, 10:18 AM
You know, I might just make a switching player guide :)

And pur3t0own, thanks for liking my tuts :)

PvH
04-14-2008, 02:16 PM
very nice tut:)
this will help a lot of people who are new at srl i think
thx for posting, and rep++ for you:)

Richard
04-14-2008, 02:47 PM
very nice tut:)
this will help a lot of people who are new at srl i think
thx for posting, and rep++ for you:)

Np, and thanks for rep :)

I'm thinking of adding the bits about player switching as well...

PvH
04-14-2008, 04:03 PM
that would be a good idea..
still simple tough:
_________________________
my explain:

nextplayer(true);
this is often used in a script when it hits xxx loads/time or something like that
what it does:
it logs out the player and leaves his active to true.
when all players are done, it will logn back and repeat;)

nextplayer(false);
this is often used when it cant find a color/tree/mining symbol/anything that is important for the script, also used for unsolvable randoms
what it does:
it logs out the player and makes his active false.
when all players are done, it will NOT log in this player again, since it is false and won't be able to work again.

maybe add using RC?
(tough i think it is broken atm)

ozozo
04-14-2008, 09:06 PM
NVM Fixed it...

Richard
04-15-2008, 09:55 AM
NVM Fixed it...

Umm, what? Did you reply on the wrong thread by any chance?

randy marsh
07-15-2008, 12:47 AM
making my first script but i need elp with login-

program WoodPeckerPowerDropper ;
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/Woodcutting.scar}

var x, y: integer;

const

// your bank pin






procedure DeclarePlayers;
begin
HowManyPlayers := 1; //number of players
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0; //starting player

Players[0].Name := ''; //your username
Players[0].Pass := ''; //your password
Players[0].Nick := ''; // 3-4 letters of your username
Players[0].Active := True;
end;

begin
SetupSRL;
DeclarePlayers;
ActivateClient;
LoginPlayer
end;


Procedure ChopTree;
begin

repeat
if FindObjCustom(x, y, ['Wil', 'low'], [1989969, 3760987, 2844763], 7) then
begin
Mouse(x,y,0,0,false);
repeat
Wait(100 + (random(150)));
ChooseOption('hop')
until(InvFull)
end;
until(InvFull)
end;
begin
end.
says theres a error with this- line 16 which is----procedure DeclarePlayers;

elamentx
07-15-2008, 06:24 AM
Thanks this was really helpful. im new at scar and really am just trying to figure out how all this stuff works.

Richard
07-16-2008, 07:07 PM
making my first script but i need elp with login-

program WoodPeckerPowerDropper ;
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/Woodcutting.scar}

var x, y: integer;

const

// your bank pin






procedure DeclarePlayers;
begin
HowManyPlayers := 1; //number of players
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0; //starting player

Players[0].Name := ''; //your username
Players[0].Pass := ''; //your password
Players[0].Nick := ''; // 3-4 letters of your username
Players[0].Active := True;
end;

begin
SetupSRL;
DeclarePlayers;
ActivateClient;
LoginPlayer
end;


Procedure ChopTree;
begin

repeat
if FindObjCustom(x, y, ['Wil', 'low'], [1989969, 3760987, 2844763], 7) then
begin
Mouse(x,y,0,0,false);
repeat
Wait(100 + (random(150)));
ChooseOption('hop')
until(InvFull)
end;
until(InvFull)
end;
begin
end.
says theres a error with this- line 16 which is----procedure DeclarePlayers;

Whats the error, and the reason that it might not work is because your main loop is in the middle. This is what it should look like:

program WoodPeckerPowerDropper ;
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/Woodcutting.scar}

var x, y: integer;

const

// your bank pin






procedure DeclarePlayers;
begin
HowManyPlayers := 1; //number of players
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0; //starting player

Players[0].Name := ''; //your username
Players[0].Pass := ''; //your password
Players[0].Nick := ''; // 3-4 letters of your username
Players[0].Active := True;
end;


Procedure ChopTree;
begin

repeat
if FindObjCustom(x, y, ['Wil', 'low'], [1989969, 3760987, 2844763], 7) then
begin
Mouse(x,y,0,0,false);
repeat
Wait(100 + (random(150)));
ChooseOption('hop')
until(InvFull)
end;
until(InvFull)
end;

begin
SetupSRL;
DeclarePlayers;
ActivateClient;
LoginPlayer
end.

I think I might have made a couple of stupid mistakes in there, I'll check it now.

wezieone
07-18-2008, 06:17 PM
:spongebob: ;l


Complete Guide to Logging In


People seemed to critisize my basics tut because I didn't have enough information on the declare players area so I thought I would make this to stop the confusion and then link it as this is going to be a very thorough tutorial on logging in your players and how to use DeclarePlayers.


Ok so lets start off with a completely empty script that looks like this:

program New;
begin
end.

That is what you get when you first open up SCAR.

First of all lets start by giving this script a name, as we are going to log in a player, we shall call it Login:

program Login;
begin
end.

Next we are going to have to include SRL into this script, SRL is a great include that makes SCAR a lot less detecable and is the only working include for SCAR. We add SRL into a script like this.

{.include SRL/SRL.scar}

We add this right under the program name and before anything else:

program Login;
{.include SRL/SRL.scar}

begin
end.

There we go, SRL has now been included.

Now we need to make the procedure for loging in, I personally name this procedure DeclarePlayers, because thats what it does, but you can call it anything you think is relevant.

We should now have this:

program Login;
{.include SRL/SRL.scar}

procedure DeclarePlayers;
begin
end;

begin
end.

So now we have the procedure started off we need to add the part of the script that declares players.

First of all we need to give some basic information to SCAR what the script should do with logging in. First we need to tell it how many players you have:

HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);

This will tell scar that we are using 1 player, change the 1 to however many players you want to use.

Next we need to tell SCAR what player to start on, normally you would start on player 1, but SCAR starts at 0 so we need to write 0 as the first player. Do this like this:

CurrentPlayer := 0;

Now we need to put this into our DeclarePlayers procedure, do this as follows:

program Login;
{.include SRL/SRL.scar}

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
end;

begin
end.

So we've told SCAR the basic information about all the players in general, now we need to tell SCAR the individual information about the players.

First we need to tell SCAR the username.

Players[0].Name := 'username';

See that once again you start at 0 not 1. Make sure that you always have the username in 's as the name must be a string (word or sentance) and we mark strings with 's.

Next we need to tell SCAR the password.

Players[0].Pass := 'password';

This again must be a string.

Now for the bit some people don't understand:

Players[0].Nick := 'nick';

This is basically is 3-4 letters of your username that must not be the beginning of words in your username and they must be all consecutive. SCAR uses this to detect talking randoms so if it sees those letters on the screen it will start a search for randoms.

Now to tell SCAR if we are using this player:

Players[0].Active := True;

Now this is what we call a boolean, which means either true or false, true meaning it is active, false meaning it isn't.

Now we have to put all this information together in a neat block, almost a paragraph. Do this as follows:

Players[0].Name := 'username';
Players[0].Pass := 'password';
Players[0].Nick := 'nick';
Players[0].Active := True;

So now we have it all together, lets put it into our DeclarePlayers procedure:

program Login;
{.include SRL/SRL.scar}

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := 'username';
Players[0].Pass := 'password';
Players[0].Nick := 'nick';
Players[0].Active := True;
end;

begin
end.

Now we have the procedure for the players completed, now we need to work on the main loop, which is the whole program put together. At the moment it is just

begin
end.

which will do nothing.

So lets start off by making sure SRL is include by adding this line.

SetupSRL;

And add that into out main loop:

begin
SetupSRL;
end.

Next we need to call that procedure that we made just a minute ago, all we need to do is put the name of out procedure in, then add a semicolon ( ; ).

So we should have the main loop looking like this once we've added that procedure:

begin
SetupSRL;
DeclarePlayers;
end.

Next we need to add something to change windows so it will be able to see the login screen, we do this by adding

ActivateClient;

But this can only work if you have dragger the crosshair (little crosshair that is on the SCAR toolbar) onto the client you are using.

So we should have

begin
SetupSRL;
DeclarePlayers;
ActivateClient;
end.

Next we have to call the logging in procedure, which looks like this:

LoginPlayer

To logout a player you just put

Logout

But we want to be logged in, so out main loop should look like this now

begin
SetupSRL;
DeclarePlayers;
ActivateClient;
LoginPlayer
end.

Now we've finished that we need to put the main loop into the script.

So we should have a script that looks like this:

program Login;
{.include SRL/SRL.scar}

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := 'username';
Players[0].Pass := 'password';
Players[0].Nick := 'nick';
Players[0].Active := True;
end;

begin
SetupSRL;
DeclarePlayers;
ActivateClient;
LoginPlayer
end.



So there you go, you have just made your first logging in script, hope this tut helped you log in your players.


Happy Logging In!