SRL Archive - SRL Suggestions

Suggestion for How Players are Declared


putonajonny

2011-12-12 15:26:34

My suggestion would be for a new .scar file where players could write out the usernames and passwords of all of their players. This would save time when setting up a script as you wouldn't have to write out the player names and passwords, but also it would eliminate the worry of forgetful people (like me) uploading script with usernames and passwords in.

The Scar file could look like this:
//-----------------------------------------------------------------//
//-- Scar Standard Resource Library --//
//-- Username and Password --//
//-----------------------------------------------------------------//
Procedure DeclareThePlayers;
begin

HowManyPlayers := 16; //If you increase the number of players here by copy and past then increase this
NumberOfPlayers(HowManyPlayers);

//Player 0
Players[0].Name := ''; //use " if you are getting ~
Players[0].Pass := '';
Players[0].Nick := ''; //3-4 phrase from your name)
Players[0].Active := True;



//Player 1
Players[1].Name := ''; //use " if you are getting ~
Players[1].Pass := '';
Players[1].Nick := ''; //3-4 phrase from your name)
Players[1].Active := True;



//Player 2
Players[2].Name := ''; //use " if you are getting ~
Players[2].Pass := '';
Players[2].Nick := ''; //3-4 phrase from your name)
Players[2].Active := True;



//Player 3
Players[3].Name := ''; //use " if you are getting ~
Players[3].Pass := '';
Players[3].Nick := ''; //3-4 phrase from your name)
Players[3].Active := True;



//Player 4
Players[4].Name := ''; //use " if you are getting ~
Players[4].Pass := '';
Players[4].Nick := ''; //3-4 phrase from your name)
Players[4].Active := True;



//Player 5
Players[5].Name := ''; //use " if you are getting ~
Players[5].Pass := '';
Players[5].Nick := ''; //3-4 phrase from your name)
Players[5].Active := True;



//Player 6
Players[6].Name := ''; //use " if you are getting ~
Players[6].Pass := '';
Players[6].Nick := ''; //3-4 phrase from your name)
Players[6].Active := True;



//Player 7
Players[7].Name := ''; //use " if you are getting ~
Players[7].Pass := '';
Players[7].Nick := ''; //3-4 phrase from your name)
Players[7].Active := True;



//Player 8
Players[8].Name := ''; //use " if you are getting ~
Players[8].Pass := '';
Players[8].Nick := ''; //3-4 phrase from your name)
Players[8].Active := True;



//Player 9
Players[9].Name := ''; //use " if you are getting ~
Players[9].Pass := '';
Players[9].Nick := ''; //3-4 phrase from your name)
Players[9].Active := True;



//Player 10
Players[10].Name := ''; //use " if you are getting ~
Players[10].Pass := '';
Players[10].Nick := ''; //3-4 phrase from your name)
Players[10].Active := True;



//Player 11
Players[11].Name := ''; //use " if you are getting ~
Players[11].Pass := '';
Players[11].Nick := ''; //3-4 phrase from your name)
Players[11].Active := True;



//Player 12
Players[12].Name := ''; //use " if you are getting ~
Players[12].Pass := '';
Players[12].Nick := ''; //3-4 phrase from your name)
Players[12].Active := True;



//Player 13
Players[13].Name := ''; //use " if you are getting ~
Players[13].Pass := '';
Players[13].Nick := ''; //3-4 phrase from your name)
Players[13].Active := True;



//Player 14
Players[14].Name := ''; //use " if you are getting ~
Players[14].Pass := '';
Players[14].Nick := ''; //3-4 phrase from your name)
Players[14].Active := True;



//Player 15
Players[15].Name := ''; //use " if you are getting ~
Players[15].Pass := '';
Players[15].Nick := ''; //3-4 phrase from your name)
Players[15].Active := True;
end;


{*******************************************************************************
If you want to add more players don't copy and paste, easiest way is to run this script:

program WriteOutPlayers;
Var i : integer;
begin
for i := 0 to 15 do
begin
WriteLn('//Player '+IntToStr(i))
WriteLn('Players['+IntToStr(i)+'].Name := <>; //use " if you are getting ~') //you will have to use replace in notepad or other
WriteLn('Players['+IntToStr(i)+'].Pass := <>;') //to swap <> for ''
WriteLn('Players['+IntToStr(i)+'].Nick := <>; //3-4 phrase from your name)')
WriteLn('Players['+IntToStr(i)+'].Active := True;')
WriteLn('')
WriteLn('')
WriteLn('')
end;
end.
*******************************************************************************}

The player would then call in their script:

{.include SRL/DeclarePlayers.scar}  //Assuming the file was stored in C:\Simba\Includes\SRL but this could be anywhere

Var PlayersToUse : TIntegerArray;

DeclareThePlayers;
CurrentPlayer := 0;
PlayersToUse := [0,1,3,4,9];

Any Questions/Suggestions let me know, doing it like this would mean that current scripts wouldn't have to be updated as there wouldn't be issues unless they used {.include SRL/DeclarePlayers.scar} to include the file

KingKong

2011-12-12 17:11:11

Thats up to the scripters, but i have always used it like this:

procedure M_DeclarePlayers(HowMany: Integer);
var
a: Integer;
Ar_Name, Ar_Pass, Ar_Pin: TStringArray;
Ar_Active: TBooleanArray;
begin
Ar_Name := ['username1', 'username2', 'username3'];
Ar_Pass := ['password2', 'password2', 'password3'];
Ar_Active := [True, True, True];
Ar_Pin := ['1234', '2345', '3456'];

NumberOfPlayers(HowMany);
CurrentPlayer := 0;

for a:= 0 to HowMany - 1 do
with Players[a] do
begin
Name := Ar_Name[a];
Pass := Ar_Pass[a];
Active := Ar_Active[a];
Pin := Ar_Pass[a];
end;
end;
That way the amount of players can be grown without too much hassle.

Coh3n

2011-12-12 17:31:35

Hm, not a bad idea actually, but I think accounts would be handled with the script manager when it's finished. Someone correct me if I'm wrong.

E: Alternatively, you could just save a file like that on your own and copy/paste into the scripts you want to use.

putonajonny

2011-12-13 10:49:27

From: KingKong
Thats up to the scripters, but i have always used it like this:

procedure M_DeclarePlayers(HowMany: Integer);
var
a: Integer;
Ar_Name, Ar_Pass, Ar_Pin: TStringArray;
Ar_Active: TBooleanArray;
begin
Ar_Name := ['username1', 'username2', 'username3'];
Ar_Pass := ['password2', 'password2', 'password3'];
Ar_Active := [True, True, True];
Ar_Pin := ['1234', '2345', '3456'];

NumberOfPlayers(HowMany);
CurrentPlayer := 0;

for a:= 0 to HowMany - 1 do
with Players[a] do
begin
Name := Ar_Name[a];
Pass := Ar_Pass[a];
Active := Ar_Active[a];
Pin := Ar_Pass[a];
end;
end;
That way the amount of players can be grown without too much hassle.


Yeah this method just saves you entering your details into all the scripts you have.

From: Coh3n
Hm, not a bad idea actually, but I think accounts would be handled with the script manager when it's finished. Someone correct me if I'm wrong.

E: Alternatively, you could just save a file like that on your own and copy/paste into the scripts you want to use.


Yeah, I just thought that this way it could be a new standard in how scripts declare players

Coh3n

2011-12-13 13:50:47

From: putonajonny
Yeah, I just thought that this way it could be a new standard in how scripts declare players
Yeah it's not a bad idea at all, there just isn't much point in implementing it now since Simba's script manager is planned to be released.