给微信群内好友轮流发私信
1,界面如图
2,程序中要找的图片为
3,程序源码如下:
/**
*此版本适合windows版微信,电脑的分辨率需要调到1366*768
*/
x = 387 //第一行第一列的横坐标
y = 94//第一行第一列的纵坐标
h = Form1.InputBox1.Text //每页的行数,超过一页的一律填5行
page = Form1.InputBox2.Text //群中成员总共的页数
flag = 0
t = Form1.InputBox3.Text //延迟时间
For j = 0 To page-1
flag = flag + 1
For i = 0 To h*13-1
//计算xy轴的坐标
If i >= 13 And i < 26 Then
y1 = y + 116
z = x + 75 * (i-13)
ElseIf i >= 26 And i < 39 Then
y1 = y + 116 * 2
z = x + 75 * (i-26)
ElseIf i >= 39 And i < 52 Then
y1 = y + 116 * 3
z = x + 75 * (i - 39)
ElseIf i >= 52 And i < 65 Then
y1 = y + 116 * 4
z = x + 75 * (i-52)
Else
y1 = y
z = x + 75 * i
End If
MoveTo z, y1
Delay 1000
LeftClick 1
Delay t
//查找图片,找到了则发私信
FindPic 0,0,1500,1000,"Attachment:\2.bmp",1,intX,intY
If intX > 0 And intY > 0 Then
//MessageBox "找到了"
MoveTo intX + 100, intY + 10 //移动到发消息按钮
Delay 1000
LeftClick 1
Delay t
/*按ctrl+v键粘贴要发送的内容*/
KeyDown 17, 1
KeyPress 86, 1
KeyUp 17, 1
Delay 1000
MoveTo 1322, 704 //移动到发送按钮
Delay 1000
LeftClick 1
//Form1.InputBox4.Text = i
//Form1.InputBox5.Text = j
Delay 1000
MoveTo 22, 142 //移动到微信通讯录的头像处,点击再次进入聊群
Delay 1000
LeftClick 1
Delay 1000
MoveTo 347, 94
Delay 1000
LeftClick 1
Delay 1000
/*找到该发送页,继续给好友发私信*/
If flag > 1 Then
For p = 0 To flag-2
If flag < page Then
KeyPress "PageDown", 1
Delay 1000
End If
Next
End If
Else
MoveTo z, 40
//MessageBox "没找到"
LeftClick 1
End If
Delay 1000
Next
If flag < page Then
KeyPress "PageDown", 1
Delay 1000
End If
Next
版权声明:本文为博主原创文章,未经博主允许不得转载。