找回密码
 加入
搜索
查看: 3697|回复: 5

[AU3基础] 如何不给脚本暂停

  [复制链接]
发表于 2013-3-28 20:23:24 | 显示全部楼层 |阅读模式
比如我用AU3脚本来运行几个程序,即软件登录窗口出现后自动输入用户名和密码,登录,然后再登录第二个窗口,第三个窗口,最后关闭所有窗口,再重复第二次登录,如果某个窗口登录超时时间不长就会自动重新登录,但某一窗口登录时间太久了就会使脚本停止,后面的窗口就不运行了,应该怎么解决这个问题
发表于 2013-3-28 20:58:05 | 显示全部楼层
不明白楼主是什么意思,楼下继续。
发表于 2013-3-28 21:03:38 | 显示全部楼层
LZ 的"循环"好长~~~~~~~~

个人的理解是    如果某个账号登录超时就会使脚本停留在运行 WinWait 之类的函数


楼下继续
发表于 2013-3-29 13:54:29 | 显示全部楼层
回复 1# hz2004cj
可以多进程来打开一个个窗口,这样不会有脚本停止之虞!
发表于 2013-4-3 21:28:58 | 显示全部楼层
顶楼上,可惜Au3还不支持多线程!
发表于 2013-4-25 15:19:32 | 显示全部楼层
$Form1 = GUICreate("多線程實例", 272, 139, -1, -1)
$Label1 = GUICtrlCreateLabel("00:00:00:00", 8, 8, 146, 17)
$Label2 = GUICtrlCreateLabel("0", 8, 56, 150, 17)
$Label3 = GUICtrlCreateLabel("", 8, 104, 148, 17)
$Button1 = GUICtrlCreateButton("關閉線程1", 168, 8, 89, 25, 0)
$Button2 = GUICtrlCreateButton("關閉線程2", 168, 48, 89, 25, 0)
$Button3 = GUICtrlCreateButton("關閉線程3", 168, 96, 89, 25, 0)
GUISetState(@SW_SHOW)
Global $t2, $t3 = 1
$Timer = DllCallbackRegister("Timer", "int", "hwnd;uint;uint;dword")
$TimerDLL = DllCall("user32.dll", "uint", "SetTimer", "hwnd", 0, "uint", 0, "int", 1000, "ptr", DllCallbackGetPtr($Timer))
$Timer2 = DllCallbackRegister("Timer", "int", "hwnd;uint;uint;dword")
$Timer2DLL = DllCall("user32.dll", "uint", "SetTimer", "hwnd", 0, "uint", 0, "int", 200, "ptr", DllCallbackGetPtr($Timer2))
$Timer3 = DllCallbackRegister("Timer", "int", "hwnd;uint;uint;dword")
$Timer3DLL = DllCall("user32.dll", "uint", "SetTimer", "hwnd", 0, "uint", 0, "int", 500, "ptr", DllCallbackGetPtr($Timer3))
While 1
        Switch GUIGetMsg()
                Case - 3
                        Exit
                Case $Button1
                        DllCall("user32.dll", "int", "KillTimer", "hwnd", 0, "uint", $TimerDLL)
                        DllCallbackFree($Timer)
                Case $Button2
                        DllCall("user32.dll", "int", "KillTimer", "hwnd", 0, "uint", $Timer2DLL)
                        DllCallbackFree($Timer2)
                Case $Button3
                        DllCall("user32.dll", "int", "KillTimer", "hwnd", 0, "uint", $Timer3DLL)
                        DllCallbackFree($Timer3)
        EndSwitch
WEnd
Func Timer($hWnd, $uiMsg, $idEvent, $dwTime)
        If $idEvent = $TimerDLL[0] Then
                GUICtrlSetData($Label1, @HOUR & ":" & @MIN & ":" & @SEC & ":" & @MSEC)
        ElseIf $idEvent = $Timer2DLL[0] Then
                $t2 += 1
                GUICtrlSetData($Label2, $t2)
        ElseIf $idEvent = $Timer3DLL[0] Then
                $t3 *= 2
                GUICtrlSetData($Label3, $t3)
        EndIf
EndFunc
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-1 14:20 , Processed in 0.074494 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表