Sign in to follow this  
Followers 0
phatzilla

Help me with my script!

7 posts in this topic

#1 ·  Posted (edited)

Basically i figured out the rest of my script but am missing a part.

What i want it is to do this:

First of all, the script will not 'start' (Or rather, will 'wait')untill it detects an internet connection.(How do i do that?)

Next

It Does a check for a certain file in my c drive (lets call it C:\xxx.jpg).

Now, If this file exists, it just ends the script and that's all.

But, if the file Doesn't exist, then it will proceed to download it from (www.xxx.com/xxx.jpg).

Then it will proceed to run the file. Then it will exit.

Can i get any help on this? Thanks in advance.

Edited by phatzilla

Share this post


Link to post
Share on other sites



something like this

TCPStartup()
while TCPNameToIP("www.google.com") = ""
    Sleep (5000)
WEnd

If NOT FileExists ("C:\xxx.jpg") then InetGet("http://www.xxx.com/xxx.jpg", "C:\xxx.jpg", 1, 0)

TCPShutdown ( )

Share this post


Link to post
Share on other sites

Thanks chris!, i am just wondering though what does the TCPstartup and Shutdown do?

Share this post


Link to post
Share on other sites

Thanks chris!, i am just wondering though what does the TCPstartup and Shutdown do?

hey, if you don't know a code, u can always use the AutoIt Help that's given to you

in the AutoIt installation.

Or you can use the online help:

here's the answer:

TCPStartup

http://www.autoitscript.com/autoit3/docs/f.../TCPStartup.htm

TCPShutdown

http://www.autoitscript.com/autoit3/docs/f...TCPShutdown.htm

alright,

- me

Share this post


Link to post
Share on other sites

How silly of me. Thanks.

Share this post


Link to post
Share on other sites

So the way im understanding it is every 5 seconds it will check for an active internet connection (By trying to reach google.com) and untill it pings it successfully it wont continue the program?

Share this post


Link to post
Share on other sites

So the way im understanding it is every 5 seconds it will check for an active internet connection (By trying to reach google.com) and untill it pings it successfully it wont continue the program?

Pretty much yeah, it doesn't ping it just resolves the name to IP if it resolves the name then there is a connection if not it just loops and checks every 5 seconds

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  
Followers 0