Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4715
Location: Pensacola, FL, USA

PostPosted: Sat Aug 02, 2008 9:24 am   

%ctime
 
%ctime the number of seconds you have been connected to the MUD

I was messing around and did the following some time after i had logged off.

#say %ctime

And a got a positive result, should i be getting a positive number at all if I am not currently connected?
_________________
Discord: Shalimarwildcat
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sat Aug 02, 2008 10:12 am   
 
It has always been that way. If you look down in the status bar where the connection time is displayed you will see it holds the value after a disconnect, and is zeroed on a reconnect. I think it was done this way in case anyone wanted to check/record how long they were actually online after a disconnect.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4715
Location: Pensacola, FL, USA

PostPosted: Sat Aug 02, 2008 6:16 pm   
 
Well, is there a good way to tell if the connection is currently active or not?
_________________
Discord: Shalimarwildcat
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Sat Aug 02, 2008 6:25 pm   
 
Well, you could change the value of a variable in the OnConnect and OnDisconnect events... I'm not sure if there is function specifically for this.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sat Aug 02, 2008 8:58 pm   
 
I use the onConnect and onDisconnect method. As far as I know onDisconnect still is called when a reconnect attempt fails, so you may have to take that into account with any script you build. You can also store the %ctime into another variable and use and alarm to check it again later; if it hasn't changed then you are not connected.

There still isn't a general sort of %connected predefined variable anywhere. I think I might have asked for such a thing once, but was shot down. Maybe it is time to ask again, hint hint you should ask.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net