Sign in to follow this  
Followers 0
Wolfshare

Support me a bit

11 posts in this topic

Hello, i have the script, it works almost perfect, but one problem, when internet connection dead, and after it's renew ( i mean reset to normal and continue work) the script not working, because it waiting untill the download will be completed.

Script downloading file, but if internet connection dead, the download will pauze, and after it will work sucess the downloading not continuing, so i have to fix the script somehow to make timer or what to restart it every like ~60 second...

The code:

FileDelete("C:\Atsisiuntimai\Setup.exe")
FileDelete("C:\Atsisiuntimai\Setup.exe.part")
$i = 0
$x = 0
$r = 0
$t = 0
While $i <= 10
    Do
        Run("Conexion.cmd")
        WinWaitActive("AOL 9.5 - Connected, Signed-On", "", 60)
        If WinExists("AOL 9.5 - Connected, Signed-On") Then $x = 1
    Until $x = 1
    If WinExists("Deposit file - Mozilla Firefox") Then
        WinActivate("Deposit file - Mozilla Firefox")
    EndIf
    WinActivate("Deposit file - Mozilla Firefox")
        WinActivate("Atsiuntimo klaida")
    Send("{ENTER}")
    Sleep(500)
    MouseMove(198, 589)
    MouseClick("left")
    MouseMove(31, 60)
    MouseClick("left")
    MouseMove(258, 429)
    MouseClick("left")
    Sleep(500)
    MouseMove(268, 589)
    MouseMove(663, 589)
    Send("{CTRLDOWN}{PGDN}{CTRLUP}")
    Sleep(500)
    Do
        Sleep(1000)
        $t = $t + 1
    Until (FileExists("C:\Atsisiuntimai\Setup.exe") And Not FileExists("C:\Atsisiuntimai\Setup.exe.part")) Or ($t = 60 And Not FileExists("C:\Atsisiuntimai\Setup.exe") And Not FileExists("C:\Atsisiuntimai\Setup.exe.part")) Or (WinExists("Atsiuntimo klaida"))
    If WinExists("Atsiuntimo klaida") Or WinExists("Restarting Aol") Then
        Do
            WinActivate("Atsiuntimo klaida")
            WinActivate("Restarting Aol")
        Until WinActive("Atsiuntimo klaida") Or WinActive("Restarting Aol")
        Send("{ENTER}")
    EndIf
    If WinExists("Deposit file - Mozilla Firefox") And Not WinActive("Deposit file - Mozilla Firefox") Then WinActivate("Deposit file - Mozilla Firefox")
    FileDelete("C:\Atsisiuntimai\Setup.exe")
    FileDelete("C:\Atsisiuntimai\Setup.exe.part")
    Sleep(500)
    $x = 0
    $r = 0
    $t = 0
WEnd

Anyone can Support me?

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Yes, on Dialup. Home Network, from My computer - on wireless.

Edited by Wolfshare

Share this post


Link to post
Share on other sites

Uh, someone?

Share this post


Link to post
Share on other sites

Looking at your Do loop I have a question, is there the possibility that Setup.exe and Setup.exe.part exist in the folder at the same time? If so you're not going to exit out of the loop. Also, in your second check where you check after 60 seconds for the files, you're looking to see if both files don't exist in the folder, if either file is in the folder after your 60 seconds has elapsed you won't exit the loop.

I think you need to look at your Do loop conditions to make sure that they are the way you want them to be. BTW, you never increment the $I variable, so it will always be <10 and your While loop will loop forever.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Maybe better use the InetGet() function? Take a look at the help-file sample.

Eh, thanks but i tried, i can't write sucess script with Inget :< its to hard :[[[ Tried today.

Share this post


Link to post
Share on other sites

Looking at your Do loop I have a question, is there the possibility that Setup.exe and Setup.exe.part exist in the folder at the same time? If so you're not going to exit out of the loop. Also, in your second check where you check after 60 seconds for the files, you're looking to see if both files don't exist in the folder, if either file is in the folder after your 60 seconds has elapsed you won't exit the loop.

I think you need to look at your Do loop conditions to make sure that they are the way you want them to be. BTW, you never increment the $I variable, so it will always be <10 and your While loop will loop forever.

Mhh, would be nice if after that 60 seconds anyway, doesn't care setup.exe exist or doesn't, but would be nice if the script restart itself.

Now it should only wait untill Setup.exe will exist, Setup.exe.part come with setup.exe while it's downloading.

Share this post


Link to post
Share on other sites

anyone? ;)

Share this post


Link to post
Share on other sites

Or just is that possible to make command which will cancell uncompleted downloads in the script ToP? Like that(download which are lagged)

Posted Image

Share this post


Link to post
Share on other sites

Please someone :S

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