按键精灵多线程命令循环一定时间后终止

2024-12-27 13:50:31
推荐回答(1个)
回答1:

线程ID1=BeginThread(a)
线程ID2=BeginThread(b)
Dim n
n=now
Rem q
//脚本15秒后停止
Delay 1000
If DateDiff("s",n,now)>= 15 then
StopThread 线程ID1
StopThread 线程ID2
Else
Goto q
End If
Sub a
Rem q
Delay 1000
Goto q
End Sub
Sub b
Rem q
Delay 1000
Goto q
End Sub
Sub OnScriptExit()
MessageBox "脚本已经停止!"
End Sub