function R_SolveNonTalkingRandoms: Boolean;
var
I, iTime: Integer;
Music: String;
InRand: Boolean;
begin
If Not LoggedIn then
Exit;
If Not r_RandomVarSet then
r_SetupRandoms;
Music := LowerCase(r_GetMusic);
for I := 0 to r_RandomCount-1 do
begin
If (r_RandomArr[I].Music = Music)or(r_RandomArr[I].Music = '')then
if (r_RandomArr[I].r_InRandom <> nil) then
InRand := r_RandomArr[I].r_InRandom()
else
begin
If (Not(r_RandomArr[I].r_InRandom <> nil)and(r_RandomArr[I].Music = ''))then
Continue;
Writeln('[Reflection] Might be in a random(missing r_InRandom function), terminating.');
Players[CurrentPlayer].Rand := r_RandomArr[I].RandName;
Logout;
Exit;
end;
If InRand then
begin
//Players[CurrentPlayer].Rand := r_RandomArr[I].RandName;
Writeln('[Reflection] Trying to solve: ' + r_RandomArr[I].RandName);
if (r_RandomArr[I].r_SolveRandom <> nil) then
Result := r_RandomArr[I].r_SolveRandom()
else
begin
Writeln('[Reflection] No random solver for this random yet!');
Logout;
Players[CurrentPlayer].Active := False;
Exit;
end;
If not Result then
begin
Writeln('[Reflection] Random solving for ' + r_RandomArr[I].RandName + ' failed');
Logout;
Players[CurrentPlayer].Active := False;
Exit;
end else
Writeln('[Reflection] Random solved');
iTime := GetSystemTime;
While (Not IsIdle) do
begin
Wait(100+Random(100));
if (GetSystemTime-iTime > 60*1000)then
begin
Writeln('[Reflection] Took more than a minute to get out of the random');
LogOut;
Players[CurrentPlayer].Active := False;
Exit;
end;
end;
UseRewardBox;
Exit;
end;
end;
end
Coh3n, for the sake of our dear MSI users.. take away SetupReflectionEx for now!
It solves about 3 randoms, out of 17..
When I get some accounts I can turn it up a notch, and then you can re-add the line.
Edit
function SetupReflectionEx(Terminate: Boolean): boolean;
begin
SetupConstants;
Result := true;
SRL_OnFindRandomCall := @R_OnFindRandomCall;
if(SmartGetFieldInt(0, hook_static_LoginIndex) = -1) then
begin
Result := False;
if(Terminate)then
begin
Writeln('*****Hooks are outdated. Terminating script.*****');
TerminateScript;
end else
Writeln('*************HOOKS ARE OUTDATED.*************');
end;
end;
No you don't..
Not to be all offensive, but I really hate how it looks right now.
Hard not breaking scripts, when you want to change the include completely :(