SRL Archive - OSR Help

Boolean result true in a procedure


Syntax

2013-03-14 07:36:43

Hi guys I was wondering if in a procedure you can find if a function was true and then the procedure can continue, for example :
Procedure Entrance;
var
I: array [0..3] of integer;
begin
if isFighting is true then
repeat
Report;
P07_MakeCompassSouth;
if findcolorspiraltolerance(x,y,3815999,msx1,msy1,msx2,msy2,15) then
Entry(2);
MMouse(x, y, 0, 0);
ClickMouse2(false);
Entered := Entered + 1;
wait(500);
P07_ChooseOptionMulti(['Enter']);
P07_FFlag;
wait(500);
wait(2000 +random(434));
writeln('Found Entrance!');
until not (symbol);
writeln('Entered Entrance!');
P07_MakeCameraAngleHigh;
wait(20000 + random(1001));
StayActive;
end;

i luffs yeww

2013-03-14 07:41:32

From: Blakebn2011
Hi guys I was wondering if in a procedure you can find if a function was true and then the procedure can continue, for example :
Procedure Entrance;
var
I: array [0..3] of integer;
begin
if isFighting is true then
repeat
Report;
P07_MakeCompassSouth;
if findcolorspiraltolerance(x,y,3815999,msx1,msy1,msx2,msy2,15) then
Entry(2);
MMouse(x, y, 0, 0);
ClickMouse2(false);
Entered := Entered + 1;
wait(500);
P07_ChooseOptionMulti(['Enter']);
P07_FFlag;
wait(500);
wait(2000 +random(434));
writeln('Found Entrance!');
until not (symbol);
writeln('Entered Entrance!');
P07_MakeCameraAngleHigh;
wait(20000 + random(1001));
StayActive;
end;


Yup. Just do "if IsFighting then."

EDIT: Oh, sorry, I didn't finish my answer. You can add "if not IsFighting then Exit;" and then continue as usual.

Syntax

2013-03-14 07:43:45

Thanks mate, dam now I feel dumb :P