简易脚本
SetSimMode 2
Dim path
Dim intX, intY
path = "C:\Users\doublexi\Desktop\按键素材\"
SaveMousePos
Do
For i = 1 To 20
TracePrint "执行图片"&i
Call clickPic(i)
Next
Call 常规决斗()
Delay 1000
Loop
Sub 常规决斗()
scanPic("抽卡")
If intX > 0 And intY > 0 Then
Call click(950,800)
Delay 1000
Call click(950,800)
End If
scanPic("主要")
If intX > 0 And intY > 0 Then
Call 行动()
End If
scanPic("战斗")
If intX > 0 And intY > 0 Then
Call 战斗()
End If
End Sub
Sub 战斗()
Delay 3000
FindPic 800,555,870,664,getPath("星星"),0.6,intX,intY
If intX > 0 And intY > 0 Then
Call 拖曳()
Delay 8000
End If
FindPic 900,555,1000,664,getPath("星星"),0.6,intX,intY
If intX > 0 And intY > 0 Then
Call 拖曳()
Delay 8000
End If
FindPic 1000,555,1120,664,getPath("星星"),0.6,intX,intY
If intX > 0 And intY > 0 Then
Call 拖曳()
Delay 8000
End If
Call 切换()
End Sub
Sub 行动()
Delay 3000
//普通怪兽卡
FindColorEx 650,900,1250,1080,"569DC4",0,0.9,intX,intY
If intX > 0 And intY > 0 Then
Call 拖曳()
Delay 500
Call 使用卡牌()
End If
Call 切换()
End Sub
Sub 切换()
intX = 1212
intY = 690
Call click(intX,intY)
Delay 1000
Call click(intX,intY)
End Sub
Sub 拖曳()
MoveTo intX, intY
Delay 500
LeftDown 1
Delay 500
MoveTo intX, intY - 50
Delay 250
MoveTo intX, intY - 100
Delay 250
MoveTo intX, intY - 150
Delay 250
MoveTo intX, intY - 200
Delay 250
MoveTo intX, intY - 250
Delay 250
LeftUp 1
Delay 250
End Sub
Sub 使用卡牌()
clickPic("召唤")
Delay 3000
End Sub
Function click(x,y)
MoveTo x,y
Delay 300
LeftDown 1
Delay 300
LeftUp 1
Delay 800
RestoreMousePos
End Function
Function getPath(file)
getPath=path&file&".bmp"
End Function
Function scanPic(file)
FindPic 0, 0, 1920, 1080, getPath(file), 0.6, intX, intY
End Function
Function clickPic(file)
FindPic 0, 0, 1920, 1080, getPath(file), 0.6, intX, intY
TracePrint intX&","&intY
If intX > 0 and intY > 0 Then
TracePrint "点击了"&file
Call click(intX,intY)
RightClick 1
End If
End Function
Function alert(msg)
MsgBox msg
End Function
Function pullLeft(x,y)
Dim s
s = 100
MoveTo x,y
Delay s
LeftDown 1
Delay 500
MoveTo x - 50, y
Delay s / 2
MoveTo x - 100, y
Delay s / 2
MoveTo x - 150, y
Delay s / 2
MoveTo x - 200, y
Delay s/2
MoveTo x - 250, yx
Delay s / 2
LeftUp 1
End Function