//定义一个变量n
Dim n=1
TracePrint n//控制台打印输出为1
什么是变量?
你可以理解为变量就是一个容器,是一个用于存放程序数据的容器
计算机嘛,当然最核心的功能就是"计算",计算需要数据,那数据从哪里来?数据要存在内存中,那要怎么存呢?变量=值即可
Dim name="肖"
Dim age=20
Dim sex="男"
区域找图
按键精灵抓抓功能我就不介绍了,玩这玩意的应该都会用
Dim intX,intY
FindPic 0,0,0,0,"Attachment:4.png","000000",0,0.9,intX,intY
If intX > -1 And intY > -1 Then
TracePrint "找到了"
TracePrint intX
TracePrint intY
Else
TracePrint "未找到"
End If
-1的意思是该图未找到

我解释一下这个代码,当变量intX,变量intY该图片位置坐标大于-1的时候,说明已经找到了图片,输出为"找到了",并输出该图片坐标,如果没有找到则输出"未找到"
If开始,End If为判断结束
多图查找
Dim intX,intY,返回值 //定义坐标
返回值=FindPic( 0,0,0,0,"Attachment:1png|Attachment:3.png|Attachment:4.png","000000",0,0.9,intX,intY)
If 返回值 = 0 Then
//如果找到下标0,执行操作
TracePrint "修改密码咯"
TracePrint 0
ElseIf 返回值=1 Then
//找到下标1
TracePrint "验证码页"
TracePrint 1
ElseIf 返回值 = 2 Then
//找到下标2
TracePrint "执行相关操作"
TracePrint 2
End If
多点找色
//多点找色
Dim intX,intY
FindMultiColor 0,0,0,0,"5599FF","112|8|51A64B",0,0.9,intX,intY
If intX > -1 And intY > -1 Then
TracePrint intX
TracePrint intY
TracePrint "颜色已找到!!"
End If
当然用法都差不多
滑块
Swipe 72,561,76,301,600//滑动延时600毫秒
在屏幕中从哪个位置坐标滑到哪个位置坐标,如果不加延时看不到效果
主要用途当然在自动刷视频什么的之类的脚本
for循环
For 5
//for循环为next结尾
//打印每次m
Delay 500//给个500毫秒延时,可以看到效果
//相当于每隔500毫秒打印一次字符串m
TracePrint "m"//此时会连续打印5次m
Next
//定义一个变量
Dim m="1,2,3,4,5,6,7,8"
//把m分割成数组保存到变量n
Dim n=Split(m,",")//用逗号分割
TracePrint UBound(n)//最大下标
For i = 0 To UBOUND(n)
TracePrint "当前:"&i
Delay 1000//每次延时一秒执行一次
If i = 5 Then
TracePrint "哈哈,你已经循环了5次了"
EndScript//跳出循环
End If
Next
启动手机里某一个应用
RunApp "com.cyjh.mobileanjian"//启动按键精灵
KillApp "com.cyjh.mobileanjian"//关闭按键精灵
触发按键
KeyPress "w", 1 //按下键盘w键1次
KeyPress "r", 2 //按下键盘r键2次
操作input搜索框
Dim n
n = "肖"
InputText n
函数
//点击按钮后,执行循环,之后执行滑动函数的代码
Call 点击按钮()//调用,如果不调用该函数,该函数不会执行,这个函数执行完之后,就会销毁,释放内存
Function 点击按钮()
For 5
Delay 1000//每隔一秒输出打印"肖"
TracePrint "肖"
Next
Dim n=600//定义一个变量,n=600
//调用滑动函数传参
Call 滑动(n)
End Function
//滑动函数
//接收参数n
Function 滑动(n)
Swipe 72,561,76,301,n//滑动延时600毫秒
End Function
以上都是些常用的语法,还有很多没有一一列出,这语言相对来说比较简单,有一定编程基础应该是看的懂的
网友评论