Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

AHK Recovered Script Downloader


  • Please log in to reply
No replies to this topic
FrostByte
  • Members
  • 148 posts
  • Last active: Sep 16 2015 05:56 PM
  • Joined: 08 Nov 2012

Hey everyone! I've used RegEx for my first time (the functions aren't the best) and makes it download gamax92's recovered scripts! Enjoy and feedback is MORE than welcome.

 

#NoTrayIcon
Uppercase := "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Loop, Parse, Uppercase
{
 Serial := VerifyDrive(A_LoopField)
 If Serial =
  Continue
 Old := DrivesAvailable
 DrivesAvailable_ := A_LoopField "`r`n"
 DrivesAvailable := Old DrivesAvailable_
}
Gui,+Resize -MaximizeBox -SysMenu
Gui,Add,Text,x20 y10 w370 h20,Enter the drive you wish to put the files (only the letter of it like C instead of C:\)
Gui,Add,Text,x-99 y120 w32767 h2 0x12,
Gui,Add,Button,x320 y130 w83 h23,Next
Gui,Add,Button,x230 y130 w83 h23,Cancel
Gui,Add,Edit,x30 y30 w350 h50 -E0x200 +ReadOnly,Available drives:`r`n%DrivesAvailable%
Gui,Add,Edit,x40 y90 w330 h20 vDrive,
Gui,Show,w411 h161,Drives
Return
DD:
URLDownloadToFile, https://dl.dropbox.com/u/93572794/Backups/index.html, 1.txt
FileRead, Var, 1.txt
FileDelete, 1.txt
Loop, Parse, Var, `n
 Index:=A_Index
Gui,Destroy
Gui,+Resize -Sysmenu -MaximizeBox -MinimizeBox
Gui,Add,Text,x-110 y90 w32767 h2 0x12
Gui,Add,Button,x179 y100 w83 h23,Close
Gui,Add,Button,x270 y100 w83 h23 vCont,Continue
Gui,Add,Text,x20 y10 w320 h40 vStats,Please wait...
Gui,Add,Text,x10 y103 w100 h16 0x1000 vPP, 0`% Finished.
Gui,Add,Progress,x30 y50 w300 h16 -Smooth +Range0-%Index% vPro
Gui,Show,w361 h131,AutoHotkey Script Downloader
Return
ButtonContinue:
GuiControl, Disable, Cont
Loop, Parse, Var, `n
{
 GuiControl,,Pro,+1
 SetTimer, GuiShow, 50
 Txt:=RegExReplace(A_LoopField,">(.*)</a><br />")
 Txt:=RegExReplace(Txt,"a(.*)=""")
 StringReplace, Txt, Txt, ",, All
 StringReplace, Txt, Txt, <,, All
 SetTimer, GuiShow, 50
 StringReplace, Txt, Txt, https://dl.dropbox.com/u/93572794/Backups/, All
 Loop, Parse, Txt, /
 {
  If !InStr(A_LoopField,".")
   continue
  Name:=A_LoopField
 }
 Name:=RegExReplace(Name,"\.(.*)","1$")
 StringReplace, Name, Name, 1$,,All
 Percent:=A_Index / Index * 100
 SetTimer, GuiShow, 50
 StringTrimRight, Percent, Percent, 7
 GuiControl,,Stats, Dir: %Dire%%Name%.ahk`r`nURL: %Txt%
 GuiControl,,PP,%Percent%`% Finished.
 Va.=Dire Name ".ahk|"
 SetTimer, GuiShow, 50
 UrlDownloadToFile, https://dl.dropbox.com/u/93572794/Backups/%Txt%, %Dire%%Name%.ahk
}
GuiControl,,Pro,100
GuiControl,,Stats,Finished.
GuiControl,,PP,100`% Finished.
Done = 1
GuiSize:
OnMessage(0x20,"On_SetCursor")
Gui,+MinSize +MaxSize
On_SetCursor(wParam, lParam) {
 Static HARROW := DllCall("User32.dll\LoadCursor", "Ptr", 0, "Ptr", 32512, "UPtr")
 HTCODE := lParam & 0xFFFF
 If (HTCODE > 9) And (HTCODE < 19) {
  DllCall("User32.dll\SetCursor", "Ptr", HARROW)
  Return true
 }
}
GuiClose:
Return
ButtonClose:
If Done = 1
 ExitApp
GuiControl,+0x8,Pro
GuiControl,,Stats,Please wait. Changes are being rolled back.
GuiControl,,PP,---`% Rolled Back.
Loop, Parse, Va, |
{
 GuiControl,,Pro,+1
 SetTimer, GUIShow, 50
 FileDelete, %A_LoopField%
 Sleep, 50
}
ButtonCancel:
ExitApp
VerifyDrive(Drive) {
 DriveGet, Serial, Serial, %Drive%:
 Return Serial
}
DriveSyntax(Drive) {
 Lowercase := "abcdefghijklmnopqrstuvwxyz"
 Uppercase := "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
 Loop, Parse, Lowercase
 {
  If A_LoopField = %Drive%
  {
   Loop, Parse, Uppercase
   {
    If A_LoopField = %Drive%
     StringReplace, Drive, A_LoopField, %Drive%, %A_LoopField%, All
   }
  }
 }
 Drive_ := Drive
 Drive := Drive ":\"
 Return Drive
}
ButtonNext:
Gui,Submit,NoHide
If !VerifyDrive(Drive)
{
 GuiControl,,Drive
 return
}
Dr:=DriveSyntax(Drive)
FileSelectFolder,Dir_,%Dr%,,***SELECT FOLDER IF DESIRED`, OTHERWISE PRESS CANCEL AND YOU GET %Dr%.
If !Dir_
{
 Dire:=Dr
 GoTo, DD
}
Dire.=Dir_ "\"
GoTo,DD
GuiShow:
Gui, Show, w361 h131, AutoHotkey Script Downloader, NoActivate
SetTimer, GuiShow, Off
Return

 

 

Yes, like I had said: My RegEx uses are not cool, but they work; and I also know that somehow this script can be "compressed."

Here are a couple download links:

Compiled: https://docs.google....export=download

Source code: https://docs.google....export=download

I reccomend using these two links; the source-code and compiled file is always updated.


FrostByte and the Artemis Asylrum® Corporation
View my projects: Artemis Media Player

FrostByte62.com is down. I'll find another place to host my stuff soon...after I get done procrastinating some more. :)