Jump to content

help


8218
 Share

Recommended Posts

Hey

I need help with two simple questions

1. Can autoIT see if you are connected to the internet? and how fast your net speed is?

2. ive made a Download program, shat should download files (see pic), how do i do so, when you click "go" it can see which of the files you have choosen? (code here)

a bit copy/paste from another scripts

#include <GUIConstants.au3>

GUICreate("DL'er")

GUICtrlCreateCombo ("Steam", 10,10)
GUICtrlSetData(-1,"Ad-aware|Photoshop|Spybot|Flash|Dreamweaver|ICQ|","MSN")

GUISetState ()
GUICtrlCreateButton ("go",  250, 10, 100)
GuiCtrlCreateAvi("sampleAVI.avi",0, 215, 10, 32, 32, $ACS_AUTOPLAY)
GuiCtrlCreateLabel("Select your file, and click GO", 170, 50)
GuiCtrlCreateLabel("volume", 235, 215)
GuiCtrlCreateSlider(270, 210, 120, 30)
GuiCtrlSetData(-1, 30)
While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend
Link to comment
Share on other sites

Probably the reason nobody replied is because they know that it's an easy answer if you did a bit of research/reading of the manuals. I will help now just because I have some extra time, but normally I wouldn't.

First you need to assign your controls to variables, otherwise you won't be able to tell what's going on with them.

#include <GUIConstants.au3>

GUICreate("DL'er")

$chooseCombo = GUICtrlCreateCombo ("Steam", 10,10)
GUICtrlSetData(-1,"Ad-aware|Photoshop|Spybot|Flash|Dreamweaver|ICQ|","MSN")

$goButton = GUICtrlCreateButton ("go",  250, 10, 100)
GuiCtrlCreateAvi("sampleAVI.avi",0, 215, 10, 32, 32, $ACS_AUTOPLAY)
GuiCtrlCreateLabel("Select your file, and click GO", 170, 50)
GuiCtrlCreateLabel("volume", 235, 215)
$volumeSlider = GuiCtrlCreateSlider(270, 210, 120, 30); I don't know what you have this for anyway. Seems odd to me.
GuiCtrlSetData(-1, 30)

GUISetState ()

While 1
    $msg = GUIGetMsg()
    
    If $msg = $goButton Then
        MsgBox(0, '', GuiCtrlRead($chooseCombo))
    ElseIf $msg = $GUI_EVENT_CLOSE Then
        ExitLoop
    EndIf
Wend

Now do some reading of the manuals (there's a few links in my signature), and this should be a good starting point.

Link to comment
Share on other sites

like Saunders said, read the help file and u'll find the function for downloading files

<{POST_SNAPBACK}>

i know how to DL files, but how do you do so when you choose steam, and click go, it downloads steam, and if you choose msn, and click go it downloads msn, and if you choose, flash, and click go, it dl's flash?
Link to comment
Share on other sites

i know how to DL files, but how do you do so when you choose steam, and click go, it downloads steam, and if you choose msn, and click go it downloads msn, and if you choose, flash, and click go, it dl's flash?

<{POST_SNAPBACK}>

Have you even tried to run the code Saunders helpfully edited for you?

If you did, then you will see that on selecting a value in the combo box and clicking on Go, you get a message box with the combo box's selected value. This is what you are looking for I believe.

Here's Saunder's code again but with some additions:

#include <GUIConstants.au3>

GUICreate("DL'er")

$chooseCombo = GUICtrlCreateCombo ("Steam", 10,10)
GUICtrlSetData(-1,"Ad-aware|Photoshop|Spybot|Flash|Dreamweaver|ICQ|","MSN")

$goButton = GUICtrlCreateButton ("go",  250, 10, 100)
GuiCtrlCreateAvi("sampleAVI.avi",0, 215, 10, 32, 32, $ACS_AUTOPLAY)
GuiCtrlCreateLabel("Select your file, and click GO", 170, 50)
GuiCtrlCreateLabel("volume", 235, 215)
$volumeSlider = GuiCtrlCreateSlider(270, 210, 120, 30); I don't know what you have this for anyway. Seems odd to me.
GuiCtrlSetData(-1, 30)

GUISetState ()

While 1
    $msg = GUIGetMsg()
    
    If $msg = $goButton Then
        If GuiCtrlRead($chooseCombo) = "Steam" Then
            MsgBox(0, '', 'You selected steam!')
        ElseIf GuiCtrlRead($chooseCombo) = "Ad-aware" Then
            MsgBox(0, '', 'You selected Ad-aware!')
        ElseIf GuiCtrlRead($chooseCombo) = "Photoshop" Then
            MsgBox(0, '', 'You selected Photoshop!')
        ;;; and so on....
        EndIf
    ElseIf $msg = $GUI_EVENT_CLOSE Then
        ExitLoop
    EndIf
Wend

The If/ElseIf..../EndIf block is where you should be looking at for the rest of what you need. It can be done more elegantly of course but I will leave you to figure that out.

Edited by pacman
Link to comment
Share on other sites

thank you packman. Your post have been very helpfull. Ive read the AutoIT hele file, and its says

InetGet("http://www.nowhere.com/somelargefile.exe", "test.exe", 1, 1)

I dont understand. Will it DL somelargefile.exe or test.exe? and where will it DL to?

please

Thx.

Link to comment
Share on other sites

it will donwload somelargefile.exe and then save it in the current directory as test.exe :lmao: and about how to choose steam, msn etc.. you have to do a GUICtrlRead i think to see which item is selected, so like If $list= steam then InetGet (blah blah blah)... i dont know if this helped at all but i got to go now so! o:)

