Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Simply install Autohotkey (https://autohotkey.com/download/), save this file as whatever.ahk, and double click.
- ; A macro for when there are no download links available; takes care of opening images in new tabs and downloading them.
- ; visual instructions here: https://imgur.com/a/y85KT
- ; README
- ; A very hacky AutoHotKey macro by meterion for idle downloading
- ; To use properly, save the page 1 image to the desired directory before starting the macro
- ; This is needed to set the save directory for the rest of the images
- ; Page 1 is then omitted from the macro so there is no need to delete it from the directory
- ; Press Ctrl+k from page 1 and follow the input prompts to begin
- ; Beeps and displays a dialogue box upon completion
- ; Note: Rename Files won't rename the file you manually downloaded
- ; Speed: ~1.5 minutes per 20 pages
- ; Press Ctrl+y for extra beeps lol (don't do it while it's running tho)
- pageDelay := 3000 ; Conservative ms delay to load pages
- saveDelay := 1000 ; Faster ms delay when waiting for dialogue window
- winDelay := 100 ; Fastest ms delay within windows
- CoordMode, Mouse, Relative
- SetMouseDelay, 0
- tones := [131, 139, 147, 156, 165, 175, 185, 196, 208, 220, 233, 247, 262, 277, 294, 311, 330, 349, 370, 392, 415, 440, 466, 494, 523, 554, 587, 622, 659, 698, 740, 784, 831, 880, 932, 988, 1047, 1109, 1175, 1245, 1319, 1397, 1480, 1568, 1661, 1760, 1865, 1976]
- setFormat, IntegerFast, d
- ^y::
- Random, toneStart, 1, 40
- Random, jumpOne, 3, 4
- Random, jumpTwo, 3, 4
- SoundBeep, tones[ToneStart], 150
- SoundBeep, tones[ToneStart + jumpOne], 150
- SoundBeep, tones[ToneStart + jumpOne + jumpTwo], 150
- return
- ^k:: ; You set the save directory, right?
- WinGetActiveStats, Title, Width, Height, X, Y
- winXClick := Width/2
- winYClick := Height/2
- winXSClick := winXClick + 50
- winYSClick := winYClick + 150
- InputBox, pageNumber, Number of Pages to Download, Please enter the total page NUMBER
- if Errorlevel ; cancel out of download
- {
- MsgBox, , Autodownload Cancelled, Download successfully cancelled
- return
- }
- minNumber := pageNumber - 1 ; modified value for image loop
- Sleep, winDelay
- MsgBox, 260, Rename Files, Press Yes to rename files starting at 002
- IfMsgBox, Yes ; Defaults to "No"
- {
- numRename := 1
- }
- Sleep, saveDelay ; allow for user to lift hand from keys
- Loop, %minNumber% ; First page is being done out of macro, so -1
- {
- Click, %winXClick%, %winYClick% ; Advance page
- Sleep, pageDelay
- Click, %winXClick%, %winYClick%, right ; Right Click
- Sleep, winDelay
- Click, %winXSClick%, %winYSClick% ; Open image in new tab
- Sleep, winDelay
- } ; Done opening images, now saving
- Send, ^{Tab} ; move to image tabs
- Sleep, winDelay
- Loop, %minNumber% ; First page is being done out of macro, so -1
- {
- Send, ^s ; enter save dialogue
- Sleep, saveDelay
- IfMsgBox, Yes
- {
- numRename := ++numRename
- numSend := SubStr("00" . numRename, -2)
- Send, %numSend%
- Sleep, winDelay
- }
- Send, {Enter} ; save image
- Sleep, winDelay
- Send, ^w ; advance tab
- Sleep, winDelay
- }
- Random, toneStart, 1, 40
- Random, jumpOne, 3, 4
- Random, jumpTwo, 3, 4
- SoundBeep, tones[ToneStart], 150
- SoundBeep, tones[ToneStart + jumpOne], 150
- SoundBeep, tones[ToneStart + jumpOne + jumpTwo], 150
- MsgBox, 0, Autosave Completed, %pageNumber% pages downloaded.
- return
Add Comment
Please, Sign In to add comment