Sign in to follow this  
Followers 0
will88

downloading files with autoit

7 posts in this topic

I'm trying to download a file to a certain location(C:\Downloads)

this is what I have so far:

$Name = 'Omen.rar'
$URL = "http://files.wowace.com/Omen/Omen.zip"
InetGet($URL,$Name,0,1)

It downloads the file to where, the last file was downloaded to.

I've tried to using filesavedialog() but then I have to click the save button

Share this post


Link to post
Share on other sites



I'm trying to download a file to a certain location(C:\Downloads)

this is what I have so far:

$Name = 'Omen.rar'
$URL = "http://files.wowace.com/Omen/Omen.zip"
InetGet($URL,$Name,0,1)

It downloads the file to where, the last file was downloaded to.

I've tried to using filesavedialog() but then I have to click the save button

Haven't you tried

$Name = "C:\Downloads\Omen.rar"

?

But why Omen.rar when you are downloading Omen.zip?


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Haven't you tried

$Name = "C:\Downloads\Omen.rar"

?

But why Omen.rar when you are downloading Omen.zip?

Thanks, Idk why I didnt think of that -.-

omen is an addon for world of warcraft that gets updated about everyday for some reason, so I made an autoit script to update it. But now it only downloads it and its not doing anything after that..

$Name = 'C:\Downloads\Omen.rar'
$URL = "http://files.wowace.com/Omen/Omen.zip"
InetGet($URL,$Name,0,1) then
tooltip( "Extracting Addon..." , 69 , 14 , "" , 0 , 4 )
If FileExists("C:\Downloads\Omen.zip")
Send("#r");opens run
sleep(500)
send("C:\Downloads\Omen.zip{enter}")
winwait("Omen.zip - WinRAR")
sleep(500)
send('{altdown}w{altup}');extract
sleep(2000)
send('{altdown}{f4}{altup}');close winrar
sleep(1000)
If FileExists("C:\Downloads\Omen.zip") Then
filedelete( "C:\Downloads\Omen.zip")
tooltip( "Moving Addon to WoW folder." , 69 , 14 , "" , 0 , 4 )
sleep(1000)
DirMove( "C:\Downloads\Omen", "C:\Program Files\World of Warcraft\Interface\Addons\" , 1 )
tooltip("")


            $answer = MsgBox(4, "World of Warcraft", "Would you like to run WoW?")
            If $answer = 7 Then
            EndIf
            If $answer = 6 Then
            Run('"C:\Program Files\World of Warcraft\Launcher.exe"')
            Exit
        EndIf
    EndIf
    EndIf
Edited by will88

Share this post


Link to post
Share on other sites

Thanks, Idk why I didnt think of that -.-

omen is an addon for world of warcraft that gets updated about everyday for some reason, so I made an autoit script to update it. But now it only downloads it and its not doing anything after that..

$Name = 'C:\Downloads\Omen.rar'
$URL = "http://files.wowace.com/Omen/Omen.zip"
InetGet($URL,$Name,0,1) then
tooltip( "Extracting Addon..." , 69 , 14 , "" , 0 , 4 )
If FileExists("C:\Downloads\Omen.zip")
Send("#r");opens run
sleep(500)
send("C:\Downloads\Omen.zip{enter}")
winwait("Omen.zip - WinRAR")
sleep(500)
send('{altdown}w{altup}');extract
sleep(2000)
send('{altdown}{f4}{altup}');close winrar
sleep(1000)
If FileExists("C:\Downloads\Omen.zip") Then
filedelete( "C:\Downloads\Omen.zip")
tooltip( "Moving Addon to WoW folder." , 69 , 14 , "" , 0 , 4 )
sleep(1000)
DirMove( "C:\Downloads\Omen", "C:\Program Files\World of Warcraft\Interface\Addons\" , 1 )
tooltip("")


            $answer = MsgBox(4, "World of Warcraft", "Would you like to run WoW?")
            If $answer = 7 Then
            EndIf
            If $answer = 6 Then
            Run('"C:\Program Files\World of Warcraft\Launcher.exe"')
            Exit
        EndIf
    EndIf
    EndIf
It looks to me like you try to open a file that doesn't exist. you downloaded as .rar as I said in my previous post, but you try to run .zip.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Actually,it will work ,because it downloads .zip and searchs for .zip.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Yes, check your file extensions as mentioned above.

Also, try running winrar from the command line:

RunWait("C:\path-to\winrar.exe x * C:\path-to-wow-addons-folder")

Check your winrar documentation to make sure that's right, I haven't used it in a while.

Edit:

As for the filenames, this is what I saw in the posted code:

$Name = 'C:\Downloads\Omen.rar'

$URL = "http://files.wowace.com/Omen/Omen.zip"

send("C:\Downloads\Omen.zip{enter}")

So if run cannot find the file, it cannot run it.

Edited by Falcon213

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

thanks for the help everyone, Its working again. had a typo in the $Name variable

Edited by will88

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