我不明白为什么在开始下一个循环之前变量P不会变为72025

时间:2013-05-17 12:52:08

标签: autohotkey

这是一个关于autohotkey的问题所以这个脚本应该创建一个带有名称的新文件夹,然后下载一系列视频,然后转到下一系列视频并下载它们。这可以做一系列视频,但是它会尝试将所有内容放在同一个文件夹中,即尽管外部循环中有X:= ++ P参数,但变量P不会从72024增加到72025。我搞砸了什么?有15个视频到一套我把它分成3个循环,这样我就可以插入30%左右的%延迟%给他们时间下载而不是在gomtv网站上敲击太多。这是迄今为止我曾经尝试过的最复杂的剧本,所以任何建设性的批评都是值得欢迎的。

#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
}

1 个答案:

答案 0 :(得分: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=
...

然后它应该工作。