SRL Archive - SRL Bugs

InvEmpty not working?


poopy2177

2012-02-15 18:24:52

Ok so I have
Procedure NoFood;
begin
If InvEmpty then
begin
WriteLn('No Food');
Wait(500);
WriteLn('Walking To Bank');
end;
end;

just to check if I have no food for my
repeat
until(NoFood);
loop in my fighting script but so far it attacks a monster and then it thinks my inventory is empty right away even thought I have a full inventory? maybe I'm doing it wrong?

Kyle Undefined

2012-02-15 18:26:39

Your procedure needs to be a function that returns True or False.

YoHoJo

2012-02-15 18:26:42

You need to make the procedure into a FUNCTION!
Functions return a value.
In this case we want a Boolean (True or False)

Function NoFood:Boolean;
begin
Result:=InvEmpty;
If Result Then
begin
WriteLn('No Food');
Wait(500);
WriteLn('Walking To Bank');
end;
end;

I believe that should do it!

poopy2177

2012-02-15 18:29:55

Oh sorry thanks haha I'm still a beginner

thanks for the really fast help though guys