Jump to content

Code problem


Recommended Posts

Im making a automatic downloader. Heres my code (im newb to autoIT)

#include <GUIConstants.au3>

GUICreate("DL'er")

$chooseCombo = GUICtrlCreateCombo ("Steam", 10,10)
GUICtrlSetData(-1,"Mirc|winzip|hero editor|Winamp|Runeword Wizard|Patch 1.10 (d2)|Soldat|Winrar|Firefox||","MSN")

$goButton = GUICtrlCreateButton ("go",  250, 10, 100)
$soButton = GUICtrlCreateButton ("stop download",  250, 99, 100)
GuiCtrlCreateAvi("sampleAVI.avi",0, 215, 10, 32, 32, $ACS_AUTOPLAY)
GuiCtrlCreateLabel("Select your file, and click GO", 170, 50)

GUISetState ()

While 1
    $msg = GUIGetMsg()       ; this is where the error is
    If $msg = $soButton then
    InetGet("abort")
    else
    If $msg = $goButton Then
        If GuiCtrlRead($chooseCombo) = "Steam" Then
            MsgBox(0, '', 'You selected steam!')
InetGet("http://www.steampowered.com/download/SteamInstall.exe", "steam.exe", 1, 1)

        ElseIf GuiCtrlRead($chooseCombo) = "Mirc" Then
            MsgBox(0, '', 'You selected Mirc')
InetGet("http://www.mr-fister.dk/~mirc/mirc616.exe", "mirc.exe", 1, 1)

        ElseIf GuiCtrlRead($chooseCombo) = "winzip" Then
            MsgBox(0, '', 'You selected winzip!')
InetGet("http://www.winzip.com/downauto.cgi?file=winzip90.exe", "Winzip.exe", 1, 1)    

        ElseIf GuiCtrlRead($chooseCombo) = "hero editor" Then
            MsgBox(0, '', 'You selected hero editor')
InetGet("http://www.ladderhall.com/forum/index.php?act=Attach&type=post&id=137664", "hero editor.zip", 1, 1)

        ElseIf GuiCtrlRead($chooseCombo) = "Winamp" Then
            MsgBox(0, '', 'You selected Winamp')
InetGet("http://download.nullsoft.com/winamp/client/winamp508e_full_emusic-7plus.exe", "Winamp.exe", 1, 1)

        ElseIf GuiCtrlRead($chooseCombo) = "Runeword Wizard" Then
            MsgBox(0, '', 'You selected Runeword Wizard')
InetGet("ftp://212.67.120.244/other/loaded/diablo2/utilities/runewizard.zip", "RunewordWizard.zip", 1, 1)

        ElseIf GuiCtrlRead($chooseCombo) = "Patch 1.10 (d2)" Then
            MsgBox(0, '', 'You selected Patch 1.10 (d2)')
InetGet("http://ftp1.gamesweb.com/babq4884/D2Patch_110.exe", "Patch110.exe", 1, 1)

        ElseIf GuiCtrlRead($chooseCombo) = "Soldat" Then
            MsgBox(0, '', 'You selected Soldat')
InetGet("soldat-www.wargamez.dk/nopz/soldat/soldat121.zip ", "soldat121.zip", 1, 1)

        ElseIf GuiCtrlRead($chooseCombo) = "Winrar" Then
            MsgBox(0, '', 'You selected Winrar')
InetGet("http://www.rarlab.com/rar/wrar342dk.exe", "wrar342dk.exe", 1, 1)

        ElseIf GuiCtrlRead($chooseCombo) = "Firefox" Then
            MsgBox(0, '', 'You selected Firefox')
InetGet("http://download.mozilla.org/?product=firefox&os=win&lang=da-DK", "Firefox.exe", 1, 1)
      ;;; and so on....
    EndIf
    SoundPlay('complete.wav')
ElseIf $msg = $GUI_EVENT_CLOSE Then
        ExitLoop
    EndIf
Wend
Edited by 8218
Link to comment
Share on other sites

  • Developers

Im making a automatic downloader. Heres my code (im newb to autoIT)

