Jump to content

Dial-up Networking: Reconnect if Ping larger than Specific Number


Recommended Posts

Hello,

I'm new with autoit and i knew very basic command to make dial-up connection and ping like below

run("rasdial my-dial-up")

Local $var = Ping("8.8.8.8", 2000)
If $var > 182 Then; also possible:  If @error = 0 Then ...
    MsgBox(0, "Status", "Online, roundtrip was:" & $var)

Else
    MsgBox(0, "Status", "An error occured with number: " & @error)
EndIf

my question is how to make loop connection and loop ping? the idea is:

1. establish dial up connection

2. run ping max 5 times to find ping times under 100ms

3. if ping found show message box and exit the script

4. if ping not found disconnect and connect again the connection and repeat point number 2

Thanks

Link to comment
Share on other sites

1 ) you already have

2 ) create a function and run the function in a loop (E.g. : Do until $times = 5 or $PingUnder100Ms = True

3 ) no problem

4 ) run function _connect again

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...