Followers 0

## 39 posts in this topic

#1 ·  Posted (edited)

My first "real" project, but turned out pretty good!

Thx

tdlrali (Felix)

Edited by Felix N.

##### Share on other sites

#3 ·  Posted (edited)

Weird because I made like the same exact thing today But I like your setup better, good work !

EDIT: One suggestion to make it look better. Line up the filesize label and input field with the 2 above it. It will look much neater

Edited by layer

FootbaG

##### Share on other sites

Weird because I made like the same exact thing today But I like your setup better, good work !

EDIT: One suggestion to make it look better. Line up the filesize label and input field with the 2 above it. It will look much neater

You should post it so that we can take a look at it..

Cheers..

##### Share on other sites

My first "real" project, but turned out pretty good!

Thx

tdlrali (Felix)

Cheers..

##### Share on other sites

My first "real" project, but turned out pretty good!

For script see attachment

Thx

tdlrali (Felix)

Also, thought it would look better with a percent progress bar (requires beta)

Screen shots and your source modified and include file below:

Progress.au3

Don't argue with an idiot; people watching may not be able to tell the difference.

##### Share on other sites

Also, thought it would look better with a percent progress bar (requires beta)

Screen shots and your source modified and include file below:

qafrost, nice additions..! I like the progress bar idea. I some other ideas to add to this script. Hopefully they are not too crazy and crash it.

Cheers..

##### Share on other sites

I had an idea like this only slightly different. It would monitor the clipboard for any non-webpage format, http: protocol, filenames. Then it would ask where you want to save to but I never got around to making it. Maybe a suggestion for yours?

##### Share on other sites

Also, thought it would look better with a percent progress bar (requires beta)

Screen shots and your source modified and include file below:

qafrost, here is an updated version to what you modified. I have labeled it v1.03b.

I added a _Filesize() display routine which allows you to chose how to display filesize text. This is a nice add-on to any script. Syntax: _Filesize(value in bytes, format type, decimal places); returns a formatted string.

Also I added _FileReplace(), which test to see if a file exist and verifies if you want to overwrite it. This function has elements specific for this script so I made it part of it.

Check it out and let me know what you think. I have other ideas but that will have to wait.

Cheers..

##### Share on other sites

#10 ·  Posted (edited)

Hey!

Thanx for your replies and changes!

Am i doing anything wrong? I installed the beta to [My AutoIt Folder]\beta, like it was suggested while installing the beta and i clicked Beta Compile in SciTE. But the program just quits like i said above

Felix N. (tdlrali)

1

Just to make it more clear:

I put all the files in one folder, so thats not the problem.

2

It didn't work due to an error in the _FileReplace function

Func _FileReplace($sPathFrom,$sPathTo)
Local $filename,$sFileCheck, $answer$filename = StringTrimLeft($sPathFrom, StringInStr($sPathFrom, "/", 0, -1))
$localfile =$sPathTo & "\" & $filename$sFileCheck = FileExists($localfile) If$sFileCheck = 1 Then
$answer = MsgBox(36, "File Existing - Error", "File Found: " &$localfile & @CRLF & "Do you want to replace this existing file? ")
Select
Case $answer = 6; YES Return 1 Case$answer = 7; NO
Return 0
EndSelect
Else       ;<= added by Felix N.
Return 1;<= added by Felix N.
EndIf
EndFunc ;==>_FileReplace

Without the stuff i added it always returned 0, thus exiting the script....