FootbaG
Link to comment
Share on other sites

You will never belive. I have one question more

Hers my code

include <GUIConstants.au3>

GUICreate("DL'er")

$chooseCombo = GUICtrlCreateCombo ("Steam", 10,10)
GUICtrlSetData(-1,"Mirc|winzip|hero editor|Flash|Dreamweaver|ICQ|","MSN")

$goButton = GUICtrlCreateButton ("go",  250, 10, 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()
    
    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)    
       ;;; and so on....
        EndIf
    ElseIf $msg = $GUI_EVENT_CLOSE Then
        ExitLoop
    EndIf
Wend

Can i make a progress bar of a kind, or a "play sound" when its finishd? just something to show the download is finish :lmao:

Link to comment
Share on other sites

You will never belive. I have one question more

Hers my code

include <GUIConstants.au3>

GUICreate("DL'er")

$chooseCombo = GUICtrlCreateCombo ("Steam", 10,10)
GUICtrlSetData(-1,"Mirc|winzip|hero editor|Flash|Dreamweaver|ICQ|","MSN")

$goButton = GUICtrlCreateButton ("go",  250, 10, 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()
    
    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)    
      ;;; and so on....
        EndIf
    ElseIf $msg = $GUI_EVENT_CLOSE Then
        ExitLoop
    EndIf
Wend

Can i make a progress bar of a kind, or a "play sound" when its finishd? just something to show the download is finish :lmao:

<{POST_SNAPBACK}>

thank you ill do that. But is it then

SoundPlay('SoundFile.wav') ElseIf $msg = $GUI_EVENT_CLOSE Then

Link to comment
Share on other sites

i never get answered of:

1. Can autoIT see if youre connected to the internet?

2. Can you make another DL dictory

<{POST_SNAPBACK}>

This is a very slow and painful way of writing your script. I suggest you study the help file thoroughly and familiarise yourself with AutoIT first before attempting to do what you are doing.

As to your 2 questions:

1. Ping("www.google.com")

2. DirCreate("C:\AnotherDownloadDirectory")

Info on these functions are readily available in the accompanying help file.

Link to comment
Share on other sites

This is a very slow and painful way of writing your script. I suggest you study the help file thoroughly and familiarise yourself with AutoIT first before attempting to do what you are doing.

As to your 2 questions:

1. Ping("www.google.com")

2. DirCreate("C:\AnotherDownloadDirectory")

Info on these functions are readily available in the accompanying help file.

<{POST_SNAPBACK}>

yes but thhen its making another DL dic, but do it also then download to the another download dic?
Link to comment
Share on other sites

now some great mates here told me a side with a lot of cool .wav files. How do u use them? if:

1. It checks if user are online, if not then it should playwav a connection error has occured.wav

2. When the Download start then it should play a download has been started.wav

3. When it start, then how do you do if you want to make text in the gui box, or just a trap tip, with how many bytes there are Downloaded?

4. if a file transfer fail then play file transfer has failed.wav

5. How do i secret check if users online? it should be. If hes offline, play youarenotonline.wav, and then, two buttons. Try again, or cancel. Cancel exist script, and try again, trys again. If online, just keep going.

6. How do i make a button "stop download", and then play sound file "The download has been cancled"?

My code:

#include <GUIConstants.au3>

GUICreate("DL'er")

$chooseCombo = GUICtrlCreateCombo ("Steam", 10,10)
GUICtrlSetData(-1,"Mirc|winzip|hero editor|Flash|Dreamweaver|ICQ|","MSN")

$goButton = GUICtrlCreateButton ("go",  250, 10, 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()
    
    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)    
       ;;; and so on....
    EndIf
    SoundPlay('complete.wav')
    ElseIf $msg = $GUI_EVENT_CLOSE Then
        ExitLoop
    EndIf
Wend

Thx

complete.wav

Edited by 8218
Link to comment
Share on other sites

all i can say is RTFM!!!

Your questions concern the basics of autoit well if you dont know even that u really should take a look @ the help file ....

Edit: You can't stop a download .... at least i dont think it is possible.

Edited by pcdestroyer
Link to comment
Share on other sites

all i can say is RTFM!!!

Your questions concern the basics of autoit well if you dont know even that u really should take a look @ the help file ....

Edit: You can't stop a download .... at least i dont think it is possible.

<{POST_SNAPBACK}>

RTFM yourself :lmao:

InetGet("abort")
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...