NCDS
2010-07-20 15:07:49
Current:
After a few tweaks:
I changed it to randomly idle out or ExitToLobby, and the other part is more so just because I find it convenient to know how much longer the breaks will last.
Comments?
{******************************************************************************}
{ procedure MSI_HandleBreaking; }
{ By: Coh3n }
{ Date: 10 June 2010 }
{ Description: Simple procedure for breaking }
{******************************************************************************}
procedure MSI_HandleBreaking;
begin
if (not LoggedIn) then
Exit;
if (BankScreen) then
CloseBank;
if (HowManyPlayers = 1) or (PlayersActive = 1) then
begin
MSI_Debug('MSI_HandleBreaking', 'Taking a short break', DEBUG_PLAYER_ACTIONS);
ExitToLobby;
Wait((BreakTime * 60000) + RandomRange(-300000, 300000));
MSI_Debug('MSI_HandleBreaking', 'Break over, continuing to play', DEBUG_PLAYER_ACTIONS);
if (LobbyScreen) then
MouseBox(80, 450, 560, 470, 1);
end else
begin
MSI_Debug('MSI_HandleBreaking', 'Switching players', DEBUG_PLAYER_ACTIONS);
NextPlayer(True);
end;
Inc(Stats_CustomVars[STATS_LOGINS]);
MSI_SendStats;
end;
After a few tweaks:
{******************************************************************************}
{ procedure MSI_HandleBreaking; }
{ By: Coh3n }
{ Date: 10 June 2010 }
{ Description: Simple procedure for breaking }
{******************************************************************************}
procedure MSI_HandleBreaking;
var
t: Integer;
begin
if (not LoggedIn) then
Exit;
if (BankScreen) then
CloseBank;
if (HowManyPlayers = 1) or (PlayersActive = 1) then
begin
MSI_Debug('MSI_HandleBreaking', 'Taking a short break', DEBUG_PLAYER_ACTIONS);
if InRange(Random(10), 2, 9) then
ExitToLobby;
t := (GetSystemTime + ((BreakTime * 60000) + RandomRange(-300000, 300000)));
while GetSystemTime < t do
begin
Status('BreakTime remaining: '+IntToStr(t - GetSystemTime)+';');
Wait(60);
if LoggedIn then
FindNormalRandoms;
end;
MSI_Debug('MSI_HandleBreaking', 'Break over, continuing to play', DEBUG_PLAYER_ACTIONS);
if (LobbyScreen) then
MouseBox(80, 450, 560, 470, 1);
end else
begin
MSI_Debug('MSI_HandleBreaking', 'Switching players', DEBUG_PLAYER_ACTIONS);
NextPlayer(True);
end;
Inc(Stats_CustomVars[STATS_LOGINS]);
MSI_SendStats;
end;
I changed it to randomly idle out or ExitToLobby, and the other part is more so just because I find it convenient to know how much longer the breaks will last.
Comments?