SRL Archive - OSR Help

If not loggedin


Skillery

2013-05-18 12:37:29

Hey guys, I am using kyle inkmans coal miner, but sometimes it logs off
I am not sure why, it could be that it just doesnt mine for a while and goes to lobby, or my internet has stopped working again.

I easily fixed this by copying the following from the beginning of the script:
if(not(loggedin))then
Loginplayer;
WriteIn('internet was crappy again, logging in!'

I placed it in the procedure of finding some coal, so that if it doesnt find coal it logs in again.
However, it displays the message everytime it searches for coal! I am not sure whether continuous trying to log in increases ban chance, but I also just want it not to spam.

So, have you any idea why it does not correctly recognize if the player is loggedin? I have no idea how to fix this myself..

Olly

2013-05-18 12:46:21

then only affects the line under it

something like this will work for you

if (not loggedIn()) then
begin
if loginPlayer() then
writeln('internet was bad! logged back in')
end;

rj

2013-05-18 12:47:52

before every procedure make it so that if it's not logged in then exit like

 if (not loggedin)then exit;

then it the main loop do

if (not loggedin) then loginplayer;

That way it wont try to do anything if its not logged on (such as search for coal and be caught inside a infinate loop)

Skillery

2013-05-18 12:55:59

Thank you both, i was already thinking, 'no end needed in pascal?'

Officer barbrady, I do not totally understand your code. Why would it exit if not loggedin? Could you explain it a bit more? ^^

rj

2013-05-18 13:12:32

From: Skillery
Thank you both, i was already thinking, 'no end needed in pascal?'

Officer barbrady, I do not totally understand your code. Why would it exit if not loggedin? Could you explain it a bit more? ^^

Ok so let's say it's in the coal mining procedure, and the character logs out. The script is going to be looking for the coal but it's not logged in, so if you do that check, it will "exit" the procedure or function.

Skillery

2013-05-18 13:14:57

From: Officer Barbrady
Ok so let's say it's in the coal mining procedure, and the character logs out. The script is going to be looking for the coal but it's not logged in, so if you do that check, it will "exit" the procedure or function.


Aah okay, that is very clear
Thanks for the help, i am not sure if i just gave the officer 2 rep or both one :/