Log in

View Full Version : Why does this procedure loop for ever?



Drax
01-26-2012, 06:43 AM
procedure Resting;
var
s: String;
begin
if not loggedin then exit;
FindNormalRandoms;
Report;
Antiban;
DidRedClick;

begin
if (Not runenergy(50)) then
begin
Repeat
Report;
Until (RestUntil(RandomRange(90,100)));
end;
end;
end;

This procedure was working fine yesterday but today it just does continuous loops for ever. It's like the procedure doesn't know when the energy has reach the set percent.

I was thinking it's a SRL problem, can someone help please.

RyGuy
01-26-2012, 06:46 AM
Why are you calling DidRedClick without actually clicking on anything?

Flight
01-26-2012, 06:49 AM
"RestUntil" itself already creates a loop within the function that rests (waits) until you're at your desired energy. So putting a function with a preexisting loop inside of a loop... doesn't make alot of sense, does it?

Try this instead:

procedure Resting;
var
S: String;
begin
if not loggedin then exit;
FindNormalRandoms;
Report;
Antiban;
DidRedClick; //Why?

if (GetMMLevels('run', S) <= 50) then
RestUntil(RandomRange(90,100))
end;

Drax
01-26-2012, 12:25 PM
"RestUntil" itself already creates a loop within the function that rests (waits) until you're at your desired energy. So putting a function with a preexisting loop inside of a loop... doesn't make alot of sense, does it?

Try this instead:

procedure Resting;
var
S: String;
begin
if not loggedin then exit;
FindNormalRandoms;
Report;
Antiban;
DidRedClick; //Why?

if (GetMMLevels('run', S) <= 50) then
RestUntil(RandomRange(90,100))
end;


Yeah i don't know why i put didredclick in there lol, thanks for the help.