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!
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!