[RELEASE] SNeXT Downloader 40b, Semplice ma efficace downloader in AutoIt ;D

« Older   Newer »
  Share  
schabbo
CAT_IMG Posted on 7/4/2012, 19:21     +1   -1





Salve Popolame ,
Visto che non ho avuto internet per un lungoooo mese ,
ho deciso di cimentarmi in nuove ed emozionanti stringe di codice :0
Comunque andiamo al dunque ( fordito gioco di parole :3 ) ho scritto questo
downloader in AutoIt , molto velocemente vi riassumo le funzioni :

- Gestione di Benvenuto e AutoUpdate ( Che Figata :awe: ! ) ;
- Scarica ( Ma davvero ? <_< ) ;
- Possibilità di Modificare le Impostazioni ;
- Varie funzioni che vengono eseguite alla fine del Download ( Apri cartella Fine Download , Apri File a Fine Download , Chiudi SNeXT a fine Download , Messaggio Di Fine ) ;
- Aggiunto Menu funzionante ( :awe: ) ;

La versione Completa , cioé se volte vederlo come lo vedo e volte usare il Source tra l'altro Open Source dovete scaricare i seguenti font :
- Birth Of A Hero ;
- Neuropol ;

Il Downloader è formato da 4 file ovvero :
- Downloader40b.au3 ( il downloader ) ;
- Edit.au3 ( il form per la modifica dei file ) ;
- Informazioni.ini ( il file di impostazioni ) ;
- serial.ini ( file che contiene la seriale , al quanto inutile ma figa u.u ) ;

Ora procediamo con i Source ,
I Nomi dei file devono essere quelli scritti sopra i Spoiler , altrimenti non funge u.u

Screen :


