//定义窗体1的按钮1的点击触发事件 Event Form1.Button1.Click //窗体1的输入框1的文本赋予变量title title = Form1.InputBox1.Text //找到QQ窗口句柄 Hwnd=Plugin.Window.Find("TXGuiFoundation",title) t = 1 //窗体1的输入框4的文本转化为int赋予变量times times = Int(Form1.InputBox4.Text) //数组真假赋予subfix subfix=Array(true,false) text = Form1.InputBox2.Text rate = Form1.InputBox3.Text //while循环 While t <= times OR times = 0 If subfix(Form1.ComboBox1.ListIndex) Then //后台发送文本加自增计数变量 Call Plugin.Bkgnd.SendString(Hwnd,text & t) Else //后台发送文本text Call Plugin.Bkgnd.SendString(Hwnd,text) EndIf //输入enter Call Plugin.Bkgnd.KeyPress(Hwnd, 13) t = t + 1 //发送事件间隔为变量rate Delay rate Wend EndEvent
Sub Tap(x,y) dm.MoveTo x,y Delay 50 dm.LeftClick Delay 150 EndSub
Sub TapR(x,y) dm.MoveTo x,y Delay 50 dm.RightClick Delay 150 EndSub
Function 多点比色(array) Dim intX, intY 多点比色 = False 多点比色 = dm.FindMultiColor(0,0,1464,854,array(0),array(1),0.9,0,intX,intY) EndFunction
Function 等待多点比色(array, time) Dim intX, intY 等待多点比色 = False Do If dm.FindMultiColor(0, 0, 1464,854, array(0), array(1), 0.9, 0, intX, intY) Then 等待多点比色 = True ExitDo Else Delay time * 100 EndIf Loop EndFunction
Function 自动攻击() Dim 检测未在攻击 检测未在攻击 = 0 For10 If 多点比色(比色_攻击) Then //TracePrint "自动攻击中" 自动攻击 = true ExitFor Else 检测未在攻击 = 检测未在攻击 + 1 If 检测未在攻击 = 10Then TracePrint "检测未在攻击,准备开启自动攻击"&检测未在攻击 自动攻击 = False EndIf EndIf Delay 100 Next EndFunction
Function 开启自动攻击() //If 多点比色(比色_危险区) Then If 自动攻击() Then Else TracePrint "开启自动攻击" Tap 1111,641 //dm.KeyPressChar "z" Delay 1000 EndIf //Else //TracePrint "安全区,无需自动攻击" //EndIf EndFunction
Dim 无怪随机间隔,无怪随机开始时间 无怪随机间隔 = 50 无怪随机开始时间 = 当前时间() Function 无怪随机() If 多点比色(比色_危险区) Then If 多点比色(比色_有怪) Then TracePrint "随机->有怪" 无怪随机开始时间 = 当前时间() Else TracePrint "随机->持续无怪时间" & int(当前时间() - 无怪随机开始时间) & "秒" If 当前时间() - 无怪随机开始时间 > 无怪随机间隔 * 1Then 点击随机 无怪随机开始时间 = 当前时间() EndIf EndIf EndIf EndFunction
Dim 无怪回城间隔,无怪回城开始时间 无怪回城间隔 = 3*60 无怪回城开始时间 = 当前时间() Function 无怪回城() If 多点比色(比色_危险区) Then If 多点比色(比色_有怪) Then TracePrint "回城->有怪" 无怪回城开始时间 = 当前时间() Else TracePrint "回城->持续无怪时间" & int(当前时间() - 无怪回城开始时间) & "秒" If 当前时间() - 无怪回城开始时间 > 无怪回城间隔 * 1Then 点击回城 无怪回城开始时间 = 当前时间() EndIf EndIf EndIf EndFunction
Function 自动购买随机() Tap 1157,778 TracePrint "点击商城" Delay 500 If 等待多点比色(Array("E7AE1C","0|-5|710602,3|0|510503,-4|1|000000"), 3) Then Tap 841, 428 Delay 500 For13 dm.WheelDown Delay 50 Next Tap 508,579 TracePrint "点击随机" Delay 500 If 等待多点比色(Array("BBAE96","-1|0|111111,2|3|4D4840,4|2|D2C3A8,4|0|F8E6C6"), 3) Then Tap 965,568 TracePrint "点击确定" Delay 500 Tap 1118,221 TracePrint "关闭商城" Delay 1000 EndIf EndIf EndFunction
Function 自动购买回城() Tap 1157,778 TracePrint "点击商城" Delay 500 If 等待多点比色(Array("E7AE1C","0|-5|710602,3|0|510503,-4|1|000000"), 3) Then Tap 841, 428 Delay 500 For13 dm.WheelDown Delay 50 Next Tap 992,426 TracePrint "点击回城" Delay 500 If 等待多点比色(Array("BBAE96","-1|0|111111,2|3|4D4840,4|2|D2C3A8,4|0|F8E6C6"), 3) Then Tap 965,568 TracePrint "点击确定" Delay 500 Tap 1118,221 TracePrint "关闭商城" Delay 1000 EndIf EndIf EndFunction
Dim 副本数组, 顺序副本下标, 选择条件 副本数组 = Array() 顺序副本下标 = 0 Function 自动副本() If 多点比色(比色_安全区) Then If 顺序副本下标 = UBound(副本数组) Then 选择条件 = 副本数组(顺序副本下标) 顺序副本下标 = 0 Else 选择条件 = 副本数组(顺序副本下标) 顺序副本下标 = 顺序副本下标 + 1 EndIf TracePrint 选择条件 If 选择条件 = null Then TracePrint "未选择副本" Delay 1000 EndIf
Function 自动协助() If 判断时间是否介于(12, 12) or 判断时间是否介于(21, 21) Then If 多点比色(比色_协助) Then Tap 1295,335 TracePrint "前往协助" Delay 500 开启自动攻击 Delay 500 '检测是否在恶魔祭坛 If dm.FindMultiColor(1346, 32, 1466, 56, "838383", "1|0|ECECEC,1|3|838383,4|5|B6B6B6,5|5|9A9A9A,6|3|202021,10|2|838383,9|1|111111", 0.9,1, x, y) Then TracePrint "检测到在恶魔祭坛" Delay 2000 Do If 多点比色(比色_有怪) Then TracePrint "恶魔祭坛->有怪" Delay 2000 Else TracePrint "恶魔祭坛->无怪,准备回城" Delay 500 Tap 300, 230 Delay 500 Tap 840, 510 Delay 500 ExitDo EndIf Loop EndIf Else TracePrint "未检测到协助" EndIf Else 'TracePrint "当前不是协助时间" EndIf EndFunction
Function 自动攻城() '检测到攻城感叹号和在石原,如果在开启自动攻击,如果不在去石原 If 多点比色(比色_攻城) Then Tap 539, 638 TracePrint "检测到攻城,点击感叹号" Delay 1000 Tap 629, 510 TracePrint "点击石原攻城" Delay 1000
'检测是否在石原,如果在 If dm.FindMultiColor(1346, 32, 1466, 56, "F1F1F1", "0|1|B6B6B6,1|1|111111,2|2|E6E6E6,4|1|B6B6B6,-2|2|232223", 0.9, 1, x, y) Then If 多点比色(比色_攻击) Then TracePrint "未开启自动攻击,准备开启自动攻击" dm.keypresschar "z" Delay 1000 Else TracePrint "已开启自动攻击" EndIf Do If 多点比色(比色_攻城) Then 开启自动攻击 TracePrint "自动攻城中..." 自动回收 Delay 1000*60 Else TracePrint "攻城结束" ExitDo EndIf