基本命令
(一):触摸命令
//按键命令
KeyPress "1" //按键
KeyDown "1" //按下不松手
KeyUp "1" //松开弹起
//短暂点击坐标(100,200)
Tap 100,200 //短暂点击坐标(100,200)
//长按1000毫秒
Touch 0, 0, 1000 //长按1000毫秒
//滑动
Swipe 100,200,300,400
(二):控制命令
//循环50遍
For 50 //循环50遍
//循环体
Next
//判断
If 1+3>6 Then
//为真执行这里
End If
//子程序,相当于一个函数
Sub miniProject() //子程序开始
//子程序内容
End Sub //子程序结束
//调用子程序
Call miniProject()
(三):颜色命令
Dim intX, intY
FindColor 0, 0, 0, 0, "0000FF", 0, 0.90, intX, intY
If intX > -1 And intY > -1 Then
//在定义的范围内找到颜色值则执行这里的代码
End If
(四):图形命令
//找图命令
Dim intX, intY
FindPic 0, 0, 0, 0, "Attachment:闯关.png", "000000", 0, 0.9, intX, intY
If intX > -1 And intY > -1 Then
//如果找到了怎么处理,点一下
Tap intX,intY
End If
(五):设备命令
//获取屏幕宽
Dim screenX
screenX = GetScreenX()
//获取屏幕高
Dim screenY
screenY = GetScreenY()
//获取屏幕色彩
Dim colorDep
colorDep = GetScreenColorDep()
(六):其他命令
//输入文本
InputText "666"
//输出调试信息
TracePrint "666"
//toast
ShowMessage "666
//延时
Delay 1000
//启动app
RunApp "com.tencent.tmgp.sgame"
抓抓工具上面有好多东西:比如截图,多点比色,区域找图
//多点比色
If CmpColorEx("529|1209|100A03,396|1425|0B0706",0.9) = 1 Then
TracePrint 1
Else
TracePrint 0
End If