Attached is the compiled exe (remove the au3 ending for the file "Downloader.exe.au3) and the 2 script files.

To compile the script, both files must be in the same folder and you need the beta version of AutoIt (just to make sure new people like me know how to compile^^, not for you pr0s)

Thanks again to the people that helped me!

Felix N. (tdlrali)

HF!

3

OMG where are the files??

Now they're there^^

Edited by Felix N.

Very good...

##### Share on other sites

Hey!

Thanx for your replies and changes!

Am i doing anything wrong? I installed the beta to [My AutoIt Folder]\beta, like it was suggested while installing the beta and i clicked Beta Compile in SciTE. But the program just quits like i said above

1

Just to make it more clear:

I put all the files in one folder, so thats not the problem.

2

It didn't work due to an error in the _FileReplace function

Func _FileReplace($sPathFrom,$sPathTo)

Without the stuff i added it always returned 0, thus exiting the script....

Attached is the compiled exe (remove the au3 ending for the file "Downloader.exe.au3) and the 2 script files.

To compile the script, both files must be in the same folder and you need the beta version of AutoIt (just to make sure new people like me know how to compile^^, not for you pr0s)

Thanks again to the people that helped me!

Felix N. (tdlrali)

HF!

@Felix, regaring the [.83] version, just uninstall the old version and install the new one!

Regarding, _FileReplace function I did notice that it had a problem with the Return Value being "0" when it should not have. Thanks for the FIX!!

I notice you did not like my text input of the size type and changed it to numbers! I was thinking about that but left it text so it would be more noticable. But I see that yours works as well.

Also, I like the display windows do not appear till the Download button is pressed. But you might notice that the Downloaded size is not updated at the end of the download. Thus it down not match the Inetgetfile value.

Looks good so far. I have some other ideas to add and will post them as I get to it.. Keep up the good work!

Cheers..

##### Share on other sites

Hey @ll!

BTW thanks busy your UDFs are really a good addition to my script!

I changed your _Filesize since i don't like having stuff like "GB" in functions, although it makes it more clear.

I also removed the round functions from the "Conversion Chart" and added it at the end, which gives more accurate values (i think )

I added one line to the download loop so it updates the Downloaded size at the end. I think it didn't work because the script downloads some more bytes until it updates the field again, so the value is still a little bit smaller than the actual size! Was no problem to change at all^^

Felix N. (tdlrali)

##### Share on other sites

Hey @ll!

BTW thanks busy your UDFs are really a good addition to my script!

I changed your _Filesize since i don't like having stuff like "GB" in functions, although it makes it more clear.

I also removed the round functions from the "Conversion Chart" and added it at the end, which gives more accurate values (i think )

I added one line to the download loop so it updates the Downloaded size at the end. I think it didn't work because the script downloads some more bytes until it updates the field again, so the value is still a little bit smaller than the actual size! Was no problem to change at all^^

Felix N. (tdlrali)

Nice adds. The download speed could be added to the last display box with the file location. I see you implemented the '0 Bytes' return instead of an error message.. Someone else had mentioned it on another thread where I posted the UDF.

Cheers..

##### Share on other sites

I have the script with the download speed on my home computer, i'll submit it later today.

Was pretty easy to implement

Any more suggestions?

Felix N. (tdlrali)

##### Share on other sites

Any more suggestions?

Yes, please change your avatar... I don't even want to try to explain having that on my screen when my boss comes by.

##### Share on other sites

#17 ·  Posted (edited)

Ok I CHANGED MY AVATAR!

Hope you guys find bugs this time^^

HF!

Felix N. (tdlrali)

Edited by Felix N.

##### Share on other sites

like this

1st add... $win1 = $win1 = GUICreate("Downloader 1.06b", 380, 230)

If $Download Then$speed = _DownloadSpeed($rmtfile_size,$starttime)
_Progress_Update ($Progress_1, 100) GUICtrlSetData($Input_dled,GUICtrlRead($Input_size)) ;MsgBox(64, "Download finished!", "Download finished!" & @CRLF & "File can be found at:" & @CRLF &$localfile & @CRLF & @CRLF & "Your downloadspeed:" & @CRLF & $speed) Open_File() ExitLoop Else 3rd add the function Func Open_File() Sleep(4000) GUISetState( @SW_HIDE,$win1)

$win2 = GUICreate("Downloader 1.05b", 380, 230)$Button_open = GUICtrlCreateButton("Open File", 20, 180, 100, 30)
$Button_view = GUICtrlCreateButton("Open Folder", 140, 180, 100, 30)$Button_cancel = GUICtrlCreateButton("Exit", 260, 180, 100, 30)
$Location = GUICtrlCreateInput($localfile, 70, 50, 230, 20)
$Label_finished = GUICtrlCreateLabel("Download finished!", 10, 20, 250, 20)$Label_saved = GUICtrlCreateLabel("Saved to:", 10, 50, 50, 20)

GUISetState()
While 2

$msg2 = GUIGetMsg() Select Case$msg2 = $GUI_EVENT_CLOSE Return Case$msg2 = $Button_open Run(@ComSpec & " /C START " &$localfile, "", @SW_MINIMIZE)
Case $msg2 =$Button_view
Run( "explorer.exe " & $Input_to_tmp, "") Case$msg2 = $Button_cancel Return EndSelect WEnd GUIDelete($win2)

Cheers..