免责声明
本视频内容纯属个人爱好,目的仅限于学习交流之用,对使用视频内的信息随之而来的风险与本人无关。本人不作任何承诺。也不为视频所提供的信息错误、残缺、延时或因依靠此类信息或文件所采取的任何行动负责。访问者可将本视频提供的内容或服务用于个人学习、研究或欣赏,以及其他非商业性或非盈利性用途,但同时应遵守著作权法及其他相关法律的规定,不得侵犯本人及相关权利人的合法权利。
游戏下载地址:
游戏下载地址:http://www.jo03.cn/download/sh/1.html
本章视频内容地址:
https://www.bilibili.com/video/BV1wD4y1m7iD
https://www.bilibili.com/video/BV1pD4y1m7FG
源代码:
Sub 攻击()
Dim MyValue,MyValue1
MyValue = Int(((80 - 0 + 1) * Rnd()) + 0)
MyValue1 = Int(((800 - 0 + 1) * Rnd()) + 0)
Touch 1814 + MyValue, 975 + MyValue, 2200 + MyValue1
End Sub
Sub 随机传送()
Dim MyValue
MyValue = Int(((80 - 0 + 1) * Rnd()) + 0)
Tap 1819 + MyValue, 259 + MyValue
End Sub
Sub 检测血条()
Dim intX,intY,k,intX1,intY1
k=0
For i = 1 To 3
//找怪物血条
FindMultiColor 1205,73,1565,202,"14A1E3-101010","158|72|13A0E4-101010,315|1|139FE4-101010",0,0.9,intX,intY
If intX > -1 or intY > -1 Then
TracePrint intX
TracePrint intY
//不操作,不随机
Exit For
End If
Delay 100
FindMultiColor 1205,73,1565,202,"14A1E3-101010","158|72|13A0E4-101010,315|1|139FE4-101010",0,0.9,intX,intY
If intX > -1 or intY > -1 Then
TracePrint intX
TracePrint intY
Exit For
End If
k = k + 1
TracePrint k
Next
If k = 3 Then
ShowMessage "未发现怪物,随机方向移动"
Call 随机方向移动()
FindColor 1584,1,1919,226,"0012CE-050505",0.9,1,intX1,intY1 //查找地图上有没有红点(怪物)
TracePrint intX1
If intX1 > -1 Then
//继续攻击
Call 攻击()
ElseIf intX1 = -1 Then
ShowMessage "打完怪物,随机传送"
Call 随机传送()
End If
End If
End Sub
Function 移动(x,y,z)
TouchDown 450,600, 1//按住屏幕上的100,100坐标不放,并设置此触点ID=1,原点
TouchMove x,y, 1, z//将ID=1的触点花200毫秒移动至300,300坐标
TouchUp 1//松开弹起ID=1的触点
End Function
Sub 随机方向移动()
Dim MyValue
MyValue = Int(((8-0+1) * Rnd()) + 0)
TracePrint MyValue
If 0 <= MyValue and MyValue <= 1 Then
//上
TracePrint "上"
For i = 1 To 10
Call 移动(450, 550, 300)
Delay 50
Next
ElseIf 1 < MyValue and MyValue <= 2 Then
//右上
TracePrint "右上"
For i = 1 To 10
Call 移动(550, 500, 300)
Delay 50
Next
ElseIf 2 < MyValue and MyValue <= 3 Then
//右
TracePrint "右"
For i = 1 To 10
Call 移动(500, 600, 300)
Delay 50
Next
ElseIf 3 < MyValue and MyValue <= 4 Then
//右下
TracePrint "右下"
For i = 1 To 10
Call 移动(550, 700, 300)
Delay 50
Next
ElseIf 4 < MyValue and MyValue<= 5 Then
//下
TracePrint "下"
For i = 1 To 10
Call 移动(450, 650, 300)
Delay 50
Next
ElseIf 5 < MyValue and MyValue<= 6 Then
//左下
TracePrint "左下"
For i = 1 To 10
Call 移动(350, 700, 300)
Delay 50
Next
ElseIf 6 < MyValue and MyValue<= 7 Then
//左
TracePrint "左"
For i = 1 To 10
Call 移动(400, 600, 300)
Delay 50
Next
ElseIf 7 < MyValue and MyValue<= 8 Then
//左上
TracePrint "左上"
For i = 1 To 10
Call 移动(350, 500, 300)
Delay 50
Next
End If
End Sub