【发布时间】:2015-03-16 14:35:55
【问题描述】:
我的 AutoIt 脚本可以编译,但没有完成它应该做的事情。代码:
HotKeySet(+"{G}","gather")
While 1
sleep(100)
WEnd
Global $charRunTimeS = 2;
Global $collectKey = "{LWIN}";
Global $vehicleInvKey = "{T}";
Global $charRunTimeMS = $charRunTimeS * 1000
Global $posItemX = 820;
Global $posItem1Y = 300;
Global $posItem2Y = 340;
Global $posItem3Y = 365;
Global $posItem4Y = 397;
Global $posBtnStore = 678;
Global $posItemSelectedY = $posItem4Y
Func gather()
$counter = 0;
While $counter <= 2
Send("{s down}")
Sleep($charRunTimeMS)
Send("{s up}")
$counter1 = 0;
While $counter1 <= 4
Send($collectKey)
Sleep(100)
Send($collectKey)
Sleep(30000)
$counter1 = $counter1 + 1
WEnd
Send("{w down}")
Sleep($charRunTimeMS)
Send("{w up}")
Send($vehicleInvKey)
MouseClick("primary", $posItemX, $posItemSelectedY)
$counter2 = 0;
While $counter2 <= 30
MouseClick($posItemX, $posBtnStore)
$counter2 = $counter2 + 1
WEnd
Send("{ESC}")
$counter = $counter + 1
WEnd
EndFunc
调试输出。第一行是编译运行时,第二行是我停止代码时:
"C:\Program Files (x86)\AutoIt3\SciTE..\autoit3.exe" /ErrorStdOut "C:\Users\RichusX\Desktop\AltisGatherScript.au3"
进程没有响应;强制终止... 退出代码:1 时间:14.39
【问题讨论】:
-
函数“gather”在哪里调用?
-
@UweKeim 来自
HotKeySet(+"{G}","gather"),由于格式化,它在代码块之外,但据我所知应该在里面。
标签: autoit