Jump to content
Macro Express Forums

Disconnection


H2o-KiD

Recommended Posts

Okay, I am using macro express for a game. And my connection line wasn't too good and sometimes it might disconnect and then auto reconnect. Once disconnected, the macro is still doing the job but the game is disconnected from the server. I am a newbie anyway, that's why I am asking for solution :D May I ask if that macro express can detect disconnection and then it will do a special task after detected it? In example : The macro detected disconnection and it will then auto relogin the game and continue the normal job. Help is really appreciated.

Link to comment
Share on other sites

Try the Ping Site command. You can either ping the server that is running the game or some other server on the Internet.

 

The Ping Site command returns a result similar to these:

 

If the ping succeeded:

209.197.94.249 TTL=53, Bytes=72, Time=109ms
If the ping failed:
Unknown host
Link to comment
Share on other sites

I've tried this and it is still not working. It will eventually show the text box display eventhough it is not disconnect but not immediately.

 

 

Repeat Until %T1% = "testing"

If Ping Successful: "208.68.90.106"

Else

Text Box Display: Disconnected

Repeat End

End If

 

Please help @_@

Link to comment
Share on other sites

The sample macro has a syntax error. The Repeat End command shows where the repeat loop ends. It does not cause the repeat loop to stop. You want to use the Break command instead.

  Repeat Until %T1% = "testing"
   If Ping Successful: "208.68.90.106"
   Else
     Text Box Display: Disconnected
     Break
   End If
 Repeat End

Note that this macro depends on the server responding within the maximum amount of time specified in the If Ping Successful command. The 'Maximum Time to Wait' defaults to 5 seconds. If the server (or your ISP) slows down for a moment and doesn't respond within 5 seconds the text box will be displayed. You might want to do an additional check, perhaps with a different server, before making the determination that the connection has been disconnected.

Link to comment
Share on other sites

I've tried to wait more but still end up screwing up. So I used the "Ping Site" command.

 

Ping Site "208.68.90.106" and store result in %T1%

If Variable %T1% does not contain "208.68.90.106"

Text Box Display: "Disconnected"

End If

 

Okay, so I am using a router too. Therefore when I try to close my "router" and try to Ping Site for "208.69.90.106", it gives me "T1 = Unknown host". Okay, but the main problem is, when I close my modem, it doesn't give me the same "Unknown host", it gives me

"T1 = 0.0.0.0 TTL=0, Bytes=0, Time=0ms". Now this is complicated and if the closure of modem and router gives the same value, the problem would be fixed by now. Sometimes, even the connection is online, it still gives

"T1 = 0.0.0.0 TTL=0, Bytes=0, Time=0ms".

Link to comment
Share on other sites

All the Ping commands do is to see if a specific server responds. The unusual results come from the remote server, your firewall, or your router. You should be able to check for a variety of responses and program your macro accordingly.

 

Note that if a specific server fails to respond that does not necessarily mean that your connection to the Internet has been disconnected. That server, or the route to that server, may be down temporarily. That is why I suggest that you check more than one server to determine whether you are disconnected.

Edited by kevin
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...