Jump to content

downloading files with autoit


Recommended Posts

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

Link to comment
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.
Link to comment
Share on other sites

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
Link to comment
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.
Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...