<{POST_SNAPBACK}>

Ahh.. and you make us guess what the error is right ??? :lmao:

This is the output from Tidy...maybe that helps....

#include <GUIConstants.au3>
GUICreate("DL'er")
$chooseCombo = GUICtrlCreateCombo("Steam", 10, 10)
GUICtrlSetData(-1, "Mirc|winzip|hero editor|Winamp|Runeword Wizard|Patch 1.10 (d2)|Soldat|Winrar|Firefox||", "MSN")
$goButton = GUICtrlCreateButton("go", 250, 10, 100)
$soButton = GUICtrlCreateButton("stop download", 250, 99, 100)
GUICtrlCreateAvi("sampleAVI.avi", 0, 215, 10, 32, 32, $ACS_AUTOPLAY)
GUICtrlCreateLabel("Select your file, and click GO", 170, 50)
GUISetState()
While 1
    $msg = GUIGetMsg()        ; this is where the error is
    If $msg = $soButton Then
        InetGet("abort")
    Else
        If $msg = $goButton Then
            If GUICtrlRead($chooseCombo) = "Steam"  Then
                MsgBox(0, '', 'You selected steam!')
                InetGet("http://www.steampowered.com/download/SteamInstall.exe", "steam.exe", 1, 1)
            ElseIf GUICtrlRead($chooseCombo) = "Mirc"  Then
                MsgBox(0, '', 'You selected Mirc')
                InetGet("http://www.mr-fister.dk/~mirc/mirc616.exe", "mirc.exe", 1, 1)
            ElseIf GUICtrlRead($chooseCombo) = "winzip"  Then
                MsgBox(0, '', 'You selected winzip!')
                InetGet("http://www.winzip.com/downauto.cgi?file=winzip90.exe", "Winzip.exe", 1, 1)
            ElseIf GUICtrlRead($chooseCombo) = "hero editor"  Then
                MsgBox(0, '', 'You selected hero editor')
                InetGet("http://www.ladderhall.com/forum/index.php?act=Attach&type=post&id=137664", "hero editor.zip", 1, 1)
            ElseIf GUICtrlRead($chooseCombo) = "Winamp"  Then
                MsgBox(0, '', 'You selected Winamp')
                InetGet("http://download.nullsoft.com/winamp/client/winamp508e_full_emusic-7plus.exe", "Winamp.exe", 1, 1)
            ElseIf GUICtrlRead($chooseCombo) = "Runeword Wizard"  Then
                MsgBox(0, '', 'You selected Runeword Wizard')
                InetGet("ftp://212.67.120.244/other/loaded/diablo2/utilities/runewizard.zip", "RunewordWizard.zip", 1, 1)
            ElseIf GUICtrlRead($chooseCombo) = "Patch 1.10 (d2)"  Then
                MsgBox(0, '', 'You selected Patch 1.10 (d2)')
                InetGet("http://ftp1.gamesweb.com/babq4884/D2Patch_110.exe", "Patch110.exe", 1, 1)
            ElseIf GUICtrlRead($chooseCombo) = "Soldat"  Then
                MsgBox(0, '', 'You selected Soldat')
                InetGet("soldat-www.wargamez.dk/nopz/soldat/soldat121.zip ", "soldat121.zip", 1, 1)
            ElseIf GUICtrlRead($chooseCombo) = "Winrar"  Then
                MsgBox(0, '', 'You selected Winrar')
                InetGet("http://www.rarlab.com/rar/wrar342dk.exe", "wrar342dk.exe", 1, 1)
            ElseIf GUICtrlRead($chooseCombo) = "Firefox"  Then
                MsgBox(0, '', 'You selected Firefox')
                InetGet("http://download.mozilla.org/?product=firefox&os=win&lang=da-DK", "Firefox.exe", 1, 1)
            ;;; and so on....
            EndIf
            SoundPlay('complete.wav')
        ElseIf $msg = $GUI_EVENT_CLOSE Then
            ExitLoop
        EndIf
;### Tidy Error: Level error -> Wend is closing previous If
    WEnd
Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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...