/* 按下指定按键执行操作 */
Do
key = WaitKey()
/* F2 */
If key = 113 Then
KeyDown "Ctrl" , 1
Delay 30
KeyPress "C" , 1
Delay 30
KeyUp "Ctrl" , 1
Delay 30
/* F4 */
ElseIf key = 115 Then
KeyDown "Ctrl" , 1
Delay 30
KeyPress "V" , 1
Delay 30
KeyUp "Ctrl" , 1
Delay 30
End If
Loop
/* 提示框找鼠标键码 */
last_click = WaitClick()
MessageBox "您按下了" & last_click
Do
mouse = WaitClick()
/* 按下鼠标左键键码 */
If mouse = 32769 Then
Do
KeyPress "a" , 1
/* 弹起鼠标左键 */
If GetLastClick() = 32770 Then
Exit Do
End If
Loop
End If
Loop
找图:
设置参照物相对路径:抓抓->框选图片->另存为->把图片加入附件中->
全部命令->颜色/图形命令->FindPic找图->插入->->->
/* 找到记事本并写入4个a */
Do
FindPic 0,0,1920,1080,"Attachment:\记事本.bmp",0.9,intX,intY
If intX > -1 Then
TracecPrint "图片坐标:" & intX & "," & intY
/*
左上角坐标
相对坐标(15,99)
*/
IfColor intX + 15 , intY+99 , "FFFFFF" , 0 Then
MoveTo 734, 267
LeftClick 1
Delay20
key = WaitKey()
/* 等待按A */
If key = 65 Then
KeyPress "A", 4
End If
End If
Delay20
End If
Loop
标签:Do,End,30,基础,识图,Delay,循环,key,intX From: https://www.cnblogs.com/aQxiong/p/18327689