Log in

View Full Version : Why is srl in thread different than svn?



Main
08-08-2008, 02:45 AM
The login.scar from svn (line 439-580)
goto ProcStart;
end;

if (GetColor(212, 327) = 238301) then
begin
Wait(1000 + Random(2000));
MouseBox(227, 337, 555, 364, 1);
end;
MarkTime(Mark);
while (TimeFromMark(Mark) < 30000) and (not(LoggedIn)) do
Wait(1000 + Random(1000));
end;

if (LoggedIn) then
begin
Wait(500);

PlayerStartTime := (GetSystemTime div 1000); // PlayerStartTime
if Length(Players[CurrentPlayer].NickTPA) < 2 then
begin;
Writeln('Creating the NickTPA.');
if Players[CurrentPlayer].Nick <> '' then
Players[CurrentPlayer].NickTPA := CreateTPAFromText(Players[CurrentPlayer].Nick, UpChars)
else
begin;
Writeln('Nickname isn''t set, taking the username instead..');
Players[CurrentPlayer].NickTPA := CreateTPAFromText(Players[CurrentPlayer].Name, UpChars);
end;
end;
AddToSRLLog('Current player: ' + Capitalize(Players[CurrentPlayer].Name));
end;
end;

{************************************************* ******************************
procedure RandomNextPlayer(Active: Boolean);
By: Dankness based on WT-Fawki's NextPlayer and modified by Ron and by Raymond
Description: Picks Random Player that is Active and Logs in
************************************************** *****************************}

procedure RandomNextPlayer(Active: Boolean);
var
LastPlayer: Integer;
begin
WriteLn('NextPlayer');
LastPlayer := CurrentPlayer;
Players[CurrentPlayer].Active := Active;
Logout;
PlayerCurTime := (GetSystemTime div 1000);
Players[CurrentPlayer].Worked := Players[CurrentPlayer].Worked +
((PlayerCurTime - PlayerStartTime) / 60);
repeat
if (AllPlayersInactive) then Wait(60000);
if (PlayersActive = 1) then Break;
CurrentPlayer := Random(HowManyPlayers);
Wait(100);
until (Players[CurrentPlayer].Active) and (LastPlayer <> CurrentPlayer);
SRL_Logs := SRL_Logs + 1;
LoginPlayer;
end;

{************************************************* ******************************
procedure NextPlayer(Active: Boolean);
By: Dankness and modified by Ron and by Raymond
Description: Logs in the next player.
Boolean: True - Current player is ok. False - Current player is false.
************************************************** *****************************}

procedure NextPlayer(Active: Boolean);
begin
if RandomPlayer then
RandomNextPlayer(Active)
else
begin
WriteLn('NextPlayer');
Players[CurrentPlayer].Active := Active;
Logout;
PlayerCurTime := (GetSystemTime div 1000);
Players[CurrentPlayer].Worked := Players[CurrentPlayer].Worked +
((PlayerCurTime - PlayerStartTime) / 60);
CurrentPlayer := (CurrentPlayer + 1) mod Length(Players);
while Players[CurrentPlayer].Active = False do
begin
CurrentPlayer := (CurrentPlayer + 1) mod Length(Players);
if (AllPlayersInactive) then Wait(60000); // Everybody False. Endless Loop.
end;
SRL_Logs := SRL_Logs + 1;
LoginPlayer;
end;
end;

{************************************************* ******************************
procedure CheckUserNicks;
By: Sumilion / Raymond
Description: Checks if all nicks are set correct.
************************************************** *****************************}

