AlexFing17

Need Help with a Script

6 posts in this topic

#1 ·  Posted

i want a script that

"on the beginning of the program it pings to check if there is internet connectivity.

if there is internet connectivity
then it executes my code

else if there is no internet it waits at background to detected internet connectivity then executes my code."

 

Is this possible


 

Share this post


Link to post
Share on other sites



#2 ·  Posted

Yes. Ingredients : While loop + If/Then/Else condition + Ping function (all in the helpfile)  :)

1 person likes this

Share this post


Link to post
Share on other sites

#4 ·  Posted

Well, I forgot to mention this one because it doesn't work on my ole XP  :D

Share this post


Link to post
Share on other sites

#5 ·  Posted

There is an example in the code snippet section of the wiki:
https://www.autoitscript.com/wiki/AutoIt_Snippets#IsInternetConnected

1 person likes this

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#6 ·  Posted

BTW: Could you please give meaningful titles to your threads? Everyon on this forum is looking for help ;)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

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

  • Similar Content

    • LOWLIFE
      By LOWLIFE
      This is a personal project to log into several facebook accounts and send a message to a specific person on their birthday. I need to stop a script in a few different ways for several different reasons. For example, it might start sending the email to the wrong account, it might do something other than send a message, it might fail to logout of one account, etc. 
      1) Pause the script at it's exact location with a resume feature in case I need to put it on hold while I do another task. 
      2) Pause the script at it's current location with the option to start over or execute another part of the script (example in GUI with multiple buttons). 
      Also, is there a way to interact with menus? If I log into facebook how can I force it to go straight to sending a message to the proper person? I tried automating a mouseclick but the window opens in different places. I also tried searching for specific text and I couldn't get any information from the windows info tool on the facebook page. 
      Also, how do I get my code in here to show like it does in my editor? (scite)
      Thanks for looking at it, and any help/suggestions I sgreatly appreciated!
      <snip>
    • Ian_Mac
      By Ian_Mac
      Okey guys , here's the thing, My script is running fine, but when it's already running i cant   turn it off or pause by clicking the on/off button  unless i manually close it on my taskbar. What i wanted to happen is "if i click the ($switch = turn On and Off Button) to Off the script will STOP Running but not closing the entire GUI because i tried to use Exit and ExitLoop but it closes the entire GUI. and i don't want that to happen.  
      BTW. I'm new in AutoIT and practice scripting hope somebody could help me  Godbless. feel free to view my script
      Practice.au3
    • IamKJ
      By IamKJ
      So I have a lot of different functions in the little program I'm making.  Most of them use the Do statement, such as finding images, clicking buttons, etc.
       
      The question I have is how would I be able to both
      1) Create a hotkey to pause whatever I am doing at the moment.  If I have to put something into every function in the program, I don't mind.
      2) Create a hotkey to exit whatever I am doing and stop all loops or commands and bring back the main GUI?
    • tk1
      By tk1
      Hello,
      Is there a way, preferably natively within AutoIt, to replicate:
      ping -i 2 <nearby_IP>
      The ping() function only has an option to set the timeout, but I want to set the TTL to 2 instead.
       
      Thanks,
      tk1
    • ur
      By ur
      I want to check whether machine is up or not after we poweron a VM.
      So to check that, I am using ping.
      With the below command, when we run it, it will capture the value success or not with the errorlevel.
      ping -n 1 sinra09-lod11 >nul: 2>nul: so we can track the return code back using below.
      echo %errorlevel% So it is able to return the 1 when it is failure and 0 when it is success.
       
      But when I convert the above commands to AutoIT, the return code is always giving 0 even on failure.
      MsgBox(0,pingCheck("sinra09-lod11"),"sinra09-lod11") Func pingCheck($system_name) ;$system_name = "sinra09-lod1" $command = @SystemDir&"\ping.exe -n 1 "& $system_name & " >nul: 2>nul:" ConsoleWrite($command) Local $iReturn = RunWait($command) ;MsgBox(0,$system_name,$iReturn) ConsoleWrite($iReturn) if $iReturn = 0 then Return True Else Return False EndIf EndFunc Please suggest..