附近的人打招呼V1.0

来源:互联网 发布:网络协议的教学反思 编辑:程序博客网 时间:2024/04/30 13:32
//微信附近的人打招呼的脚本//开始按钮的响应事件Event Form1.Button1.ClickT1 = BeginThread (senMsg())End Event//发送打招呼信息Sub senMsg//读取文本框中要执行的人数personNumber = Form1.InputBox1.Text//MessageBox "人数是:" & personNumber Delay 100  MsgArray = ReadMsg(SelectMsgFile) MsgNumber = UBound(MsgArray) // MessageBox "消息数是:" & MsgNumber  For count = 1 To personNumber selectPerson = getRnd(1, 4) Call SlideScreenUp(selectPerson) selectMyMsg = getRnd(0, MsgNumber)// Msgbox "第 " & selectMyMsg & " 内容为:" & Cstr(MsgArray(selectMyMsg)) Call ClickItem (1) Delay 1000 //打招呼 Call Plugin.Sys.SetCLB(Cstr(MsgArray(selectMyMsg))) //判断是否找到“发消息按钮” Delay 3000 isFind = ClickHi If isFind > 0 Then  Delay 3000 Call Paste Delay 1000 Call ClickSend Delay 2000  End If //返回,返回到附近的人列表 Call ClickRetun  NextEnd Sub//带返回值的函数,读取提示语文件路径Function SelectMsgFile()SelectMsgFile = Plugin.File.SelectFile()End Function//读取提示语内容,返回提示语数组Function ReadMsg(Path)Text = Plugin.File.ReadFileEx(path)   //Msgbox "向目标文件读出文本内容为:"& Text    ReadMsg  = Split(Text, "|")End Function//查看读取到的内容//Sub LogMsg(array)//ArrayLength = UBound(array)//If ArrayLength>=0 Then   //    i=0   //    For ArrayLength//        Msgbox "第 " & i+1 &" 行文本内容为:"& Cstr(array(i))   //        i=i+1   //    Next//End If//End Sub//获取随机数Function getRnd(from, toNumber)RandomizegetRnd = Int(Rnd * (toNumber-from) + from )End Function//点击指定条目Sub ClickItem(index)//每一条的高度Dim  ItemHeightItemHeight = 67//第一条中心的Y坐标Dim  The1stY_coordinateThe1stY_coordinate = 168//所显示列表条目中心的X坐标Dim  ItemX_coordinateItemX_coordinate = 550    y_coordinate  = (The1stY_coordinate + ItemHeight * (index - 1))    MoveTo ItemX_coordinate, y_coordinate//    MessageBox "ClickItem x= " & ItemX_coordinate & ", y = " & y_coordinate    Delay 2110    LeftDown 1    Delay 20    LeftClick 1    Delay 3    LeftUp 1    Delay 3End Sub//向上滑动屏幕,向上滑动count条Sub SlideScreenUp(count)//每一条的高度Dim  ItemHeightItemHeight = 67//第一条中心的Y坐标Dim  The1stY_coordinateThe1stY_coordinate = 168//所显示列表条目中心的X坐标Dim  ItemX_coordinateItemX_coordinate = 550    startY = The1stY_coordinate + ItemHeight * count    MoveTo ItemX_coordinate, startY    Delay 2110    LeftDown 1    Delay 20    For c = 1 To count*13        MoveTo ItemX_coordinate, startY - ItemHeight/13*c        Delay 100    Next    MoveTo ItemX_coordinate, The1stY_coordinate-3    Delay 100    LeftUp 1    Delay 20End Sub//鼠标左键单击Sub MyLeftClickLeftDown 1    Delay 2    LeftClick 1    Delay 1    LeftUp 1End Sub//点击返回Sub ClickRetun    MoveTo 375, 111    Delay 4547    MyLeftClickEnd Sub//点击“打招呼”:打招呼按钮的位置不一定,因为有的有“更多”有的没有Function ClickHiDim checked_xDim checked_Y//这里点击窗口边缘很重要,为了更新屏幕显示,否则查不到对应颜色值MoveTo 288, 73Delay 1000MyLeftClick FindCenterColor 450, 350, 451, 600, "1AC045", checked_x, checked_Y MoveTo checked_x, checked_Y//MessageBox "rentun at " & checked_x & ", " & checked_YClickHi = checked_YIf checked_Y >0  Then Delay 500MyLeftClick End IfEnd Function//点击发送Sub ClickSendMoveTo 815, 107Delay 3000MyLeftClick//如果点击了发送就不需要点击返回了,返回到详细信息页面// Call ClickRetun End Sub//粘贴内容Sub PasteKeyDown "Ctrl", 1Delay 30KeyDown "V", 1Delay 200KeyUp "V", 1Delay 100KeyUp "Ctrl", 1Delay 30End Sub

0 0
原创粉丝点击