Quick and dirty: Functions are procedures that will return a result. Procedures are just blocks of code that do whatever you want them to, no results are returned. So if you're doing a progress report and all it does it call "writeln" a few times then it's better just to declare it as a procedure, not a function.
Here's an example:
Simba Code:
Function TeleportToBank: Boolean; //True or False will be returned from this
begin
if not LodestoneTeleport('Lunar Isle') then
Exit;
Result := WaitFunc(@NearBank, 10, 14000);
{
Or...
if WaitFunc(@NearBank, 10, 14000) then
Result := True
else
Result := False;
}
end;
Procedure TeleportToBank; //Nothing is returned
begin
if not LodestoneTeleport('Lunar Isle') then
Exit;
WaitFunc(@NearBank, 10, 14000);
end;
Main loop:
Simba Code:
if InvFull then
if TeleportToBank then //If this function returned true, then...
Writeln('We are at the bank!')
else
Writeln('Wtf happened man? I quit...');
//Or, for a procedure...
if InvFull then
TeleportToBank;
Understand?