Jump to content
Sign in to follow this  
ewwink

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

Recommended Posts

ewwink

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

Share this post


Link to post
Share on other sites
Xenobiologist

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

Share this post


Link to post
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
Sign in to follow this  

×