I have this script:
SCAR Code:
{*******************************************************************************
procedure CantLightHere;
Description: Walks to another spot.
*******************************************************************************}
procedure CantLightHere;
var VarrockRoads, x, y, Tries : Integer;
begin
Tries := 0;
MakeCompass('N');
repeat
Tries := Tries + 1;
Wait(100 + random(50));
until(FindColorSpiral(x, y, VarrockRoads, MSX1, MSY1, MSX2, MSY2)) or (Tries > 10);
if (Tries > 10) then
begin
Writeln('ERROR PROCEDURE CANTLIGHTHERE');
TerminateScript;
end;
Mouse(x, y, 2, 2, True);
Flag;
LightAllLogs; ////// ------------HERE IS THE PROBLEM
end;
{*******************************************************************************
procedure LightAllLogs;
Description: Lights ALL of our logs. =D
*******************************************************************************}
procedure LightAllLogs;
var x, y : Integer;
begin
if(Not(CheckTinderBox)) then
begin
Writeln('NO TINDERBOX FOUND');
TerminateScript;
end;
repeat
if (CantLightCheck) then CantLightHere; ////// ------------HERE IS THE PROBLEM
Wait(50 + random(50));
FindDTM(DTMLogs, x, y, MIX1, MIY1, MIX2, MIY2);
Mouse(x, y, 0, 0, True);
Wait(50 + random(50));
FindDTM(DTMTinderbox, x, y, MIX1, MIY1, MIX2, MIY2);
Mouse(x, y, 0, 0, True);
Wait(MaxTimePerLog + random(MaxTimePerLogRandom));
until(InventoryCount = 1);
end;
See, both these procedures call each other from within each other. Meaning they BOTH have to be on top of each other. Which doesn't make sense
How can I get this to work?
Thanks
Pancakes