怎么设置不同按键,不同间隔循环
发布网友
发布时间:2023-03-04 14:47
我来回答
共1个回答
热心网友
时间:2024-12-03 14:24
单线程:
Dim Go_Time1, Go_Time2, Go_Time3
Go_Time1 = 0
Go_Time2 = 0
Go_Time3 = 0
Do
If DateDiff("s", Go_Time1, Now) >= 间隔时间1 Then
//按下按键A
KeyPress "A", 1
Go_Time1 = Now
End If
Delay 100
If DateDiff("s", Go_Time2, Now) >= 间隔时间2 Then
//按下按键B
KeyPress "B", 1
Go_Time2 = Now
End If
Delay 100
If DateDiff("s", Go_Time3, Now) >= 间隔时间3 Then
//按下按键C
KeyPress "C", 1
Go_Time3 = Now
End If
Loop
复制代码
多线程:
BeginThread 线程1
BeginThread 线程2
BeginThread 线程3
Sub 线程1
//KeyPress "A", 1
TracePrint 间隔时间1
Delay 间隔时间1
End Sub
Sub 线程2
KeyPress "B", 1
Delay 间隔时间2
End Sub
Sub 线程3
KeyPress "C", 1
Delay 间隔时间3
End Sub