【发布时间】:2021-12-20 00:48:57
【问题描述】:
那些 if 不起作用,因为 test() 不会从外部获取价值,但是如果我将其放入内部,我不知道应该如何编写代码......
有什么建议吗?
SetTimer, test, 2000 ;I started off with 1000 then worked up to this number to confirm this was happening
number := 1
test:
test()
return
test(){
if WinActive("program") {
ImageSearch, foundX, foundY, 2000, 0, 2560, 1440, target.png
if (ErrorLevel = 1) {
if (number = 1) {
CheckMap(z := "star.png")
number := 2
}
if (number = 2) {
CheckMap(z := "like.png")
number := 3
}
if (number = 3) {
CheckMap(z := "question.png")
number := 4
}
if (number = 4) {
CheckMap(z := "cross.png")
number := 1
}
}
}
}
CheckMap(x){
ImageSearch, foundX, foundY, 2000, 0, 2560, 1440, %x%
if (ErrorLevel = 0) {
MouseGetPos, StartX, StartY
Click, %foundX%, %foundY%
MouseMove, StartX, StartY
}
}
*[::
Suspend
Pause, 1
return
*]::
ExitApp
return
【问题讨论】:
标签: autohotkey