SRL Archive - Help

Why Doesn't This Compile?


John

2012-05-11 22:27:02

That's one of my functions and it won't compile keep getting:
[Error] (348:37): Type mismatch at line 347
With This Line HighLighted:
  if OptionsExist('nteract', False) then
Function CheckFamiliar: boolean;
begin
MouseBox(700, 136, 714, 148, MOUSE_RIGHT);
if OptionsExist('nteract', False) then
begin
Result:= True
WriteLn('We Still have our Graahk');
end else
begin
Result:= False
WriteLn('We Need A New Graahk');
end;
end;

I can't post full script since it's a Nature RuneCrafter.

All help Appreciated :)

Sex

2012-05-11 22:33:03

The name of the function is OptionsExist which leads me to believe it accepts a TStringArray instead of just a string. So try
OptionsExist(['nteract'], False)
?

Edit: You could shorten the function too:
function CheckFamiliar : boolean;
begin
MouseBox(700, 136, 714, 148, MOUSE_RIGHT);
result := OptionsExist(['nteract'], False);
if result then
Writeln('We still have our Graahk')
else
Writeln('We need a new Graahk');
end;

John

2012-05-11 23:02:01

Sex saves the day again :D
Hehe