Downloader40b.au3
#include <editconstants.au3>
#include <guiconstantsex.au3>
#include <progressconstants.au3>
#include <staticconstants.au3>
#include <windowsconstants.au3>
#include <winapi.au3>
#include <guimenu.au3>
#include <math.au3>
#include <date.au3>
#include <guiconstants.au3>
#include <inet.au3>
#include <guicombobox.au3>
#include <guicomboboxex.au3>
#include <guiedit.au3>
#include <buttonconstants.au3>
#include <comboconstants.au3>
#include <tabconstants.au3>
#comments-start
# - Source By Schabbo
# - Gui By Schabbo
# - Ini system and Download algoritms by Schabbo
# - Edited version for School Learning With comments by Schabbo ;)
#comments-end
Global Enum $idNew = 1000, $idOpen, $idSave, $idExit, $idCut, $idCopy, $idPaste, $idAbout ; Dichiarazione Variabili Globali
Local $hGUI, $hFile, $hEdit, $hHelp, $hMain ; Dichiarazione Variabili Locali
Global $State ; Dichiarazione variabili Globali
$Name= iniread(@scriptdir & "\setting\conf\informazioni.ini","Account","Nome","NotFound") ;Va a leggere il File "\setting\conf\informazioni.ini" , alla sezione Account e alla Stringa Nome
$Sesso = iniread(@scriptdir & "\setting\conf\informazioni.ini","Vita","Sesso","NotFound") ;Va a leggere il File "\setting\conf\informazioni.ini" , alla sezione Vita e alla Stringa Sesso
$SerialKey = iniread(@scriptdir & "\setting\conf\serial.ini","Serial","Key","NotFound") ;Va a leggere il File "\setting\conf\informazioni.ini" , alla sezione Serial e alla Stringa Key
If $sesso = ("M") then ; Controlla se Nel file .ini la variabile $sesso è uguale a M
MsgBox(1,"Bentornato "& $Name,"Bentornato " & $Name & " e Buon Download . ") ; se si uscirà Bentornato Tuonome e Buon Download
else
MsgBox(1,"Bentornata "& $Name,"Bentornata " & $Name & " e Buon Download . "); se no uscirà Bentornata Tuonome e Buon Download
EndIf
#region Inizio Grafica
$hGUI = GUICreate("SNeXT Downloader 40b", 602, 320, 191, 135)
$Label1 = GUICtrlCreateLabel("SNeXT Downloader", 8, 8, 330, 57)
GUICtrlSetFont(-1, 36, 400, 0, "BIRTH OF A HERO")
$Label2 = GUICtrlCreateLabel(" Url/Link :", 8, 64, 92, 17)
GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI Mono")
$Label3 = GUICtrlCreateLabel("Nome File :", 8, 120, 92, 17)
GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI Mono")
$Label4 = GUICtrlCreateLabel("% Scaricata :", 8, 176, 95, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Segoe UI Mono")
GUICtrlSetColor(-1, 0x008080)
$http = GUICtrlCreateInput("http://www.yourdomain.com/nomefile.exe", 8, 88, 329, 21)
GUICtrlSetFont(-1, 9, 400, 0, "Segoe UI Mono")
$name = GUICtrlCreateInput("nomefile.exe", 8, 144, 329, 21)
GUICtrlSetFont(-1, 9, 400, 0, "Segoe UI Mono")
$Down = GUICtrlCreateButton("DOWNLOAD", 8, 250, 121, 33)
GUICtrlSetFont(-1, 10, 400, 0, "Neuropol")
$Button3 = GUICtrlCreateButton("CheckUpdate", 152, 250, 121, 33)
GUICtrlSetFont(-1, 10, 400, 0, "Neuropol")
$Button4 = GUICtrlCreateButton("Setting", 296, 250, 121, 33)
GUICtrlSetFont(-1, 11, 400, 0, "Neuropol")
$Group1 = GUICtrlCreateGroup("Impostazioni Download", 408, 8, 185, 121)
GUICtrlSetFont(-1, 8, 800, 0, "Segoe UI Mono")
$Checkbox1 = GUICtrlCreateCheckbox("Apri File fine Download", 416, 56, 145, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Segoe UI")
$Checkbox2 = GUICtrlCreateCheckbox("Apri Cartella fine Download", 416, 32, 145, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Segoe UI")
$Checkbox3 = GUICtrlCreateCheckbox("Chiudi SNeXT a Fine Download", 416, 80, 169, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Segoe UI")
$Checkbox4 = GUICtrlCreateCheckbox("Messaggio di Fine Download ", 416, 104, 145, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Segoe UI")
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("Credits", 424, 144, 169, 137)
GUICtrlSetFont(-1, 8, 800, 0, "Segoe UI Mono")
$Label7 = GUICtrlCreateLabel("Software Coded By Schabbo", 432, 160, 150, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Segoe UI")
$Label8 = GUICtrlCreateLabel("All Right Reserved to SNeXT", 432, 256, 145, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Segoe UI")
$Label9 = GUICtrlCreateLabel("Software make on AutoIt", 432, 184, 132, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Segoe UI")
$Label10 = GUICtrlCreateLabel("Available for Free on SNeXT site", 432, 208, 165, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Segoe UI")
$Label11 = GUICtrlCreateLabel("or AutoIT ITALIAN Forum", 432, 232, 128, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Segoe UI")
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Label12 = GUICtrlCreateLabel("pe.es : www.domain.com/nomefile.exe", 104, 64, 235, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Segoe UI")
GUICtrlSetColor(-1, 0x000080)
$Label13 = GUICtrlCreateLabel("pe.es : nomefile.exe <--- Serve Estensione !", 104, 120, 223, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Segoe UI")
GUICtrlSetColor(-1, 0x000080)
$Label14 = GUICtrlCreateLabel("40b", 336, 32, 34, 27)
GUICtrlSetFont(-1, 16, 400, 0, "BIRTH OF A HERO")
$_file = GUICtrlCreateMenu("&File")
$_file_down = GuiCtrlCreateMenuItem("&Avvia Download",$_file)
GUICtrlSetState(-1, $GUI_DEFBUTTON)
$_file_up = GuiCtrlCreateMenuItem("Avvia Update",$_file)
$_file_path = GuiCtrlCreateMenuItem("Open Download Path",$_file)
GuiCtrlCreateMenuItem("",$_file)
$_exit = GuiCtrlCreateMenuItem("Exit",$_file)
$_edit = GUICtrlCreateMenu("&Option")
$_edit_save = GuiCtrlCreateMenuItem("Edit Setting",$_edit)
$_support = GuiCtrlCreateMenu("&Support")
$_about = GuiCtrlCreateMenuItem("About",$_support)
$_cont = GuiCtrlCreateMenuItem("Contacts Us",$_support)

GUISetState(@SW_SHOW, $hGUI)
#endregion
; Fine GUI ;
;Inizio Prima While .
While 1

$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $button4
_Edit() ; Collega alla funzione _Edit()
Case $Down
_Download() ; Collega alla funzione _Download()
Case $button3
_update() ; Collega alla funzione _update()
Case $_file_down
_Download()
Case $_file_up
_update()
Case $_file_path
ShellExecute(@ScriptDir & "\download\")
Case $_exit
exit
Case $_edit_save
_Edit()
Case $_about
_About()
Case $_cont
_Contacts()
EndSwitch
WEnd

;Inizio Source Aggiornamento
func _update()
$lollo=('http://snext.altervista.org/install.exe')
Local $_InfoData2
$_InfoData2 = InetGetInfo ( $lollo )
If IniRead(@scriptdir & "\setting\conf\informazioni.ini","Informazione","Versione",0) < _INetGetSource("http://snext.altervista.org/Informazioni.ini") Then ;Controlla le varie stringhe e conferma l'update o lo nega
$File=Inetget($lollo,@scriptdir & '\download' ,1 ,1)
$_InfoData2[2] = True
msgbox(1,"Download Finito","lol")
sleep (2000)
shellexecute (@scriptdir & "\download\install.exe")
endif
EndFunc
;Fine Source Aggiornamento

;Inizio Source download .
Func _Download()
If not $SerialKey = ("H746C-BM4VK-TWBB8-MVWH8-FXR33") then ; Serial Key che verrà sostituita in automatico ad ogni update .
GUICtrlSetState($button4, $GUI_DISABLE)
GUICtrlSetState($Down, $GUI_DISABLE)
$State = 0
Sleep (1000)
MsgBox(4069,"Avviso","Per far si che il Programma Torni a Funzionare Clicca su Check Update e Scarica l'ultima Verisone Disponibile !")
endif
$_first=Guictrlread($name)
$_FinalUrl=Guictrlread($http)
$_FialPath=(@scriptdir & '\download\'& $_first)
$_NormaPath=(@scriptdir & '\download')
$_FileSize = InetGetSize ( $_FinalUrl )
$_ProgressBar=GUICtrlCreateProgress(8, 180, 401, 25)
GUISetState ( @SW_SHOW)
$_Download = InetGet ( $_FinalUrl, $_FialPath, 1, 1 )
Local $_InfoData
Do
$_InfoData = InetGetInfo ( $_Download )
If Not @error Then
$_InetGet = $_InfoData[0]
$_DownloadPercent = Round ( ( 100 * $_InetGet ) / $_FileSize )
$_DownloadPercent = _Min ( _Max ( 1, $_DownloadPercent ), 100 )
GUICtrlSetData ( $_ProgressBar, $_DownloadPercent )
$_Label = GUICtrlCreateLabel($_DownloadPercent & '%',104, 164, 24, 15)
GUICtrlSetFont(-1, 9, 400, 0, "Segoe UI Mono")
GUICtrlSetColor(-1, 0x808000)
EndIf
Sleep ( 2000 )
Until $_InfoData[2] = True
$_Label = GUICtrlCreateLabel("Download Finito",134, 164, 120, 15)
GUICtrlSetFont(-1, 9, 400, 0, "Segoe UI Mono")
GUICtrlSetColor(-1, 0x808000)
Sleep(1000)
$_Label2 = GUICtrlCreateLabel('Percorso : '&$_FialPath, 8, 210, 410, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Segoe UI Mono")
GUICtrlSetColor(-1, 0xFF0000)
Sleep(500)
If GUICtrlRead($Checkbox1) = 1 Then
ShellExecute($_FialPath)
EndIf
If GuiCtrlRead($Checkbox2) = 1 Then
ShellExecute($_NormaPath)
EndIf
If GuiCtrlRead($CheckBox3)= 1 Then
MsgBox(4,"Informazione","SNeXT Download ha finito il Download e come da Comando si Chiuderà.")
EndIf
If GuiCtrlRead($Checkbox4) = 1 Then
MsgBox(1,"Download Finito","Il Download di : " & $_first & " è stato finito , puoi trovarlo Qui : " & $_Fialpath)
EndIf
EndFunc
;Fine Source Download
;-------------------;
;Inizio Source Edit
Func _Edit()
ShellExecute(@ScriptDir & "\setting\edit.au3")
EndFunc

Func _About()
MsgBox (1,"About - Credits","Script powered By Schabbo for SchabboNetX ( SNEXT)" & @CRLF & "Source : Schabbo"& @crlf &"GUI - Form : Schabbo" & @crlf & "Design : Schabbo" & @crlf &"Visit SchabboNet.altervista.org")
EndFunc
Func _Contacts()
MsgBox (1,"Contacts Us","Contact Us" & @CRLF & "M@il : [email protected]" & @CRLF & "M@ail 2 : [email protected]" & @CRLF & "Facebook : Alessandro De Cristofaro")
EndFunc


Edit.au3
#include <buttonconstants.au3>
#include <editconstants.au3>
#include <guiconstantsex.au3>
#include <staticconstants.au3>
#include <windowsconstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Setting", 259, 291, 431, 262)
$_nome = GUICtrlCreateInput("Input1", 16, 35, 233, 21)
$_m = GUICtrlCreateRadio("Maschio", 24, 96, 81, 17)
$_f= GUICtrlCreateRadio("Femmina", 24, 128, 81, 17)
$Label1 = GUICtrlCreateLabel("Il Tuo Nome", 16, 16, 62, 17)
$Group1 = GUICtrlCreateGroup("Sesso", 16, 80, 233, 81)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Serial = GUICtrlCreateGroup("Serial - Key", 16, 184, 233, 65)
$Input2 = GUICtrlCreateInput("", 24, 216, 217, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$_save = GUICtrlCreateButton("Salva", 16, 256, 75, 25, $WS_GROUP)
$_close = GUICtrlCreateButton("Chiudi", 168, 256, 75, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
refresh()
#EndRegion ### END Koda GUI section ###



While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $_close
exit
Case $_save
Save()
EndSwitch
WEnd

Func refresh()
$_Name_=IniRead(@scriptdir & "\conf\informazioni.ini","Account","Nome","NotFound")
GuiCtrlSetData($_nome,$_Name_)
$_Serial_=IniRead(@ScriptDir & "\conf\serial.ini","Serial","Key","NotFound")
GuiCtrlSetData($Input2,$_Serial_)
EndFunc

Func Save()
$_ID = GuiCtrlRead($_nome)
IniWrite(@scriptdir & "\conf\informazioni.ini","Account","Nome",$_ID)
If GuiCtrlRead($_m) = 1 Then
IniWrite(@scriptdir & "\conf\informazioni.ini","Vita","Sesso","M")
EndIf
If GuiCtrlRead($_f) = 1 Then
IniWrite(@scriptdir & "\conf\informazioni.ini","Vita","Sesso","F")
EndIf
EndFunc


Informazioni.ini
[Account]
Nome=Modifica Questa informazione dal Setting
[Vita]
Sesso=M
[Informazione]
Versione=0.1


serial.ini
[Serial]
Key=H746C-BM4VK-TWBB8-MVWH8-FXR


A quasi dimenticavo , dovreste creare una cartella , nella stessa directory del programma e la dovete chiamare " Download " ( senza apici ) .

FINE :D

Edited by schabbo - 7/4/2012, 20:38

Attached Image: snext

snext

 
Top
FrontBack
CAT_IMG Posted on 7/4/2012, 21:00     +1   -1




Ok... per essere bello lo è ma non ha senso se ti fa scaricare un file alla volta...
 
Top
schabbo
CAT_IMG Posted on 7/4/2012, 21:59     +1   -1




Lo so , infatti stavo facendo una versione con una List box ma ho un bel po di problemi Q___Q Mi serve una mano per quella xD
 
Top
I.Ren
CAT_IMG Posted on 7/4/2012, 23:13     +1   -1




Ma se autoit non supporta neanche il multithreading D: va a finire che faresti un download sequenziale e avrebbe poco senso.

Cmq simpatico come esercizio
 
Top
FrontBack
CAT_IMG Posted on 8/4/2012, 09:25     +1   -1




@I.Ren: se non ricordo male c'è un'opzione di InetGet che anche se sta scaricando ti fa procedere comunque con lo script, ma ciò vorrebbe dire assegnare una variabile per ogni InetGet e richiamarla ogni volta con Assign e Eval e ciò sarebbe un problema...
 
Top
antospaty
CAT_IMG Posted on 8/4/2012, 10:25     +1   -1




molto bello come programma,servirebbe solo un udf o qualche funzione per fargli fare piu' download
 
Top
5 replies since 7/4/2012, 19:21   128 views
  Share