
Originally Posted by
core

You only exit a procedure/function when you call exit;, you reach the end of it, or you raise an exception. Hopefully my [terrible paint] picture helps visualize the normal flow of the program.
Okay let me try and clarify my problem...
My script logs out if my character has been out of combat for 160sec.
It will the log back in after a few minutes, it's a fight cave script and it's just another failsafe if the monsters get stuck somewhere, I should spawn in front of the entrance after logging back in.
Now this is my problem:
After I check if my character has been out of combat for over 160sec, it then checks if my character has been out of combat for 35secs.
This (actually) first failsafe will walk towards the middle of the cave in case the monsters are stuck.
The thing is, when it logs out now, will it then exit the procedure or will it also check for the first failsafe?
I know I should just turn the failsafes around so that it first checks whether the first one is true and then the second.
But still my question remains:
PHP Code:
if (not (IsInCombat)) and (TimeFromMark(Combat) > 90000) then
begin
Inc(LogOuts);
TakeBreak(1, 2, False);
end else
if not (IsInCombat) and (TimeFromMark(Combat) > 35000) then
begin
MakeCompass(185);
MMouse(580, 82, 10, 15);
ClickMouse2(mouse_Left);
Inc(StuckMob);
Writeln('Antibugging mobs...');
//Writeln(IntToStr(TimeFromMark(Combat)));
Wait(randomRange(20000, 25000));
end else
Assuming combat (which is the time I've been out of combat) is over 90sec, it will increment LogOuts which is for my proggy to show how many times it has had to log out.
Now if this is true, and it runs this bit of script, it will jump to my TakeBreak procedure, and jump back after it's done, but will it then continue to check the second bit of script (the ont that chekcs for combat > 35sec)?
The problem here is that I think now when it takes a break, logs back in but if it should fail to detect that I'm not in the cave (IsInCave), the first thing it would do is start walking east (second if statement) right? Then it would repeat and I would find myself somewhere in thzaar city and I would've logged out loads of times...
So I have to add Exit;?