|
savanna Beginner
Joined: 27 Mar 2004 Posts: 27
|
Posted: Sat Mar 27, 2004 3:49 pm
How to carry out the function of "autoconnect"? |
I mean achieve autoconnection instead of settings in zmud.
As is known to everyone, zmud can help us autoconnect the mud 20 times, and later stop working.
Therefore, most of us usually cancel the function of "autoconnect". However, the problem is how to judge when the mud is cut down and to reconnct it.You see, the zmud can get the information of connection . How can we program Scripts instead? Would anyone have a good idea? I kindly remind that when the network can't work rightly, there wouldn't be any hint. To another word, trigger can't work!
Thank you all. |
|
|
|
Pega Magician
Joined: 08 Jan 2001 Posts: 341 Location: Singapore
|
Posted: Sun Mar 28, 2004 8:41 am |
Use the atdisconnect alias to set up a reconnection command in your tick timer.
|
|
|
|
savanna Beginner
Joined: 27 Mar 2004 Posts: 27
|
Posted: Mon Mar 29, 2004 5:58 am |
Someone tell me set up these words in zmud so that zmud could judge the present network status intelligently:
#al atconnect {#va connected 1;#va autoreconenabled 1;#log mylog.txt;%char;%pass;y;#cr;y}
#al atdisconnect {#va connected 0;#if (@autoreconenabled=1) {#con}}
I don't know how it works.Could you kindly give me the explanation pleases?How these words judge the network connecting to mud is lost now? If anyone can judge this, the problem can easily work out.
Why I need to "set up a reconnection command in your tick timer"? If I set up any command in tick timer, that namely my zmud will execute the commands regularly. You mean I must reconnet to the mud every a period of time?Could you give me an example?thank you! |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Mon Mar 29, 2004 1:28 pm |
The atconnect alias is called when zMUD is connected to a MUD. In this case, it will set the @connected variable to 1, @autoreconenabled to 1, start logging the MUD output, send the name of the current character, send the password of the current character, send "y", send an Enter, and send "y".
The atdisconnect alias is called when zMUD is disconnected from a MUD. In this case, it will set the @connected variable to 0, and if @autoreconenabled is 1 it will try to connect again.
These two aliases alone will not do what you want about guessing if the MUD is down or not. Also, if the Auto Reconnect option is disabled in zMUD, it will only try to reconnect one time.
If you want to try to determine if the MUD is down, you need to set up your own reconnect system. What it should do is to try to connect a number of times (10, for example) and if it can't, wait a fixed amount of time (maybe 5 minutes) and try again. zMUD does this with the Auto Reconnect option, but only two times. To do it indefinitely, this should work:
#ALIAS atdisconnect {#IF (!@attempts) {#VAR attempts 10;#ALARM {+300} {#CONNECT}} {#ADD attempts -1;#CONNECT}}
#ALIAS atconnect {#VAR attempts 10} |
|
|
|
savanna Beginner
Joined: 27 Mar 2004 Posts: 27
|
Posted: Tue Mar 30, 2004 6:49 pm |
Thank you for your helpful reply.It seems my english is not good enough to express myself clearly.Actually, I understand myfriend's programs as well as yours, which confusing me is how these words KNOW it is disconnected now or the network is cut down. Because both of your programs is just ALIAS different with commands. I believe it must the function of auto-reconnect plus your words to make the zmud work eternally.Am I right? Otherwise, if you cancel the function of auto-reconnect, it will confuse me how your words work automatically while the Internet is unavailable?
|
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Tue Mar 30, 2004 7:36 pm |
The atconnect and atdisconnect are two special aliases that may or may not be defined by a user. When zMUD connect to a MUD, it automatically calls the atconnect alias if it exists. Similarly, when zMUD is disconnected from a MUD, it autmatically calls the atdisconnect alias if it exists.
Thus, there is no need for the script to know when it has been disconnected from the MUD since zMUD will only execute it when this happens. Also, when zMUD attempts to connect to a MUD and fails (which would most likely be because the MUD is down or there is no connection to the Internet), the atdisconnect alias is called too.
It is because of the properties of these two aliases (how they are called) that they are able to know when the connection to the MUd has been lost and attempt to connect again.
For the script that I supplied, the auto-reconnect feauture of zMUD should be disabled. Since the atconnect and atdsiconnect aliases will provide the functionality of the auto-reconnect feauture, it is not needed for zMUD to try to reconnect too. |
|
|
|
Pega Magician
Joined: 08 Jan 2001 Posts: 341 Location: Singapore
|
Posted: Tue Mar 30, 2004 7:55 pm |
Simply put, it is a feature in zMUD.
As Kjata has mentioned about the functions of the atconnect and atdisconnect aliases in zMUD. In zMUD, the atdisconnect alias is always called automatically whenever the loss of connection with the host mud is detected.
We use an alarm, event or timer, because we want to set up a short waiting period between each reconnection attempt. If the mud server was down, or your internet connection was broken, or the internet pathway was temporarily inaccessible, you would not want to be spamming reconnections all at once, or indefinately. This has nothing to do with the built-in reconnection system, except that it provides the same sensible idea of waiting between connections.
|
|
|
|
|
|
|
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
|
|