SRL Archive - OSR Help

Check if logged out and if logged out log back in procedure


W0ah

2013-05-11 16:16:09

Hi all,

Relatively new to this programming language, could someone possibly provide me with a procedure to check if account is not logged in, and if so, to log back in and resume.

Thanks for any help I receive.

W0ah

Haxz

2013-05-11 16:18:38

If not LoggedIn then
LoginPlayer;

W0ah

2013-05-11 16:21:06

Will this procedure work on 07?

Haxz

2013-05-11 16:22:36

Probably. You can test it out yourself. It's not actually a procedure, but you can call it inside most of your functions or procedures to check if you're logged in.

W0ah

2013-05-11 16:24:33

And where in a script would the best place to put this? In each procedure? I am editing a source code and it already has it in the main method but can not handle the 6 hour logout.

if (not LoggedIn) then
begin
LogInPlayer;
wait(750);
end;

Thanks!

Haxz

2013-05-11 16:30:53

Probably a repeat loop that might fail your script if you're logged out. Sometimes script writer choose to terminate script when some part of the script fails. You can check if character is logged out before terminating the script, if it is then login back, if its not then terminate the script.

W0ah

2013-05-11 16:38:08

Sorry i dont understand 100%, your saying that if the scripter has added a condition where if a event occurs the script will log you off and end.

By adding this code that will tell the script to log back in it may cause a log in-log out repeat which will go on continuously.

Im not sure where i could put an if statement within the code to cover this, as it dont want it to be stuck in a loop. I suppose adding it to a few methods will work - albeit untidy?

Haxz

2013-05-11 16:49:34

Not really sure how can I explain it clearly with words. But I think you could just put that code in a procedure where character will most likely logout while doing the procedure. Or put it in most part of the script just to be safe.

W0ah

2013-05-11 18:45:12

Okay, will give that a go, cheers for your help.