SRL Archive - SRL Suggestions

Switching players


Camaro'

2010-03-11 06:53:39

If the script is told nextplayer true, and theres 1 player left, shouldn't it wait a random amount of minutes before it logs back in again?

ZephyrsFury

2010-03-11 08:24:56

Random waits and sleeping should be up to the scripter to decide IMO. But if you wanted to have your player sleep before reloggin then just add this to your script:


procedure SleepIfLastPlayer;
begin
if (PlayersActive = 1) then
begin
WriteLn('Sleeping');
Wait(RandomRange(5 * 60 * 1000, 10 * 60 *1000));
WriteLn('End sleeping');
end;
end;

Then add this after your SetupSRL call.


SRLProcs[srl_OnNextPlayer] := @SleepIfLastPlayer;

Boreas

2010-03-11 11:04:53

Another option would be storing a MarkTime for each player on logout, and have a min break time. So if the time between Player last logout and now is less than min break time, increase i. This way, when there are only 3 players left it would wait for a certain amount of time, and when there are 2 left it would be a longer time, and 1 left even longer time.

Camaro'

2010-03-11 15:23:44

Interesting.

I looked at nextPlayer in SRL. Does anyone know why we don't have the script terminate if there is no one left and NextPlayer(false) is called?

Naum

2010-03-11 15:26:29

[QUOTE=Camaro';693207]Interesting.

I looked at nextPlayer in SRL. Does anyone know why we don't have the script terminate if there is no one left and NextPlayer(false) is called?

This has been brought up before:
http://villavu.com/forum/showthread.php?t=55073

Don't know an official answer, lol.

Boreas

2010-03-11 21:49:17

Probably due to the possibility of remotely resetting players to true.

Wanted

2010-03-11 22:13:34

From: Boreas
Probably due to the possibility of remotely resetting players to true.


Heh, that's only now that we have that in the temp stats. RC.scar only works if you still have one bot logged in left.

At least there's no longer an infinite loop in LoginPlayer :-P

Boreas

2010-03-11 23:39:13

Also mixster's ESM has been around for a while, and ISM even longer.