QuickMacroForNetEase
2021-01-24 14:16
标签:设置 控制 nap 了解 UNC roc back message 连接 按键精灵的语法和逻辑相对来说属于比较简单那种. 在手机操这方面, 按键精灵的Q小语言相对来说比较方便. 在使用过程当中, 需要搭配按键精灵手机助手, 和模拟器. 在使用脚本的过程当中需要开启安卓的ROOT权限, 不管是获取屏幕还是运行脚本都需要权限. QuickMacroForNetEase 标签:设置 控制 nap 了解 UNC roc back message 连接 原文地址:https://www.cnblogs.com/jrri/p/13252565.html
在使用过程当中完全可以根据需要,现学现用.
不过一些API在使用的过程当中还是需要有一定的了解之后, 才能在需要的时候立马能够想到.
不管是获取屏幕还是在使用的过程当中,有一些非常好用的借口提供. 如果采用编程语言, 需要提前部署好相当多的包和环境.
同时在模拟器中安装按键精灵手机版. 这时候通过PC上的按键精灵手机助手, 可以连接虚拟机. 实现对界面的控制.SetScreenScale 1920,1080,0
// 内容
Dim SayHello
SayHello = "Content"
// 总次数
Dim SayHeyTimes
SayHeyTimes = 20
// 计数器
Dim Counter
Counter = 0
// 启动程序
Function initApp
KillApp "com.netease.cloudmusic"
ShowMessage "重启应用"
Delay 1000
RunApp "com.netease.cloudmusic"
Delay 4000
End Function
// 寻找左上角菜单
Function FindSetButton(startButton)
Dim intX,intY
FindMultiColor 0,0,0,0,"333333","0|10|333333,0|21|333333,28|21|333333,28|11|3F3F3F,28|0|333333,15|2|FFFFFF,11|9|CDCDCD,10|20|666666",0,0.9,intX,intY
If intX > -1 And intY > -1 Then
TracePrint intX
TracePrint intY
startButton = Array(intX,intY)
FindSetButton=startButton
End If
End Function
// 寻找设置按钮
Function FindSet(setSignal)
Dim intX,intY
FindMultiColor 0,0,0,0,"4D4D4D","9|2|4E4E4E,17|1|4D4D4D,26|1|4D4D4D,14|15|4D4D4D,13|-14|828282,13|-4|6B6B6B,13|2|FFFFFF,50|-8|343434",0,0.9,intX,intY
If intX > -1 And intY > -1 Then
TracePrint intX
TracePrint intY
setSignal = Array(intX,intY)
FindSet=setSignal
End If
End Function
// 寻找按钮
Function findNearlyButton(nearlyButton)
Dim intX,intY
FindMultiColor 0,0,0,0,"4F4F4F","0|8|515151,0|22|4D4D4D,-11|2|717171,-3|2|505050,1|4|FFFFFF,4|3|585858,11|2|6A6A6A,38|-1|333333",0,0.9,intX,intY
If intX > -1 And intY > -1 Then
TracePrint intX
TracePrint intY
nearlyButton = Array(intX,intY)
findNearlyButton=nearlyButton
End If
End Function
// 人标识
Function findNearlySignal(nearlySignal)
Dim intX,intY
FindMultiColor 0,0,0,0,"747474","-10|13|F9F9F9,-11|18|DDDDDD,-17|15|404040,0|31|6A6A6A,16|16|565656,-11|16|464646,45|4|333333,45|29|454545",0,0.9,intX,intY
If intX > -1 And intY > -1 Then
TracePrint intX
TracePrint intY
nearlySignal = Array(intX,intY)
findNearlySignal=nearlySignal
End If
End Function
// 性别标志
Function findFemale(femaleSignal)
Dim intX,intY
FindMultiColor 0,0,0,0,"B685FF","16|-16|B685FF,-1|-5|B685FF,6|0|DFCAFF,16|-6|B685FF,5|-16|B685FF,7|-6|CFAEFF,15|-15|D5B9FF,-2|2|FFFFFF,14|-15|FEFDFF",0,0.9,intX,intY
If intX > -1 And intY > -1 Then
TracePrint intX
TracePrint intY
femaleSignal = Array(intX,intY)
findFemale=femaleSignal
End If
End Function
// 通过关注标志找按钮
Function findFollowButton(followButton)
Dim intX,intY
FindMultiColor 0,0,0,0,"3A3AFF","129|0|3A3AFF,21|-24|3A3AFF,109|-25|3A3AFF,19|25|3A3AFF,109|25|3A3AFF,36|0|FFFFFF,50|0|FFFFFF,43|-7|FFFFFF,43|7|FFFFFF",4,0.9,intX,intY
If intX > -1 And intY > -1 Then
TracePrint intX
TracePrint intY
intX = intX + 200
followButton = Array(intX,intY)
findFollowButton=followButton
End If
End Function
// 返回上个界面
Function backPrePage()
Tap 70,88
End Function
// 点击 编辑内容
Function clickContentButton()
Tap 100,1050
End Function
// 点击 发送内容
Function clickSendContentButton()
Tap 1870,1035
End Function
// 判断是否有发送过信息
Function findSendMessage(sendMessageContent)
Dim intX,intY
FindMultiColor 0,0,0,0,"3A3AFF","73|0|4343FF,11|20|3A3AFF,-31|0|4343FF,-8|45|E6E6E6,-104|129|4452FC,70|126|4452FC,52|125|FFFFFF,34|190|4452FC,-138|154|4452FC",4,0.9,intX,intY
If intX > -1 And intY > -1 Then
TracePrint intX
TracePrint intY
sendMessageContent = Array(intX,intY)
findSendMessage=sendMessageContent
End If
End Function
// 上滑400
Function swipDown
Swipe 1000, 600, 1000, 200
End Function
// 开始应用程序
Function start
Dim startButton
Dim i
i = 0
While i 0
i = i - 1
Wend
//当循环条件成立的时候,反复执行循环体
Dim followButton
Dim i=0
While i SayHeyTimes Then
ShowMessage "打招呼次数已经足够"
TracePrint "Enough, Ending The Script"
EndScript
End If
End If
// 无内容则发送信息
If not IsNull(sendMessageContent) Then
TracePrint "!存在记录: 返回"
End If
Delay 1000
Call backPrePage()
Delay 1000
End Function
Function sendingTheMessage()
TracePrint "发送信息过程ing"
Call clickContentButton()
Delay 2000
InputText SayHello
Delay 2000
Call clickSendContentButton()
Delay 4000
End Function
// 主程序
//Call start()
//Call nearlyPeople()
Call filterPeople()
//Call sendMessage()
文章标题:QuickMacroForNetEase
文章链接:http://soscw.com/index.php/essay/46364.html