AzKay Posted June 22, 2006 Share Posted June 22, 2006 (edited) Ok, Heres my script: expandcollapse popup#include <GUIConstants.au3> ; == GUI generated with Koda == $Form1 = GUICreate("AForm1", 385, 105, 192, 125) $Input1 = GUICtrlCreateInput("Url Here Eg: www.file.com/file.exe", 8, 8, 369, 21, -1, $WS_EX_CLIENTEDGE) $Input2 = GUICtrlCreateInput("Name Of File Here Eg: File.exe", 8, 32, 369, 21, -1, $WS_EX_CLIENTEDGE) $Input3 = GUICtrlCreateInput("Save To Eg: C:/Downloads/", 8, 56, 369, 21, -1, $WS_EX_CLIENTEDGE) $Button1 = GUICtrlCreateButton("Download", 8, 80, 369, 17) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;;;;;; EndSelect WEnd Exit If $Button1 Then _Download($Input1, $Input2) Sleep(100) EndIf Func _Download($File, $name) $FileSize1 = InetGetSize($file) InetGet($file, $name, 1, 1) While @InetGetActive $filedownload = Round(@InetGetBytesRead / 1048576, 5) $Percent = $filedownload / $FileSize1 TrayTip("", "" & $filedownload & " Mb", 10, 16) Sleep(250) WEnd Sleep(500) EndFunc Yes, So, I need to have an input box which tells the script where to download to. Oh, and how can I make it download when I click Button1? Thanks Edited June 22, 2006 by AzKay # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
AzKay Posted June 22, 2006 Author Share Posted June 22, 2006 (edited) Ok, Heres my script: expandcollapse popup#include <GUIConstants.au3> ; == GUI generated with Koda == $Form1 = GUICreate("AForm1", 385, 105, 192, 125) $Input1 = GUICtrlCreateInput("Url Here Eg: www.file.com/file.exe", 8, 8, 369, 21, -1, $WS_EX_CLIENTEDGE) $Input2 = GUICtrlCreateInput("Name Of File Here Eg: File.exe", 8, 32, 369, 21, -1, $WS_EX_CLIENTEDGE) $Input3 = GUICtrlCreateInput("Save To Eg: C:/Downloads/", 8, 56, 369, 21, -1, $WS_EX_CLIENTEDGE) $Button1 = GUICtrlCreateButton("Download", 8, 80, 369, 17) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;;;;;; EndSelect WEnd Exit If $Button1 Then _Download($Input1, $Input2) Sleep(100) EndIf Func _Download($File, $name) $FileSize1 = InetGetSize($file) InetGet($file, $name, 1, 1) While @InetGetActive $filedownload = Round(@InetGetBytesRead / 1048576, 5) $Percent = $filedownload / $FileSize1 TrayTip("", "" & $filedownload & " Mb", 10, 16) Sleep(250) WEnd Sleep(500) EndFunc Yes, So, I need to have an input box which tells the script where to download to. Oh, and how can I make it download when I click Button1? ThanksOh, how I put the "IF" command, I dont really know how to use that, it always confuses me, so it was just there to test. EDIT:: Nevermind, Ill remove the button and just put a hotkey for {ENTER}. EDIT:: Ive confused myself, I have NO IDEA what im doing Edited June 22, 2006 by AzKay # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Valuater Posted June 22, 2006 Share Posted June 22, 2006 ******* not tested #include <GUIConstants.au3> ; == GUI generated with Koda == $Form1 = GUICreate("AForm1", 385, 105, 192, 125) $Input1 = GUICtrlCreateInput("Url Here Eg: www.file.com/file.exe", 8, 8, 369, 21, -1, $WS_EX_CLIENTEDGE) $Input2 = GUICtrlCreateInput("Name Of File Here Eg: File.exe", 8, 32, 369, 21, -1, $WS_EX_CLIENTEDGE) $Input3 = GUICtrlCreateInput("Save To Eg: C:/Downloads/", 8, 56, 369, 21, -1, $WS_EX_CLIENTEDGE) $Button1 = GUICtrlCreateButton("Download", 8, 80, 369, 17) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $Button1 _Download(GUICtrlRead($Input1), GUICtrlRead($Input3)&GUICtrlRead($Input2)) Sleep(100) EndSelect WEnd Exit Func _Download($File, $name) $FileSize1 = InetGetSize($file) InetGet($file, $name, 1, 1) While @InetGetActive $filedownload = Round(@InetGetBytesRead / 1048576, 5) $Percent = $filedownload / $FileSize1 TrayTip("", "" & $filedownload & " Mb", 10, 16) Sleep(250) WEnd Sleep(500) EndFunc 9) Link to comment Share on other sites More sharing options...
seandisanti Posted June 22, 2006 Share Posted June 22, 2006 Oh, how I put the "IF" command, I dont really know how to use that, it always confuses me, so it was just there to test.EDIT::Nevermind, Ill remove the button and just put a hotkey for {ENTER}.check out FileSaveDialog in the beta helpfile... Link to comment Share on other sites More sharing options...
AzKay Posted June 22, 2006 Author Share Posted June 22, 2006 (edited) Hmm, the script, the one you posted, keeps freezing up, And it doesnt seem to work right... Instead of using a GUI, would it be easier to just use InputBox's? Edited June 22, 2006 by AzKay # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
AzKay Posted June 22, 2006 Author Share Posted June 22, 2006 Ok, I have changed it, Im using inputbox's instead just one question, is it possible to resize an inputbox? by inputbox, I mean InputBox("", "") That type # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
seandisanti Posted June 22, 2006 Share Posted June 22, 2006 Ok, I have changed it, Im using inputbox's insteadjust one question, is it possible to resize an inputbox? by inputbox, I mean InputBox("", "") That typehave you looked at FileSaveDialog()? Link to comment Share on other sites More sharing options...
AzKay Posted June 22, 2006 Author Share Posted June 22, 2006 have you looked at FileSaveDialog()?yes, but I didnt understand it, but, I got my script working anyway, I just need to know if its possible to resize the InputBox. DirCreate("Downloads") $FileUrl = InputBox("Download", "Url:") $FileName = InputBox("Save As", "Save As:") _Download($FileUrl, @scriptDir & "/Downloads/" & $FileName ) Sleep(100) Func _Download($File, $name) $FileSize1 = InetGetSize($file) InetGet($file, $name, 1, 1) While @InetGetActive $filedownload = Round(@InetGetBytesRead / 1048576, 5) $Percent = $filedownload / $FileSize1 TrayTip("", "" & $filedownload & "Mb", 10, 16) Sleep(250) WEnd Sleep(500) EndFunc # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now