Catch the status of connection

Post Reply
vingi
Posts: 2
Joined: Thu Jun 13, 2019 3:19 pm

Catch the status of connection

Post by vingi »

hi all.
I'm trying to migrate from mushclient to mudlet, and i got a question here...
are there any ways/functions, even tricks to get the current connection status in mudlet just like GetConnectDuration() in mush?
i have looked up all the lua function API, but they seem not work..
i appreciate if anyone can help me...

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Catch the status of connection

Post by Vadi »

You can connect to the connect event: https://wiki.mudlet.org/w/Manual:Event_ ... ctionEvent and then start a stopwatch to count how long you've been connected for :)

See https://wiki.mudlet.org/w/Manual:Event_Engine on how to use events in Mudlet.

vingi
Posts: 2
Joined: Thu Jun 13, 2019 3:19 pm

Re: Catch the status of connection

Post by vingi »

Thanks a lof for your help..
I make a new function for binding sysConnectionEvent and the other one bind sysDisconnectionEvent to get the status of connection..it works...
I've never noticed there are such 2 events here, thanks for telling me...and im gonna read the wiki more :)

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Catch the status of connection

Post by Vadi »

Cool, enjoy!

Post Reply