2013-05-17 33 views
0

這是一個關於autohotkey的問題所以這個腳本應該創建一個帶有名字的新文件夾,然後下載一系列視頻,然後移動繼續下一系列視頻並下載它們。這可以執行一系列視頻,但是它會嘗試將所有內容放在同一個文件夾中,即儘管外部循環中有X:= ++ P參數,但變量P不會從72024增加到72025。我在搞什麼?有15個視頻集,我把它分成3個循環,這樣我就可以插入30分鐘左右的延遲%,讓他們有時間下載,而不是過多地敲擊gomtv網站。這是迄今爲止我所嘗試過的最複雜的腳本,因此任何建設性的批評都是值得歡迎的。我不明白爲什麼在開始下一個循環之前變量P不會變爲72025

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. 
#Warn ; Recommended for catching common errors. 
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. 
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. 
G = 1 
H = 1 
P = 72024 
FolderName = 2013_WCS_KR_Season_1_Code_S_Ro32_Group_A_%P% 
FileName = %FolderName%_Set 
W = http://www.gomtv.net/2013wcs1/vod/%P% 
URL = http://www.gomtv.net/2013wcs1/vod/%P%/?set= 
NumberSets = 15 
wTitle = vlcrip 
Q = .mp4 
Delay = 0 

Loop, 2 
{ 
Sleep 3000 
WinActivate vlcrip 
Send {Lshift down} 
Sleep 100 
Send {F10} 
Sleep 100 
Send {Lshift up} 
Sleep 100 
Send w 
Sleep 100 
Send w 
Sleep 100 
Send {Enter} 
Sleep 100 
Send {Enter} 
Sleep 100 
Send %FolderName% 
Send {Enter} 
Sleep 100 
Send {Lshift down} 
Sleep 100 
Send {F10} 
Sleep 100 
Send {Lshift up} 
Sleep 100 
Send e 
Sleep 100 
WinActivate %FolderName% 



Loop, 1 
{ 
sleep 100 
Send {Lshift down} 
Sleep 100 
Send {F10} 
Sleep 100 
Send {Lshift up} 
Sleep 100 
Send w 
Send {Enter} 
sleep 100 
send livestreamer %URL%%H% best -o %FileName%_%H%%Q% 
sleep 100 
T := ++H 
sleep 100 
Send {Enter} 
Sleep 200 
WinActivate %FolderName% 
Sleep 200 
} 

sleep %Delay% 

Loop, 1 
{ 
sleep 100 
Send {Lshift down} 
Sleep 100 
Send {F10} 
Sleep 100 
Send {Lshift up} 
Sleep 100 
Send w 
Send {Enter} 
sleep 100 
send livestreamer %URL%%H% best -o %FileName%_%H%%Q% 
sleep 100 
T := ++H 
sleep 100 
Send {Enter} 
Sleep 200 
WinActivate %FolderName% 
Sleep 200 
} 

sleep %Delay% 

Loop, 1 
{ 
sleep 100 
Send {Lshift down} 
Sleep 100 
Send {F10} 
Sleep 100 
Send {Lshift up} 
Sleep 100 
Send w 
Send {Enter} 
sleep 100 
send livestreamer %URL%%H% best -o %FileName%_%H%%Q% 
sleep 100 
T := ++H 
sleep 100 
Send {Enter} 
Sleep 200 
WinActivate %FolderName% 
Sleep 200 
} 
X := ++P 
Send {Lcontrol down} 
Sleep 100 
Send {space} 
Sleep 100 
Send {Lcontrol up} 
Sleep 100 
WinActivate vlcrip 
Sleep 100 
} 

回答

0

您應該將與P相關的命令移到循環中。

Loop, 2 
{ 
FolderName = 2013_WCS_KR_Season_1_Code_S_Ro32_Group_A_%P% 
FileName = %FolderName%_Set 
W = http://www.gomtv.net/2013wcs1/vod/%P% 
URL = http://www.gomtv.net/2013wcs1/vod/%P%/?set= 
... 

然後它應該工作。

相關問題