AutoHotKey - 获取要循环的文件,遵循文档
AutoHotKey - Getting `files to loop, following documentation
我正在 AHK 制作一个程序,从那里的商店网站提取 Steam 价格和比特币地址。我将所有帐户存储在与脚本相同的目录中的文本文件中。
现在当我运行这个程序时,当我点击开始按钮时没有任何反应,没有任何反应。早些时候,我尝试使用一个逐行循环并读取文件的函数,但这也不起作用。
我做错了什么?
这是我的代码。我对 AHK 很陌生。我遵循了文档 here 中的示例,但我不确定为什么它不起作用。请帮忙!
#SingleInstance, Force
;; GUI input
: -------------------------------
: ---------------------------------------
Gui, Show, w300 h300, Steam Tool
Gui, Add, Button, x10 y20 gStart, Start the tool
return
; Labels
; -----------------------
; --------------------------------
Start:
Loop, read accounts,.txt
{
loop, parse, LoopReadLine, %A_Tab%
{
Run, C:\Program Files (x86)\Multiloginapp\multiloginapp.exe
WinWait, Multiloginapp - 01.3.15
Sleep, 20000
WinActivate, Multiloginapp - 01.3.15
IfWinNotActive, Multiloginapp - 01.3.15, ,WinActivate, Multiloginapp - 01.3.15
WinWaitActive, Multiloginapp - 01.3.15
Click 724 260
sleep, 1500
WinWait, Multiloginapp - Mozilla Firefox
WinActivate, Multiloginapp - Mozilla Firefox
Click 408 55
Sleep 5000
Send, ^a
Send,{Backspace}
Send, store.steampowered.com/account
Send, {enter}
MsgBox %LoopReadLine%
}
}
return
#SingleInstance, Force
SetWorkingDir, %A_ScriptDir% ; if an absolute path isn't specified
;; GUI input
;-------------------------------
; ---------------------------------------
Gui, Add, Button, x10 y20 gStart, Start the tool
Gui, Show, w300 h300, Steam Tool
return
; Labels
; -----------------------
; --------------------------------
Start:
Loop, read, accounts.txt ; the file name must be separated by a comma
{
; MsgBox %A_LoopReadLine%
loop, parse, A_LoopReadLine, %A_Tab%
{
IfWinNotExist, Multiloginapp - 01.3.15
{
Run, C:\Program Files (x86)\Multiloginapp\multiloginapp.exe
WinWait, Multiloginapp - 01.3.15
Sleep, 20000
}
IfWinNotActive, Multiloginapp - 01.3.15, ,WinActivate, Multiloginapp - 01.3.15
WinWaitActive, Multiloginapp - 01.3.15
Click 724, 260
sleep, 1500
WinWait, Multiloginapp - Mozilla Firefox
WinActivate, Multiloginapp - Mozilla Firefox
WinWaitActive, Multiloginapp - Mozilla Firefox
Click 408, 55
Sleep 5000
Send, ^a
Send, {Backspace}
SendInput, store.steampowered.com/account ; SendInput is faster in sending text
Send, {enter}
; Use:
; SendInput, %A_LoopField%
; if you want to send the current substring (field) from the line
MsgBox %A_LoopField%
}
}
return
我正在 AHK 制作一个程序,从那里的商店网站提取 Steam 价格和比特币地址。我将所有帐户存储在与脚本相同的目录中的文本文件中。
现在当我运行这个程序时,当我点击开始按钮时没有任何反应,没有任何反应。早些时候,我尝试使用一个逐行循环并读取文件的函数,但这也不起作用。
我做错了什么? 这是我的代码。我对 AHK 很陌生。我遵循了文档 here 中的示例,但我不确定为什么它不起作用。请帮忙!
#SingleInstance, Force
;; GUI input
: -------------------------------
: ---------------------------------------
Gui, Show, w300 h300, Steam Tool
Gui, Add, Button, x10 y20 gStart, Start the tool
return
; Labels
; -----------------------
; --------------------------------
Start:
Loop, read accounts,.txt
{
loop, parse, LoopReadLine, %A_Tab%
{
Run, C:\Program Files (x86)\Multiloginapp\multiloginapp.exe
WinWait, Multiloginapp - 01.3.15
Sleep, 20000
WinActivate, Multiloginapp - 01.3.15
IfWinNotActive, Multiloginapp - 01.3.15, ,WinActivate, Multiloginapp - 01.3.15
WinWaitActive, Multiloginapp - 01.3.15
Click 724 260
sleep, 1500
WinWait, Multiloginapp - Mozilla Firefox
WinActivate, Multiloginapp - Mozilla Firefox
Click 408 55
Sleep 5000
Send, ^a
Send,{Backspace}
Send, store.steampowered.com/account
Send, {enter}
MsgBox %LoopReadLine%
}
}
return
#SingleInstance, Force
SetWorkingDir, %A_ScriptDir% ; if an absolute path isn't specified
;; GUI input
;-------------------------------
; ---------------------------------------
Gui, Add, Button, x10 y20 gStart, Start the tool
Gui, Show, w300 h300, Steam Tool
return
; Labels
; -----------------------
; --------------------------------
Start:
Loop, read, accounts.txt ; the file name must be separated by a comma
{
; MsgBox %A_LoopReadLine%
loop, parse, A_LoopReadLine, %A_Tab%
{
IfWinNotExist, Multiloginapp - 01.3.15
{
Run, C:\Program Files (x86)\Multiloginapp\multiloginapp.exe
WinWait, Multiloginapp - 01.3.15
Sleep, 20000
}
IfWinNotActive, Multiloginapp - 01.3.15, ,WinActivate, Multiloginapp - 01.3.15
WinWaitActive, Multiloginapp - 01.3.15
Click 724, 260
sleep, 1500
WinWait, Multiloginapp - Mozilla Firefox
WinActivate, Multiloginapp - Mozilla Firefox
WinWaitActive, Multiloginapp - Mozilla Firefox
Click 408, 55
Sleep 5000
Send, ^a
Send, {Backspace}
SendInput, store.steampowered.com/account ; SendInput is faster in sending text
Send, {enter}
; Use:
; SendInput, %A_LoopField%
; if you want to send the current substring (field) from the line
MsgBox %A_LoopField%
}
}
return