|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4715 Location: Pensacola, FL, USA
|
Posted: 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 |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: 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 |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4715 Location: Pensacola, FL, USA
|
Posted: 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 |
|
|
|
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: 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.
|
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: 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 |
|
|
|
|
|