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 » Thu Jun 13, 2019 3:25 pm

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: 4727
Joined: Sat Mar 14, 2009 3:13 pm

Re: Catch the status of connection

Post by Vadi » Fri Jun 14, 2019 3:18 pm

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 » Sat Jun 15, 2019 4:14 pm

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: 4727
Joined: Sat Mar 14, 2009 3:13 pm

Re: Catch the status of connection

Post by Vadi » Sat Jun 15, 2019 4:47 pm

Cool, enjoy!

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests