
Originally Posted by
Chaos-Energy
Functions return a value, procedures do not.
This is the essence of the difference. It means you could write code like
Simba Code:
function1(function2(3,7), function3('Hello World'))
if you desired (much simpler than or) instead of
Simba Code:
var
f1,f2,f3 : integer; //f1,f2,f3 represent the 'return values' of the procedure
proc2(f2,3,7);
proc3(f3,'Hello World');
proc1(f1,f2,f3);
Where the procs do the exact same thing as the functions with their first argument being 'return value'.
Usually when you don't care about return values or feedback values you just use procedures though. Example is a finder function should probably be a function (that returns a boolean or some type of coordinates) since you need to know whether you've found something or where it is.
Meanwhile, your antiban should probably be a procedure since you don't really care if the antiban was 'successful', if it accidentally moused over prayer instead of thieving who really cares? You just care that it happens (on a similar vein you probably want mainloop to be a procedure since you just care that is run however often you need it to run and the return value would be kind of useless since the mainloop encapsulates everything important in your script anyways)