Jump to content



Photo

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


  • Please log in to reply
1 reply to this topic

#1 ewwink

ewwink

    Seeker

  • New Members
  • 1 posts

Posted 23 March 2012 - 07:02 AM

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





#2 Xenobiologist

Xenobiologist

    Xx Code~Mega xX

  • MVPs
  • 4,729 posts

Posted 23 March 2012 - 10:40 AM

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 *newYahtzee 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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users