Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Interactive 'Keep-Alive'

Interactive 'Keep-Alive'

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Drraagh   (4 posts)  Bio
Date Thu 09 Nov 2006 05:11 AM (UTC)
Message
There's one thing I've noticed with my connection to certain MU*s, no matter what client I use, and no matter how I toy with the settings of my connection. That is that I get a connection that freezes unless there is data regularlly sent on the line. ON one, I did a series of Semaphores on my character which still allows me to idle out if I go AFK or whatever, but on others I can't get that set up due to whatever restrictions they have.

My workaround for that is for me to send a trigger message to the server every five minutes. Not the prettiest, but something that works. The problem is, that I go AFK and my connection could still go for hours. I haven't looked at scripting yet as the idea just hit me, but I am just wondering if the idea is possible given the system in place before I go looking.

What I want to have is a script that times when I log on, runs some sort of idle keep-alive, but every hour or so (the usual idle-out time for MUs), my client prompts me for some interaction before cutting the connection. My Dial up connection back so long ago used to do that with a popup I had to click OK to or it would disconnect.

I'm going to start researching scripting for other ideas I had, but for this one, I am mainly concerned if it's possible before I start spending time working on it for nothing.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Thu 09 Nov 2006 05:59 AM (UTC)
Message
Yes, that is pretty easy to do.

You could make a plugin, and in it put a handler for OnPluginCommandEntered. In that you could remember the time of the last command actually typed (for going AFK).

Then you could make a timer that checks the time now, compared to the time of the last command. That timer could fire every minute. Of course, the same timer can send something to keep the connection alive as well.

In fact, you can use OnPluginSent to find the last time something was sent to the MUD, and thus not send your "keep alive" if something else was sent recently.

I don't know about the dialog box, because it would sit there waiting for you to press OK, and thus not drop the connection. But, you could play a sound, display a message in red, and if you don't type anything in the next minute, drop the connection. Of course, typing anything should cancel the timeout anyway. Thus all you really need to do is something like, at > 60 minutes but < 61 minutes, display the message, and > 61 minutes, drop the connection.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #2 on Sun 19 Nov 2006 07:07 PM (UTC)
Message
See this post:

http://www.gammon.com.au/forum/?id=7488

This does a similar thing, and if you altered it slightly to make the timer function actually send something to keep it connected, then it does exactly what you want.

Or, add another timer that sends some sort of "keep alive" command which fires every couple of minutes.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


16,564 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.