procedure CheckUserNicks;
var
CorrectString: string;
i: Integer;
Wrong : Boolean;
Str : String;
begin
for i := 0 to HowManyPlayers - 1 do
begin
Wrong := False;
if (Players[i].Nick = '') then
begin
Wrong := True;
Str := 'WARNING : Please fill in your nickname.';
end;
if (Players[i].Nick <> LowerCase(Players[i].Nick)) then
begin
Wrong := True;
Str := 'WARNING : Please Uncapitalise your nickname.';
end;
if (pos(Players[i].Nick, LowerCase(Players[i].Name)) = 1) then
begin
Wrong := True;
Str := 'WARNING : Dont use the first letter in your nick.';
end;
if (pos(' ', Players[i].Nick) > 0) then
begin
Wrong := True;
Str := 'WARNING : Dont use spaces in your Nick.';
end;
CorrectString := Capitalize(Players[i].Name);
if not (Pos(LowerCase(Players[i].Nick), CorrectString) > 0) then
begin
Wrong := true;
Str := 'WARNING : Nick does NOT match the name.';
end;
if Wrong then
begin;
Writeln('--');
Writeln(Str);
if (Length(Players[i].Name) > 0) then
Writeln('Warning occured with player : ' + Players[i].Name);
Writeln('For more information, visit http://www.villavu.com/forum/showthread.php?t=5410');
end;
end;
end;


login.scar from thread (line 439-593)
goto ProcStart;
end;

if (GetColor(212, 327) = 238301) then
begin
Wait(1000 + Random(2000));
MouseBox(227, 337, 555, 364, 1);
end;
MarkTime(Mark);
while (TimeFromMark(Mark) < 30000) and (not(LoggedIn)) do
Wait(1000 + Random(1000));
end;

if (LoggedIn) then
begin
Wait(500);

T := GetSystemTime;
while (not(FindColor(Tx, Ty, 0, 8, 458, 45, 470))) and (GetSystemTime - T < 5000) do
Wait(100);
if (FindColor(Tx, Ty, 0, 8, 458, 45, 470)) then
if (not(FindTextTpa(0, 0, 7, 457, 137, 475, Players[CurrentPlayer].Nick, SmallChars, Nothing))) then //Double check if logged in player is what we think it is
begin
WriteLn('Logged In Player is not in Players array.');
LogOut;
Wait(1000 + Random(1000));
LoginPlayer;
Exit;
end;

PlayerStartTime := (GetSystemTime div 1000); // PlayerStartTime
if Length(Players[CurrentPlayer].NickTPA) < 2 then
begin;
Writeln('Creating the NickTPA.');
if Players[CurrentPlayer].Nick <> '' then
Players[CurrentPlayer].NickTPA := CreateTPAFromText(Players[CurrentPlayer].Nick, UpChars)
else
begin;
Writeln('Nickname isn''t set, taking the username instead..');
Players[CurrentPlayer].NickTPA := CreateTPAFromText(Players[CurrentPlayer].Name, UpChars);
end;
end;
AddToSRLLog('Current player: ' + Capitalize(Players[CurrentPlayer].Name));
end;
end;

{************************************************* ******************************
procedure RandomNextPlayer(Active: Boolean);
By: Dankness based on WT-Fawki's NextPlayer and modified by Ron and by Raymond
Description: Picks Random Player that is Active and Logs in
************************************************** *****************************}

procedure RandomNextPlayer(Active: Boolean);
var
LastPlayer: Integer;
begin
WriteLn('NextPlayer');
LastPlayer := CurrentPlayer;
Players[CurrentPlayer].Active := Active;
Logout;
PlayerCurTime := (GetSystemTime div 1000);
Players[CurrentPlayer].Worked := Players[CurrentPlayer].Worked +
((PlayerCurTime - PlayerStartTime) / 60);
repeat
if (AllPlayersInactive) then Wait(60000);
if (PlayersActive = 1) then Break;
CurrentPlayer := Random(HowManyPlayers);
Wait(100);
until (Players[CurrentPlayer].Active) and (LastPlayer <> CurrentPlayer);
SRL_Logs := SRL_Logs + 1;
LoginPlayer;
end;

{************************************************* ******************************
procedure NextPlayer(Active: Boolean);
By: Dankness and modified by Ron and by Raymond
Description: Logs in the next player.
Boolean: True - Current player is ok. False - Current player is false.
************************************************** *****************************}

procedure NextPlayer(Active: Boolean);
begin
if RandomPlayer then
RandomNextPlayer(Active)
else
begin
WriteLn('NextPlayer');
Players[CurrentPlayer].Active := Active;
Logout;
PlayerCurTime := (GetSystemTime div 1000);
Players[CurrentPlayer].Worked := Players[CurrentPlayer].Worked +
((PlayerCurTime - PlayerStartTime) / 60);
CurrentPlayer := (CurrentPlayer + 1) mod Length(Players);
while Players[CurrentPlayer].Active = False do
begin
CurrentPlayer := (CurrentPlayer + 1) mod Length(Players);
if (AllPlayersInactive) then Wait(60000); // Everybody False. Endless Loop.
end;
SRL_Logs := SRL_Logs + 1;
LoginPlayer;
end;
end;

{************************************************* ******************************
procedure CheckUserNicks;
By: Sumilion / Raymond
Description: Checks if all nicks are set correct.
************************************************** *****************************}

procedure CheckUserNicks;
var
CorrectString: string;
i: Integer;
Wrong : Boolean;
Str : String;
begin
for i := 0 to HowManyPlayers - 1 do
begin
Wrong := False;
if (Players[i].Nick = '') then
begin
Wrong := True;
Str := 'WARNING : Please fill in your nickname.';
end;
if (Players[i].Nick <> LowerCase(Players[i].Nick)) then
begin
Wrong := True;
Str := 'WARNING : Please Uncapitalise your nickname.';
end;
if (pos(Players[i].Nick, LowerCase(Players[i].Name)) = 1) then
begin
Wrong := True;
Str := 'WARNING : Dont use the first letter in your nick.';
end;
if (pos(' ', Players[i].Nick) > 0) then
begin
Wrong := True;
Str := 'WARNING : Dont use spaces in your Nick.';
end;
CorrectString := Capitalize(Players[i].Name);
if not (Pos(LowerCase(Players[i].Nick), CorrectString) > 0) then
begin
Wrong := true;
Str := 'WARNING : Nick does NOT match the name.';
end;
if Wrong then
begin;
Writeln('--');
Writeln(Str);
if (Length(Players[i].Name) > 0) then
Writeln('Warning occured with player : ' + Players[i].Name);
Writeln('For more information, visit http://www.villavu.com/forum/showthread.php?t=5410');
end;
end;
end;


:mad:

Lee Lok Hin
08-08-2008, 02:49 AM
The only difference I see is this bit.

T := GetSystemTime;
while (not(FindColor(Tx, Ty, 0, 8, 458, 45, 470))) and (GetSystemTime - T < 5000) do
Wait(100);
if (FindColor(Tx, Ty, 0, 8, 458, 45, 470)) then
if (not(FindTextTpa(0, 0, 7, 457, 137, 475, Players[CurrentPlayer].Nick, SmallChars, Nothing))) then //Double check if logged in player is what we think it is
begin
WriteLn('Logged In Player is not in Players array.');
LogOut;
Wait(1000 + Random(1000));
LoginPlayer;
Exit;


It should be fine, because That little snippit of code was causing some people problems, so they opted to just delete it. Perfectly fine.

Main
08-08-2008, 04:17 AM
but the thing is, when I started to use scar again (after a 3 month break) I installed srl 20 (which is the one with out the login player array) and the problem is there, so I had to download the one on the thread and remove it.

Method
08-08-2008, 04:20 AM
but the thing is, when I started to use scar again (after a 3 month break) I installed srl 20 (which is the one with out the login player array) and the problem is there, so I had to download the one on the thread and remove it.

Some people experience the error and others do not. For example, the one from revision 20 works fine for me, so i use it as-is. Other people have to use the modified one for some reason. Use whichever works for you.

Freddy1990
08-08-2008, 09:21 AM
http://freddy1990.com/snapshots/srl/
Guaranteed to be the same as SVN.

jose89
08-09-2008, 11:32 PM
I never had to download any fix from thread. Well whatever works for you!