Log in

View Full Version : Srl function



wantonman
04-17-2011, 09:37 AM
Hello, on "login.scar"... for function "LoginPlayer"... where can I enter my username and password.

cant find where to enter these.

On otherspecs function "LoginPlayerToLob" clearly states enter username and enter password.



[Im barely writing scripts with SRL]
[Ive gotten the basics down but i really want to use the most out of SRL]
[Ive been off and on programming with SCAR for around 2.5 years]
{2.5 lol}
{(around 30 months) \\off and on [[30%off...]]}
---do the math---im no master---

HarryJames
04-17-2011, 09:39 AM
You must use the function, Declare players.
This is where you fill in your details.

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

with Players[0] do
begin
Name := 'Username';
Pass := 'Password';
Nick := 'Nickname'; // Three/Four letters of your name
Active := True;
end;
end;

Troll
04-17-2011, 09:42 AM
program logIn;
{$i SRL/SRL.scar}

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

with Players[0] do
begin
Name := 'Username';
Pass := 'Password';
Nick := 'Nickname'; // Three/Four letters of your name
Active := True;
end;
end;

begin
SetupSRL;
DeclarePlayers;
LogInPlayer;
end.


You need to use a declare function

wantonman
04-17-2011, 09:46 AM
thanks uhm which file name is this just because i like knowing where to look for reference...

for example the LoginPlayer function was found in file login.scar

(!please?)

like is this SRL or just something you have to know
well it can be both but mainly SRL?

TomTuff
04-17-2011, 10:02 AM
It's a script. Scripts use the files inside the SRL include. The files in the SRL Include are not stand alone scripts - they are a library of functions used to create scripts.

wantonman
04-17-2011, 10:04 AM
well thanks for helping me out with that script its 3 a.m. so im acting fishy lol...

Troll
04-17-2011, 06:21 PM
Yeah, you have to use the code i posted in your script but it uses login.scar

Ogre
04-17-2011, 07:10 PM
You don't have to use any function called "DeclarePlayers", that's just what most people call it. You just need to call NumberOfPlayers(somenumber) and then declare the usernames, passwords, etc under the Players variable(s), and most people choose to have that in a procedure called DeclarePlayers at the beginning of the script..

wantonman
04-17-2011, 08:11 PM
Ah I see, I found the NumberOfPlayers function in the players.scar file. now i assume that I still would need to use the LoginPlayer function after Ive declarerd my player.

with that being said im thinking that the LoginPlayer function will use the NumberOfPlayers funtion for its username and password correct me if im wrong...



MR.TROLL ive enterd your script exactly as you have it filled it out completly but smart doesnt log in instead just sits there

update: by adding RSReady; everything works... cool noice

my undestanding of SRL went up 2%