SRL Archive - Help and Support

Finding randoms takes 5 seconds?


mat_de_b

2007-10-01 17:55:18

In my script this code


Function FindRandoms: Boolean;
var
i,Mark: Integer;
begin
MarkTime(Mark);
for i := 1 to 3 do
begin
case I of
1: if(FindNormalRandoms)then
Result := True;
2: FindEnt(x,y,True); // Didn't want a result

3: if(FindFight)then // Didnt want a result
begin
RunTo('E',True)
Wait(7000+random(3000));
RunBack;
end;
end;
if Result then
SRLRandomsReport;
Break;
Wait(1);
end;
Writeln('Randoms took '+inttostr(TimeFromMark(Mark))+' ms');
SRLRandomsReport;
end;

is taking 5 seconds and producing

Randoms took 5750 ms
/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
| SRL 4 Randoms Report |
| www.srl-forums.com |
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
\~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/


So although nothing is being found it is still taking a long time… is there anything i can do to change this?

pwnaz0r

2007-10-01 19:04:14

no but


if Result then
SRLRandomsReport;
Break;
Wait(1);

should be


if Result then
begin
SRLRandomsReport;
Break;
Wait(1);
end;

Town

2007-10-01 21:48:02

From: pwnaz0r
no but


if Result then
SRLRandomsReport;
Break;
Wait(1);

should be


if Result then
begin
SRLRandomsReport;
Break;
Wait(1);
end;


No it shouldn't, read it again.

The Claw

2007-10-01 22:23:11

Function FindRandoms: Boolean;
var
i,Mark: Integer;
begin
MarkTime(Mark);
for i := 1 to 3 do
begin
case I of
1: if(FindNormalRandoms)then
Result := True;

2: FindEnt(x,y,True); // Didn't want a result

3: if(FindFight)then // Didnt want a result
begin
RunTo('E',True)
Wait(7000+random(3000));
RunBack;
end;
end;
if Result then
SRLRandomsReport;
Break;
Wait(1);
end;
Writeln('Randoms took '+inttostr(TimeFromMark(Mark))+' ms');
SRLRandomsReport;
end;

I'm pretty sure it should be, unless he wants to break out before it does EntCheck and FindFight

shaunthasheep

2007-10-02 10:04:46

Its probally when SRLRandomsReport; connects to the server.

n3ss3s

2007-10-02 10:32:12

Its probally when SRLRandomsReport; connects to the server.

Correct. Or atleast I think so, because when I do any "GetPage" or any connexion shit with scar, it takes approximately 2-7 seconds.

ShowerThoughts

2007-10-02 10:47:27

so take it of or just put it after the script is finished ;)

Lorax

2007-10-03 03:13:02

Only use SendSRLRandoms report when you switch player (obviously could be done in ProgressReport)….

Town

2007-10-04 19:55:24

From: The Claw
Function FindRandoms: Boolean;
var
i,Mark: Integer;
begin
MarkTime(Mark);
for i := 1 to 3 do
begin
case I of
1: if(FindNormalRandoms)then
Result := True;

2: FindEnt(x,y,True); // Didn't want a result

3: if(FindFight)then // Didnt want a result
begin
RunTo('E',True)
Wait(7000+random(3000));
RunBack;
end;
end;
if Result then
SRLRandomsReport;
Break;
Wait(1);
end;
Writeln('Randoms took '+inttostr(TimeFromMark(Mark))+' ms');
SRLRandomsReport;
end;

I'm pretty sure it should be, unless he wants to break out before it does EntCheck and FindFight


Oh, I was looking at the Wait(1) instead of the Break, so I was half right. The wait should have been after the end;, though.