|
KeepScreen True RunApp "com.tencent.mm" Dim intX, intY,返回值,searchTime,contactsTime,keyWord,sendMessage
searchTime = 800//跳转至搜索界面的延时 contactsTime = 300//跳转至聊天界面的延时 keyWord = "12345678"//搜索关键词 sendMessage="biu~biu~biu~"//发送内容
Do If click_search() Then Do If search_ui() Then Exit Do End If Delay 100 Loop End If If click_contacts() Then contacts_ui End If If send_message() Then click_send_button End If Delay 100 Loop
//点击搜索按钮进入搜索界面 Function click_search() If FindPic(505, 54, 602, 135, "Attachment:搜索.png", "000000", 0, 0.85, intX, intY) > -1 Then TracePrint "点击搜索" Tap intX, intY Delay searchTime click_search = True Else click_search = False End If End Function
//在搜索界面输入搜索关键词 Function search_ui() If FindPic(621, 57, 711, 128, "Attachment:搜索界面.png", "000000", 0, 0.85, intX, intY) > -1 Then TracePrint "找到搜索界面" InputText keyWord search_ui = True Else search_ui = False End If End Function
//点击根据关键词搜索出的联系人 Function click_contacts() If FindPic(133, 309, 245, 354, "Attachment:微信号.png", "000000", 0, 0.85, intX, intY) > -1 Then Tap intX, intY TracePrint "点击联系人" Delay contactsTime click_contacts = True Else click_contacts = False End If End Function
//判断是否进入聊天界面 Function contacts_ui() If FindPic(621, 54, 706, 134, "Attachment:联系人界面.png", "000000", 0, 0.85, intX, intY) > -1 Then contacts_ui = True Else contacts_ui = False End If End Function
//输入发送内容 Function send_message() If FindPic(7, 515, 113, GetScreenY(), "Attachment:输入文字.png", "000000", 0, 0.85, intX, intY) > -1 Then Tap intX+100, intY+30 Delay 100 InputText sendMessage send_message = True Else send_message = False End If End Function
//点击发送按钮 Function click_send_button() If FindPic(586, 0, 719, 1279, "Attachment:发送.png", "000000", 0, 0.85, intX, intY) > -1 Then Tap intX, intY click_send_button = True Else click_send_button = False End If End Function
|