// #### 字库部分 ####
SetRowsNumber(0)
//注意:每次制作完字库后,需要自行把制作的字库文件添加到脚本“附件”中
SetDictEx(0, “Attachment:mq_soft.txt”)
SetDictEx(1, “Attachment:army_mq_soft.txt”)
SetDictEx 2, “Attachment:troopsfont.txt”
SetDictEx(3, “Attachment:attack_font.txt”)
SetDictEx(4, “Attachment:attack_elixir.txt”)
/*
字库0
ocrchar = Ocr(1080, 97, 1206, 120, “FFFFFF-111111|C4CCC8-060606|EFF1F0-111111”, 0.9)
字库1
ocrchar=Ocr(intX,intY,intX2,intY2,“FFFFFF-111111|F2E7DC-010101|F9F4EE-010101”,0.9)
字库2
ocrchar = Ocr(85, 86, 310, 115, “FFFFFF|FEFCFA-010101|FEFDFC-010101|DCDEDE-010101”, 0.9)
字库3
ocrchar1 = Ocr(63, 89, 175, 114, “CCFBFF-111111|91C2BF-111111”, 0.9)
字库4
ocrchar2 = Ocr(63, 125, 175, 150, “FDE8FF-111111|C2C4CF-111111”, 0.9)
*/
// #### 系统检测变量及程序 ####
Dim OriginalS
// 初始时间
OriginalS = Time()
/*
For 10
ShowMessage “##########################################\n######## 呆呆机器人使用注意事项 ########\n##########################################\n#### 1在呆呆运行前,需要您手动将兵 ####\n#### 营清空。 ####\n#### 2请在呆呆运行前将游戏语言设置 ####\n#### 为简体中文,呆呆不懂除简体中 ####\n#### 文外的其他语言哦。 ####\n#### 3呆呆运行时,请不要进行再操作 ####\n#### 游戏,以避免呆呆犯傻。 ####\n#### 4如需要暂停呆呆,请直接点击停 ####\n#### 止按钮。再次运行呆呆前,需要 ####\n#### 您再次手动清空兵营。 ####\n##########################################\n 偷偷告诉你: \n “呆呆的QQ群号码是 200186446”\n##########################################”
Delay 2000
Next
Delay 2000
*/
Call isScreenReady() // 屏幕分辨率和DPI检测
Call isLoginReady() // 游戏检测
// #### 全局变量 ####
Dim zoomScreenTimes = 3
// 缩放屏幕次数
Dim originalGold = -1, originalElixir = -1, originalDark = -1, originalTrophy = -1
// 初始资源
Dim gold = -1, elixir = -1, dark = -1, trophy = -1
// 资源
Dim dGold = 0, dElixir = 0, dDark = 0, dTrophy = 0
Dim dGoldString, dElixirString, dDarkString, dTrophyString
// 资源差值,字符串
Dim runS = 0, runTimeString = “0 秒”
// 已经运行的秒数,已经运行的时间字符串
Dim pGold = 0, pElixir = 0, pDark = 0
Dim pGoldString, pElixirString, pDarkString
// 预计增长值 每日
Dim multiple = 1
// 倍数
Dim armyBarbarianNumber = 0, armyGiantNumber = 0, armyArcherNumber = 0, armyStateString="-", sumHaveArmySpace, armyCampSpace = 0
// armyBarbarianNumber 类:各兵种数量
// armyStateString 军队概况提示文本
// sumHaveArmySpace 兵营已用空间
// armyCamSpace 兵营总空间
Dim backBarbarian = 60, backGiant = 12, backArcher = 80
// 备用兵 待训练各兵数量
Dim backKinds = 3
// 备用兵 待训练兵种数
Dim backBarbarianN = 2, backGiantN = 3, backArcherN = 1
// 备用兵 训练顺序
Dim goalBarbarian = 60, goalGiant = 12, goalArcher = 80
// 目标兵 待训练各兵数量
Dim goalKinds = 3
// 目标兵 待训练兵种数
Dim goalBarbarianN = 2, goalGiantN = 1, goalArcherN = 3
// 目标兵 训练顺序
Dim dGoalBarbarian = 0, dGoalGiant = 0, dGoalArcher = 0
// 目标并与已有兵数量差值
Dim box = 0// 迭代器
Dim trainFlag = 0
// 练兵标志,为 0 说明没有开始练兵,为 1 说明已经开始练兵
Dim 闪黑选项 = 1
Dim 只打死鱼 = 1
Dim 敌人资源总量最低限制 = 300000
Dim 出战前状态信息
Dim 敌人gold = 0, 敌人elixir = 0, 敌人资源总量 = 0
// ####################
// #### 主循环程序 ####
// ####################
While 1
敌人gold = 0
敌人elixir = 0
敌人资源总量 = 0
If CmpColorEx(“711|554|1FBB6C-111111,713|519|75F4D6-111111”,0.9) = 1 Then
TracePrint 1
Tap 633, 537
Else
TracePrint 0
End If
Call isConnect()
// 断线重连系统(已经验证)
If isMainWindow() > 0 Then
If zoomScreenTimes > 2 Then
zoomScreenTimes = 2
Call zoomScreen()
Else
zoomScreenTimes = zoomScreenTimes + 1
End If
End If
// 缩放屏幕,每2轮缩放一次(已经验证)
If isMainWindow() > 0 Then
If originalGold < 0 Then
originalGold = getGold()
originalElixir = getElixir()
originalDark = getDark()
originalTrophy = getTrophy()
If originalGold < 0 Or originalElixir < 0 Or originalDark < 0 Or originalTrophy < 0 Then
ShowMessage “读取奖杯数量或资源数值失败!”
Delay 1000
End If
End If
End If
// 初始资源记录(已经验证)
If isMainWindow() > 0 Then
Call collectResource()
End If
// 采集资源(已经验证)
trainFlag = 0
// 【未注释】
Rem halfProgram
// 【未注释】
If isMainWindow() > 0 Then
gold = getGold()
elixir = getElixir()
dark = getDark()
trophy = getTrophy()
End If
// 记录资源数据(已经验证)
dGold = gold - originalGold
dElixir = elixir - originalElixir
dDark = dark - originalDark
dTrophy = trophy- originalTrophy
// 计算资源量与初始资源的差值(已经验证)
runS = Time() - OriginalS
runS = runS + 600
// 计算目前时间与初始事件的差值,默认+600s(已经验证)
multiple = CDbl(CDbl(86400) / CDBl(runS))
// 计算预测资源需要乘以初始资源的倍数(已经验证)
pGold = multiple * dGold
pElixir = multiple * dElixir
pDark = multiple * dDark
// 计算预计每日资源收益(已经验证)
For 3
ShowMessage “我是呆呆机器人,这是我统计的信息\n#机器人接管后的数据统计\n 奖杯增减:” & CStr(dTrophy) & " 个\n 金币收益:" & bigNTS(dGold) & " 个\n 圣水收益:" & bigNTS(dElixir) & " 滴\n 暗黑重油收益:" & bigNTS(dDark) & " 滴\n#预计每日收益\n 金币预计:" & bigNTS(CLng(pGold)) & " 个/天\n 圣水预计:" & bigNTS(CLng(pElixir)) & " 滴/天\n 暗黑重油预计:" & bigNTS(CLng(pDark)) & " 滴/天\n#注意:务必在使用机器人前将兵营清空\n#呆呆已经运行 " & timeToStr(Time(), OriginalS) & “了\n#想和呆呆聊天请加群哦(群号:20018 6446)”
Delay 1000
Next
ShowMessage “我是呆呆机器人,这是我统计的信息\n#机器人接管后的数据统计\n 奖杯增减:” & CStr(dTrophy) & " 个\n 金币收益:" & bigNTS(dGold) & " 个\n 圣水收益:" & bigNTS(dElixir) & " 滴\n 暗黑重油收益:" & bigNTS(dDark) & " 滴\n#预计每日收益\n 金币预计:" & bigNTS(CLng(pGold)) & " 个/天\n 圣水预计:" & bigNTS(CLng(pElixir)) & " 滴/天\n 暗黑重油预计:" & bigNTS(CLng(pDark)) & " 滴/天\n#注意:务必在使用机器人前将兵营清空\n#呆呆已经运行 " & timeToStr(Time(), OriginalS) & “了\n#想和呆呆聊天请加群哦(群号:20018 6446)”
Delay 3000
// 屏幕显示状态提示,5s(已经验证)
If isMainWindowButtonEnabled() > 0 Then
Tap 53, 526
Delay 500
End If
// 打开军队概况面板(已经验证)
If isArmyWindow() > 0 Then
armyStateString = “军队概况:” // 提示信息恢复默认
armyBarbarianNumber = getArmyBarbarianNumber()
armyGiantNumber = getArmyGiantNumber()
armyArcherNumber = getArmyArcherNumber()
// 读取军队个数
sumHaveArmySpace = armyBarbarianNumber + armyGiantNumber * 5 + armyArcherNumber
armyCampSpace = readArmyCampSpace()
armyStateString = armyStateString & sumHaveArmySpace & " / " & armyCampSpace
ShowMessage armyStateString
Delay 1000
End If
// 读取军队种类数和个数并显示提示信息(已经验证)
If sumHaveArmySpace >= armyCampSpace Then
Call exitTroopsWindow()
Delay 1000
Goto 出战
End If
// 首次检测兵营是否已满,如果已满,切换至出战,未满,继续
If isArmyWindow() > 0 Then
Tap 463, 44
Delay 1000
End If
// 第一次切换至训练面板
If isTrainTroopsWindow() > 0 Then
Call clearMoreTroops()
End If
// 清除多余的军队
If isTrainTroopsWindow() > 0 Then
Tap 194, 44
Delay 500
End If
// 切换至军队概况面板
If isArmyWindow() > 0 Then
armyStateString = “军队概况:” // 提示信息恢复默认
armyBarbarianNumber = getArmyBarbarianNumber()
If armyBarbarianNumber <> Null Then
ShowMessage "Barbarian: " & armyBarbarianNumber
Delay 500
End If
armyGiantNumber = getArmyGiantNumber()
If armyGiantNumber <> Null Then
ShowMessage "Giant: " & armyGiantNumber
Delay 500
End If
armyArcherNumber = getArmyArcherNumber()
If armyArcherNumber <> Null Then
ShowMessage "Archer: " & armyArcherNumber
Delay 500
End If
// 读取军队个数
sumHaveArmySpace = armyBarbarianNumber + armyGiantNumber * 5 + armyArcherNumber
armyCampSpace = readArmyCampSpace()
armyStateString = armyStateString & sumHaveArmySpace & " / " & armyCampSpace
ShowMessage armyStateString
Delay 1000
End If
// 读取军队种类数和个数并显示提示信息(已经验证)
If isArmyWindow() > 0 Then
Tap 463, 44
Delay 500
End If
// 打开训练面板(已经验证)
If isTrainTroopsWindow() > 0 Then
If sumHaveArmySpace < armyCampSpace Then
// 以下为练目标兵
dGoalBarbarian = goalBarbarian - armyBarbarianNumber
dGoalGiant = goalGiant - armyGiantNumber
dGoalArcher = goalArcher - armyArcherNumber
If dGoalBarbarian < 0 Then
dGoalBarbarian = 0
End If
If dGoalGiant < 0 Then
dGoalGiant = 0
End If
If dGoalArcher < 0 Then
dGoalArcher = 0
End If
box = 1
While box < (goalKinds+1)
If goalBarbarianN = box Then
If isTrainTroopsWindow() > 0 Then
For dGoalBarbarian
//If isBarbarianTrainReady() > 0 Then
Tap 130, 444
Delay 30
//End If
Next
End If
ElseIf goalGiantN = box Then
If isTrainTroopsWindow() > 0 Then
For dGoalGiant
//If isGiantTrainReady() > 0 Then
Tap 261, 444
Delay 30
//End If
Next
End If
ElseIf goalArcherN = box Then
If isTrainTroopsWindow() > 0 Then
For dGoalArcher
//If isArcherTrainReady() > 0 Then
Tap 130, 584
Delay 30
//End If
Next
End If
End If
box = box + 1
Wend
// 以下为继续练备用兵
trainFlag = 1
box = 1
While box < (backKinds+1)
If backBarbarianN = box Then
If isTrainTroopsWindow() > 0 Then
For BackBarbarian
//If isBarbarianTrainReady() > 0 Then
Tap 130, 444
Delay 30
//End If
Next
End If
ElseIf backGiantN = box Then
If isTrainTroopsWindow() > 0 Then
For backGiant
//If isGiantTrainReady() > 0 Then
Tap 261, 444
Delay 30
//End If
Next
End If
ElseIf backArcherN = box Then
If isTrainTroopsWindow() > 0 Then
For backArcher
//If isArcherTrainReady() > 0 Then
Tap 130, 584
Delay 30
//End If
Next
End If
End If
box = box + 1
Wend
Else
// 以下为练备用兵
trainFlag = 1
box = 1
While box < (backKinds+1)
If backBarbarianN = box Then
If isTrainTroopsWindow() > 0 Then
For BackBarbarian
//If isBarbarianTrainReady() > 0 Then
Tap 130, 444
Delay 30
//End If
Next
End If
ElseIf backGiantN = box Then
If isTrainTroopsWindow() > 0 Then
For backGiant
//If isGiantTrainReady() > 0 Then
Tap 261, 444
Delay 30
//End If
Next
End If
ElseIf backArcherN = box Then
If isTrainTroopsWindow() > 0 Then
For backArcher
//If isArcherTrainReady() > 0 Then
Tap 130, 584
Delay 30
//End If
Next
End If
End If
box = box + 1
Wend
End If
// 训练兵种。
End If
// 选择指定的兵种进行训练(训练界面)
If isTrainTroopsWindow() > 0 Then
Tap 194, 44
Delay 500
End If
// 切换至军队概况面板
If isArmyWindow() > 0 Then
armyStateString = “军队概况:” // 提示信息恢复默认
armyBarbarianNumber = getArmyBarbarianNumber()
armyGiantNumber = getArmyGiantNumber()
armyArcherNumber = getArmyArcherNumber()
// 读取军队个数
sumHaveArmySpace = armyBarbarianNumber + armyGiantNumber * 5 + armyArcherNumber
armyCampSpace = readArmyCampSpace()
armyStateString = armyStateString & sumHaveArmySpace & " / " & armyCampSpace
ShowMessage armyStateString
Delay 1000
End If
// 读取军队种类数和个数并显示提示信息(已经验证)
If 闪黑选项 > 0 Then
If isArmyWindow() > 0 Then
Tap 740, 44
Delay 500
End If
If isBrewSpellsWindow() > 0 Then
Tap 130, 446
Delay 30
End If
Call exitTroopsWindow()
Delay 1000
End If
// 检测是否闪黑,如果闪黑,切换至法术配置面板并制造相应法术,最后退出
If isMainWindow() > 0 Then
gold = getGold()
elixir = getElixir()
dark = getDark()
trophy = getTrophy()
End If
// 记录资源数据(已经验证)
dGold = gold - originalGold
dElixir = elixir - originalElixir
dDark = dark - originalDark
dTrophy = trophy- originalTrophy
// 计算资源量与初始资源的差值(已经验证)
runS = Time() - OriginalS
runS = runS + 600
// 计算目前时间与初始事件的差值,默认+60s(已经验证)
multiple = CDbl(CDbl(86400) / CDBl(runS))
// 计算预测资源需要乘以初始资源的倍数(已经验证)
pGold = multiple * dGold
pElixir = multiple * dElixir
pDark = multiple * dDark
// 计算预计每日资源收益(已经验证)
For 2
ShowMessage “我是呆呆机器人,这是我统计的信息\n#机器人接管后的数据统计\n 奖杯增减:” & CStr(dTrophy) & " 个\n 金币收益:" & bigNTS(dGold) & " 个\n 圣水收益:" & bigNTS(dElixir) & " 滴\n 暗黑重油收益:" & bigNTS(dDark) & " 滴\n#预计每日收益\n 金币预计:" & bigNTS(CLng(pGold)) & " 个/天\n 圣水预计:" & bigNTS(CLng(pElixir)) & " 滴/天\n 暗黑重油预计:" & bigNTS(CLng(pDark)) & " 滴/天\n#注意:务必在使用机器人前将兵营清空\n#呆呆已经运行 " & timeToStr(Time(), OriginalS) & “了\n#想和呆呆聊天请加群哦(群号:20018 6446)”
Delay 1000
Next
ShowMessage “我是呆呆机器人,这是我统计的信息\n#机器人接管后的数据统计\n 奖杯增减:” & CStr(dTrophy) & " 个\n 金币收益:" & bigNTS(dGold) & " 个\n 圣水收益:" & bigNTS(dElixir) & " 滴\n 暗黑重油收益:" & bigNTS(dDark) & " 滴\n#预计每日收益\n 金币预计:" & bigNTS(CLng(pGold)) & " 个/天\n 圣水预计:" & bigNTS(CLng(pElixir)) & " 滴/天\n 暗黑重油预计:" & bigNTS(CLng(pDark)) & " 滴/天\n#注意:务必在使用机器人前将兵营清空\n#呆呆已经运行 " & timeToStr(Time(), OriginalS) & “了\n#想和呆呆聊天请加群哦(群号:20018 6446)”
Delay 3000
// 屏幕显示状态提示,5s(已经验证)
While 1
/If isTrainTroopsWindow() > 0 Then
Tap 194, 44
Delay 500
End If/
If isMainWindowButtonEnabled() > 0 Then
Tap 53, 526
Delay 500
End If
// 切换至军队概况面板
If isArmyWindow() > 0 Then
armyStateString = “军队概况:” // 提示信息恢复默认
armyBarbarianNumber = getArmyBarbarianNumber()
armyGiantNumber = getArmyGiantNumber()
armyArcherNumber = getArmyArcherNumber()
// 读取军队个数
sumHaveArmySpace = armyBarbarianNumber + armyGiantNumber * 5 + armyArcherNumber
armyCampSpace = readArmyCampSpace()
armyStateString = armyStateString & sumHaveArmySpace & " / " & armyCampSpace
ShowMessage armyStateString
Delay 2000
End If
// 读取军队种类数和个数并显示提示信息(已经验证)
If sumHaveArmySpace >= armyCampSpace Then
Call exitTroopsWindow()
Delay 1000
Goto 出战
End If
Call exitTroopsWindow()
Delay 2000
If isMainWindow() > 0 Then
gold = getGold()
elixir = getElixir()
dark = getDark()
trophy = getTrophy()
End If
// 记录资源数据(已经验证)
dGold = gold - originalGold
dElixir = elixir - originalElixir
dDark = dark - originalDark
dTrophy = trophy- originalTrophy
// 计算资源量与初始资源的差值(已经验证)
runS = Time() - OriginalS
runS = runS + 600
// 计算目前时间与初始事件的差值,默认+600s(已经验证)
multiple = CDbl(CDbl(86400) / CDBl(runS))
// 计算预测资源需要乘以初始资源的倍数(已经验证)
pGold = multiple * dGold
pElixir = multiple * dElixir
pDark = multiple * dDark
// 计算预计每日资源收益(已经验证)
For 3
ShowMessage “我是呆呆机器人,这是我统计的信息\n#机器人接管后的数据统计\n 奖杯增减:” & CStr(dTrophy) & " 个\n 金币收益:" & bigNTS(dGold) & " 个\n 圣水收益:" & bigNTS(dElixir) & " 滴\n 暗黑重油收益:" & bigNTS(dDark) & " 滴\n#预计每日收益\n 金币预计:" & bigNTS(CLng(pGold)) & " 个/天\n 圣水预计:" & bigNTS(CLng(pElixir)) & " 滴/天\n 暗黑重油预计:" & bigNTS(CLng(pDark)) & " 滴/天\n#注意:务必在使用机器人前将兵营清空\n#呆呆已经运行 " & timeToStr(Time(), OriginalS) & “了\n#想和呆呆聊天请加群哦(群号:20018 6446)”
Delay 1000
Next
ShowMessage “我是呆呆机器人,这是我统计的信息\n#机器人接管后的数据统计\n 奖杯增减:” & CStr(dTrophy) & " 个\n 金币收益:" & bigNTS(dGold) & " 个\n 圣水收益:" & bigNTS(dElixir) & " 滴\n 暗黑重油收益:" & bigNTS(dDark) & " 滴\n#预计每日收益\n 金币预计:" & bigNTS(CLng(pGold)) & " 个/天\n 圣水预计:" & bigNTS(CLng(pElixir)) & " 滴/天\n 暗黑重油预计:" & bigNTS(CLng(pDark)) & " 滴/天\n#注意:务必在使用机器人前将兵营清空\n#呆呆已经运行 " & timeToStr(Time(), OriginalS) & “了\n#想和呆呆聊天请加群哦(群号:20018 6446)”
Delay 3000
// 屏幕显示状态提示,5s(已经验证)
ShowMessage “等待造兵中…”
Delay 14000
Wend
/*
打开军队概况面板1->读取数据1->
Rem troopsFlag1
/*
If trainFlag = 0 Then
If isArmyWindow() Then
Tap 463, 44
Delay 500
End If
// 打开训练面板
// 切换至训练界面(军队界面)
If isTrainTroopsWindow() Then
Call clearMoreTroops()
End If
// 清除多余的在训练的军队
// 清除在造兵种(训练界面)
If isTrainTroopsWindow() Then
Tap 194, 44
Delay 500
End If
// 切换至军队概况面板
// 切换至军队界面(训练界面)
End If
// 清除兵种等
armyStateString = “军队概况:”
If isArmyWindow() Then
armyBarbarianNumber = getArmyBarbarianNumber()
armyGiantNumber = getArmyGiantNumber()
armyArcherNumber = getArmyArcherNumber()
sumHaveArmySpace = armyBarbarianNumber + armyGiantNumber * 5 + armyArcherNumber
armyCampSpace = readArmyCampSpace()
armyStateString = armyStateString & sumHaveArmySpace & " / " & armyCampSpace
ShowMessage armyStateString
Delay 1000
End If
// 读取兵种与数量(军队界面)
If trainFlag = 0 Then
If isArmyWindow() Then
Tap 463, 44
Delay 500
End If
// 切换至训练界面(军队界面)
If isTrainTroopsWindow() Then
If sumHaveArmySpace < armyCampSpace Then
// 以下为练目标兵
trainFlag = 1
dGoalBarbarian = goalBarbarian - armyBarbarianNumber
dGoalGiant = goalGiant - armyGiantNumber
dGoalArcher = goalArcher - armyArcherNumber
box = 1
While box < (goalKinds+1)
If goalBarbarianN = box Then
If isTrainTroopsWindow() Then
For goalBarbarian
If isBarbarianTrainReady() Then
Tap 130, 444
Delay 30
End If
Next
End If
ElseIf goalGiantN = box Then
If isTrainTroopsWindow() Then
For goalGiant
If isGiantTrainReady() Then
Tap 261, 444
Delay 30
End If
Next
End If
ElseIf goalArcherN = box Then
If isTrainTroopsWindow() Then
For goalArcher
If isArcherTrainReady() Then
Tap 130, 584
Delay 30
End If
Next
End If
End If
box = box + 1
Wend
// 以下为继续练备用兵
trainFlag = 1
box = 1
While box < (backKinds+1)
If backBarbarianN = box Then
If isTrainTroopsWindow() Then
For BackBarbarian
If isBarbarianTrainReady() Then
Tap 130, 444
Delay 30
End If
Next
End If
ElseIf backGiantN = box Then
If isTrainTroopsWindow() Then
For backGiant
If isGiantTrainReady() Then
Tap 261, 444
Delay 30
End If
Next
End If
ElseIf backArcherN = box Then
If isTrainTroopsWindow() Then
For backArcher
If isArcherTrainReady() Then
Tap 130, 584
Delay 30
End If
Next
End If
End If
box = box + 1
Wend
Else
// 以下为练备用兵
trainFlag = 1
box = 1
While box < (backKinds+1)
If backBarbarianN = box Then
If isTrainTroopsWindow() Then
For BackBarbarian
If isBarbarianTrainReady() Then
Tap 130, 444
Delay 30
End If
Next
End If
ElseIf backGiantN = box Then
If isTrainTroopsWindow() Then
For backGiant
If isGiantTrainReady() Then
Tap 261, 444
Delay 30
End If
Next
End If
ElseIf backArcherN = box Then
If isTrainTroopsWindow() Then
For backArcher
If isArcherTrainReady() Then
Tap 130, 584
Delay 30
End If
Next
End If
End If
box = box + 1
Wend
End If
// 训练兵种。
End If
// 选择指定的兵种进行训练(训练界面)
End If
If isArmyWindow() Or isTrainTroopsWindow() Or isBrewSpellsWindow() Then
Tap 1200, 37
Delay 1000
End If
// 切换至法术界面(训练界面)
// 读取法术种类与数量(法术界面)
// 配置指定的法术(法术界面)
// 切换至军队概况(法术界面)
// 读取兵种与数量(军队界面)
If sumHaveArmySpace < armyCampSpace Then
Goto halfProgram
End If
// 若满足继续,若不满足,则显示状态(短5s,长30s)
// 切换至进攻页面(兵营充足条件,主界面)
*/
Rem 出战
ShowMessage “准备出战了哦!”
Delay 2000
If 只打死鱼 > 0 Then
出战前状态信息 = “#只打死鱼:是(不一定能准确判断,该功能完善中)\n”
End If
If 敌人资源总量最低限制 > 0 Then
出战前状态信息 = 出战前状态信息 & “敌人资源最低限制:” & bigNTS(敌人资源总量最低限制) & “\n”
End If
If 闪黑选项 > 0 Then
出战前状态信息 = 出战前状态信息 & “是否闪黑:是(该功能完善中)”
End If
For 3
ShowMessage 出战前状态信息
Next
Delay 3000
Call startAttack()
Delay 3000
While 1
If isFightReadyWindow() > 0 Then
Delay 2000
Call zoomFightScreenUp()
UseDict(3)
敌人gold = CInt(Ocr(63, 89, 175, 114, “CCFBFF-111111|91C2BF-111111”, 0.9))
TracePrint “金币:” & bigNTS(敌人gold)
UseDict(4)
敌人elixir = CInt(Ocr(63, 125, 175, 150, “FDE8FF-111111|C2C4CF-111111”, 0.9))
TracePrint “圣水:” & 敌人elixir
敌人资源总量 = 敌人gold + 敌人elixir
If 敌人资源总量 > 敌人资源总量最低限制 And isDeadFishII() = 1 Then
ShowMessage “金币 + 圣水:” & BigNTS(敌人资源总量)
Delay 3000
Goto 下兵
Else
Call searchNext()
End If
End If
Delay 1000
Wend
/*
Rem 出战
startAttack() 函数
“点击进攻按钮(主界面)->延时1000 1
点击搜索对手按钮(进攻页面) ->延时1000” 1
While 1
If 确认是战斗面板 Then
延时2000ms
If 位置确定() < 1 Then
Call zoomFightScreenUp()
End If
读取各个数据
If 死鱼 Then
ShowMessage “金币:” & 金币 & " 圣水:" & 圣水
Delay 2000
For 10
ShowMessage “正常下兵啦”
Delay 2000
Next
Else
点击搜寻按钮
End If
End If
延时2000ms
Wend
*/
Rem 下兵
For 2
Call zoomFightScreenUp()
Delay 200
Call A方案上端下兵(508, 140, 463, 165, 345, 248, 733, 130, 825, 195, 894, 246)
Call zoomFightScreenDown()
Delay 200
Call A方案下端下兵(512, 500, 419, 428, 303, 345, 758, 457, 886, 354, 1014, 275)
Next
Dim 剩余战斗时间 = 30, 临时金币, 临时圣水, 临时暗黑圣水 // 此处未完善黑水资源计算选项
临时金币 = 敌人gold
临时圣水 = 敌人elixir
Delay 1000
While 剩余战斗时间 > -1
剩余战斗时间 = 剩余战斗时间 - 1
Delay 500
UseDict(3)
临时金币 = CInt(Ocr(63, 89, 175, 114, “CCFBFF-111111|91C2BF-111111”, 0.9))
Delay 500
UseDict(4)
临时圣水 = CInt(Ocr(63, 125, 175, 150, “FDE8FF-111111|C2C4CF-111111”, 0.9))
If 敌人gold > 临时金币 Then
敌人gold = 临时金币
剩余战斗时间 = 30
End If
If 敌人elixir > 临时圣水 Then
敌人elixir = 临时圣水
剩余战斗时间 = 30
End If
If CmpColorEx(“719|659|1FBD6E-111111,718|629|72F4D5-111111”,0.9) = 1 Then
TracePrint 1
Tap 641, 641
Goto 结束
Else
TracePrint 0
End If
Wend
If 闪黑选项 > 0 Then
Call zoomFightScreenUp()
ShowMessage “闪黑功能暂未完善”
Delay 2000
End If
Tap 93, 538
Delay 1000
// If CmpColorEx(“713|488|1FBB6C-010101,720|446|75F4D6-010101”, 0.9) = 1 Then
Tap 781, 465
Delay 1000
Tap 641,641
// TracePrint 1
// Else
// TracePrint 0
// End If
/*
If isMainWindowButtonEnabled() Then // 点击进攻按钮
Tap 82, 640
Delay 500
End If
If isBeforeAttackWindow() Then // 点击搜索对手按钮
Tap 286, 547
Delay 500
End If
// 进攻(进攻页面)
Dim ocrchar1 = 0, ocrchar2= 0, deadFish, resource
While 1
If CmpColorEx(“1094|542|0D51E5-111111,1135|492|35BDFD-111111,45|552|0E0DCF-111111,45|530|615DF8-111111”, 0.9) = 1 Then
Delay 1000
deadfish = "NOT "
TracePrint “界面判断成功”
Call zoomScreen()
UseDict(3)
ocrchar1 = Ocr(63, 89, 175, 114, “CCFBFF-111111|91C2BF-111111”, 0.9)
TracePrint “1:” & ocrchar1
UseDict(4)
ocrchar2 = Ocr(63, 125, 175, 150, “FDE8FF-111111|C2C4CF-111111”, 0.9)
TracePrint “2:” & ocrchar2
resource = CInt(ocrchar1) + CInt(ocrchar2)
TracePrint resource
If isDeadFish(resource)>0 Then
TracePrint “DEAD!”
deadFish = "DEAD! "
ShowMessage deadfish & "金币 " & ocrchar1 & " 圣水 " & ocrchar2
Delay 3000
Goto attack
End If
Delay 2000
Tap 1179, 518
Else
TracePrint “界面判断不成功”
Delay 1000
End If
Wend
Rem attack
*/
// 读取敌方数据(战斗页面)
// 继续(若之和大于300000)否则跳转
// 检测对方圣水罐和金币罐(战斗页面)
// 切换至战斗状态(若为空)否则跳转
// 点击下一个按钮(战斗页面),跳转回上一个
// 战斗循环
/*
读取野蛮人位置,弓箭手位置,巨人位置,野蛮人首领位置,弓箭女皇位置
切换至上端释放巨人12、野蛮人24、弓箭手36(间隔2秒)
切换至下端释放巨人12、野蛮人24、弓箭手36
切换至上端,寻找圣水罐/金矿,若有,4野蛮人,6弓箭手
切换至下端,寻找圣水罐/金矿,若有,4野蛮人,6弓箭手
若无,随机释放。
切换至上端左侧释放蛮王和弓箭女皇。
检测弓箭女王、蛮王快死时点击技能。
检测资源变化情况不断更新,30s内无变化,回家。
*/
// 点击结束按钮->点击确定按钮->点击回家按钮。
//
Rem 结束
Delay 6000
Wend
// ##################
// ##################
// ##################
// #### 函数部分 ####
// ##################
// ##################
// ##################
// #### 0 系统类函数部分 ####
Function isScreenReady()
Dim screenX
screenX = GetScreenX()
Dim screenY
screenY = GetScreenY()
Dim DPI
DPI=Device.GetDPI()
If screenX = 1280 And screenY = 720 And DPI = 160 Then
isScreenReady = 1
Else
Dim djs
djs = 20
While djs > 0
ShowMessage “脚本仅支持 1280×720 分辨率(横向)和 160 DPI,请设置好后再运行脚本\n” & djs & " 秒后脚本将自动停止运行"
djs = djs - 1
Delay 999
Wend
End If
End Function
// 分辨率检测(成功 耗时0,不成功 延时20000后终止脚本)
Function isLoginReady()
Rem logindeny
While 1
If CmpColorEx(“1232|110|FF25E0,1233|37|19DEFF”, 0.9) = 1 Then
Goto loginsuccess
End If
ShowMessage “请手动登录游戏。若已登录,请切换至游戏主界面”
Delay 1000
Wend
Rem loginsuccess
For 2
ShowMessage “登录成功!欢迎使用!”
Delay 1000
Next
If CmpColorEx(“1232|110|FF25E0,1233|37|19DEFF”, 0.9) <> 1 Then
Goto loginsuccess
End If
ShowMessage “登录成功!欢迎使用!”
Delay 1000
End Function
// 登录检测(成功 耗时0,不成功 循环)
Function isConnect()
If CmpColorEx(“250|336|282828,250|335|E5B533”, 0.9) = 1 Then
Tap 850, 426
For 5
ShowMessage “断线重连中…”
Delay 10000
Next
End If
If CmpColorEx(“759|307|282828-111111,772|376|282828-111111,770|424|282828-111111,354|421|282828-111111,416|302|282828-111111”,0.9) = 1 Then
Tap 850, 426
For 5
ShowMessage “断线重连中…”
Delay 10000
Next
End If
End Function
// 断线重连(成功 耗时5s)
Function zoomScreen()
TouchDown 98, 173, 1
TouchDown 1095, 664, 2
TouchMove 670, 360, 1, 200
TouchMove 674, 364, 2, 200
TouchUp 1
TouchUp 2
Delay 500
Swipe 1000, 200, 1000, 620
Delay 500
Swipe 1000, 360, 600, 360
Delay 500
Swipe 1000, 360, 600, 360
Delay 500
Swipe 1000, 400, 1000, 320
Delay 500
End Function
// 缩小屏幕(成功 2700ms)
Function bigNTS(numberb)
Dim numbera
numbera = Clng(numberb)
Dim temp1,temp2,temp3,outinga
If numbera > 999999 Or numbera < -999999 Then
temp3 = Int(numbera / 1000000)
temp3 = CStr(temp3)
temp2 = numbera Mod 1000000
temp2 = Abs(Int(temp2 / 1000))
If temp2 = 0 Then
temp2 = “000”
ElseIf temp2 < 10 Then
temp2 = “00” & CStr(temp2)
ElseIf temp2 < 100 Then
temp2 = “0” & CStr(temp2)
Else
temp2 = CStr(temp2)
End If
temp1 = Abs(numbera Mod 1000)
If temp1 = 0 Then
temp1 = “000”
ElseIf temp1 < 10 Then
temp1 = “00” & CStr(temp1)
ElseIf temp1 < 100 Then
temp1 = “0” & CStr(temp1)
Else
temp1 = CStr(temp1)
End If
outinga = temp3 & “,” & temp2 & “,” & temp1
ElseIf CLng(numbera) > 999 Or numbera < -999 Then
temp2 = Int(numbera / 1000)
temp2 = CStr(temp2)
temp1 = Abs(numbera Mod 1000)
If temp1 = 0 Then
temp1 = “000”
ElseIf temp1 < 10 Then
temp1 = “00” & CStr(temp1)
ElseIf temp1 < 100 Then
temp1 = “0” & CStr(temp1)
Else
temp1 = CStr(temp1)
End If
outinga = temp2 & “,” & temp1
Else
outinga = Cstr(numberb)
End If
bigNTS = outinga
End Function
// 大数字转格式化字符串
Function timeToStr(secondTillNow, secondAtFirst)
Dim timeleft = 0, runM = 0, runH = 0, runD = 0, timeString
timeleft = secondTillNow - secondAtFirst
While timeleft > 59
runM = runM + 1
timeleft = timeleft - 60
If runM > 59 Then
runH = runH + 1
runM = runM - 60
End If
If runH > 24 Then
runD = runD + 1
runH = runH - 24
End If
Wend
If runD > 0 Then
timeString = CStr(runD) & " 天 "
If runH > 0 Then
timeString = timeString & CStr(runH) & " 小时 "
If runM > 0 Then
timeString = timeString & CStr(runM) & " 分钟 "
If timeleft > 0 Then
timeString = timeString & CStr(timeleft) & " 秒"
End If
End If
End If
ElseIf runH > 0 Then
timeString = CStr(runH) & " 小时 "
If runM > 0 Then
timeString = timeString & CStr(runM) & " 分钟 "
If timeleft > 0 Then
timeString = timeString & CStr(timeleft) & " 秒"
End If
End If
ElseIf runM > 0 Then
timeString = CStr(runM) & " 分钟 "
If timeleft > 0 Then
timeString = timeString & CStr(timeleft) & " 秒"
End If
Else
timeString = CStr(timeleft) & " 秒"
End If
timeToStr= timeString
End Function
// 时间格式输出函数
// #### 1 资源采集函数部分 ####
Function getGold()
UseDict(0)
Dim ocrchar = “-1”
ocrchar=Ocr(1061,29,1205,53,“FFFFFF-111111|C4CCC8-060606|EFF1F0-111111”,0.9)
Traceprint ocrchar
getGold = Clng(ocrchar)
End Function
Function getElixir()
UseDict(0)
Dim ocrchar = “-1”
ocrchar = Ocr(1080, 97, 1206, 120, “FFFFFF-111111|C4CCC8-060606|EFF1F0-111111”, 0.9)
getElixir = Clng(ocrchar)
End Function
Function getDark()
UseDict(0)
Dim ocrchar = “-1”
ocrchar = Ocr(1111, 163, 1206, 186, “FFFFFF-111111|C4CCC8-060606|EFF1F0-111111”, 0.9)
getDark = Clng(ocrchar)
End Function
Function getTrophy()
UseDict(0)
Dim ocrchar = “-1”
ocrchar = Ocr(90, 110, 154, 134, “FFFFFF-111111|C4CCC8-060606|EFF1F0-111111”, 0.9)
getTrophy = Clng(ocrchar)
End Function
// 读取资源
Function collectResource()
Dim intX,intY
For 3
FindMultiColor 232,80,1000,708,“B7DBD1-111111”,"-13|9|A7D5D0-111111,13|16|95CAC0-111111,-13|21|85C0B8-111111,1|29|73B8B0-111111,12|21|85C0B8-111111",0,0.95,intX,intY
If intX > -1 And intY > -1 Then
Tap intX, intY+5
End If
Delay 500
Next
End Function
// 采集资源
Function randomX()
Dim temp1, temp2
temp1 = Time()
temp1 = temp1 Mod 10
randomX = temp1
End Function
// 随机数
// #### 2 界面判断函数部分 ####
Function isMainWindow()
Delay 500
If CmpColorEx(“31|21|ECBD39-111111,16|276|1DA9FE-111111”,0.9) Then
isMainWindow = 1
Else
isMainWindow = 0
End If
End Function
// 界面判断:主界面
Function isMainWindowButtonEnabled()
Delay 500
If CmpColorEx(“18|279|24A9FD-111111,30|21|ECBD38-111111,43|518|E4FFFF-111111”,0.9) Then
isMainWindowButtonEnabled = 1
Else
isMainWindowButtonEnabled = 0
End If
End Function
// 界面判断:主界面左侧按钮可用
Function isArmyWindow()
Delay 500
If CmpColorEx(“84|32|F8F8F8-111111,82|57|E5ECE8-111111,1199|18|958DFF-111111,1186|529|75F1CD-111111,1182|617|79F1D1-111111,560|29|63747A-111111,845|26|65777C-111111”,0.9) Then
isArmyWindow = 1
Else
isArmyWindow = 0
End If
End Function
// 界面判断:军队概况界面
Function isTrainTroopsWindow()
Delay 500
If CmpColorEx(“288|29|63747A-111111,567|28|F9FAFA-111111,562|55|E6EDED-111111,836|31|627378-111111,798|678|9BA0A0-111111,1199|18|958DFF-111111”,0.9) Then
isTrainTroopsWindow = 1
Else
isTrainTroopsWindow = 0
End If
End Function
// 界面判断:训练军队界面
Function isBrewSpellsWindow()
Delay 500
If CmpColorEx(“289|29|63747A-111111,562|29|63747A-111111,844|29|F9FAFA-111111,842|54|E7EDED-111111,70|95|005AE9-111111,1199|18|958DFF-111111”,0.9) Then
isBrewSpellsWindow = 1
Else
isBrewSpellsWindow = 0
End If
End Function
// 界面判断:配置药水界面
Function isFightReadyWindow()
Delay 500
If CmpColorEx(“1249|37|1DDDFF-111111,1094|539|0D54E5-111111,1138|493|35B9F9-111111,47|529|615DF9-111111”,0.9) = 1 Then
isFightReadyWindow = 1
Else
isFightReadyWindow = 0
End If
End Function
// 界面判断:战斗面板(含下一个按钮)
// #### 3 训练兵种部分 ####
Function clearMoreTroops()
While CmpColorEx(“1198|142|0D0FE4-111111,1197|129|918DFF-111111”, 0.9) = 1
For 30
Tap 1199, 135
Delay 20
Next
Delay 500
Wend
While CmpColorEx(“1200|140|0F0EE5-111111”, 0.9) = 1
For 30
Tap 1199, 135
Delay 20
Next
Delay 500
Wend
End Function
// 清除正在训练的多余的军队
Function getArmyBarbarianNumber()
Dim intX,intY,intX2,intY2 // 获取XY坐标
FindPic 60,150,1135,180,“Attachment:野蛮人概况.png”,“111111”,0,0.8,intX,intY
If intX > -1 And intY > -1 Then
TracePrint intX
TracePrint intY
intX = intX + 13
intY = intY - 26
intX2 = intX + 62
intY2 = intY + 22
UseDict(1)
Dim ocrchar = “-1”
ocrchar=Ocr(intX,intY,intX2,intY2,“FFFFFF-111111|F2E7DC-010101|F9F4EE-010101”,0.9)
Traceprint ocrchar
getArmyBarbarianNumber = CInt(ocrchar)
End If
End Function
Function getArmyGiantNumber()
Dim intX,intY,intX2,intY2 // 获取XY坐标
FindPic 60,150,1135,180,“Attachment:巨人概况.png”,“111111”,0,0.8,intX,intY
If intX > -1 And intY > -1 Then
TracePrint intX
TracePrint intY
intX = intX + 13
intY = intY - 26
intX2 = intX + 62
intY2 = intY + 22
UseDict(1)
Dim ocrchar = “-1”
ocrchar=Ocr(intX,intY,intX2,intY2,“FFFFFF-111111|F2E7DC-010101|F9F4EE-010101”,0.9)
Traceprint ocrchar
getArmyGiantNumber = CInt(ocrchar)
End If
End Function
Function getArmyArcherNumber()
Dim intX,intY,intX2,intY2 // 获取XY坐标
FindPic 60,150,1135,180,“Attachment:弓箭手概况.png”,“111111”,0,0.8,intX,intY
If intX > -1 And intY > -1 Then
TracePrint intX
TracePrint intY
intX = intX + 13
intY = intY - 26
intX2 = intX + 62
intY2 = intY + 22
UseDict(1)
Dim ocrchar = “-1”
ocrchar=Ocr(intX,intY,intX2,intY2,“FFFFFF-111111|F2E7DC-010101|F9F4EE-010101”,0.9)
Traceprint ocrchar
getArmyArcherNumber = CInt(ocrchar)
End If
End Function
// 读取军队概况界面各兵种的数量字符的左上角 x y 坐标,右下角坐标计算可得 x+62 y+22
// 识图两边各留3像素
Function readArmyCampSpace()
Dim ocrchar, sumlong, firstpun, readlong
UseDict (2)
ocrchar = Ocr(131,87,242,120, “FFFFFF|FEFCFA-010101|FEFDFC-010101|DCDEDE-010101”, 0.9)
sumlong = Len(ocrchar)
firstpun = InStr(1, ocrchar, “/”, False)
readlong = sumlong - firstpun
ocrchar = Right(ocrchar, readlong)
readArmyCampSpace = CInt(ocrchar)
End Function
// 读取最大兵营量
Function isBarbarianTrainReady()
If CmpColorEx(“141|393|3DC6FD-111111,83|400|DDB585-111111”,0.9) = 1 Then
isBarbarianTrainReady = 1
Else
isBarbarianTrainReady = 0
End If
End Function
Function isGiantTrainReady()
If CmpColorEx(“209|388|DEBD8D-111111,290|432|80B5FD-111111”,0.9) = 1 Then
isGiantTrainReady = 1
Else
isGiantTrainReady = 0
End If
End Function
Function isArcherTrainReady()
If CmpColorEx(“83|534|DDB585-111111,136|550|7037C5-111111”,0.9) = 1 Then
isArcherTrainReady = 1
Else
isArcherTrainReady = 0
End If
End Function
Function isLightningSpellReady()
If CmpColorEx(“118|423|FDA435,153|432|FFFFF5-111111,121|465|F54415-111111”,0.9) = 1 Then
isLightningSpellReady = 1
Else
isLightningSpellReady = 0
End If
End Function
// 检测训练界面的兵种\法术图标是否激活
Function isBeforeAttackWindow()
If CmpColorEx(“195|509|43BEFF-010101,200|562|0E5FE9-111111,103|441|A7B6C6-111111,514|256|39B6C6-111111,511|240|396DC6-111111,47|299|946DA5-111111,59|283|42ABC6-111111”,0.9) = 1 Then
isBeforeAttackWindow = 1
Else
isBeforeAttackWindow = 0
End If
End Function
// 界面检测,搜寻前的界面
/*
Function isDeadFish(resource1)
Dim deadfish = 0
If resource1 > 300000 Then
TracePrint “resource>300000”
Dim intX = -1, intY = -1
Delay 200
FindPic 172,52,1197,573,“Attachment:圣水采集器.png”,“010101”,0,0.9,intX,intY
If intX > -1 And intY > -1 Then
deadfish = deadfish + 9
TracePrint intX
TracePrint intY
TracePrint “满的圣水采集器找到”
End If
intX = -1, intY = -1
FindPic 172,52,1197,573,“Attachment:空圣水瓶.png”,“010101”,0,0.9,intX,intY
If intX > -1 And intY > -1 Then
deadfish = deadfish + 1
TracePrint intX
TracePrint intY
TracePrint “空圣水瓶找到”
End If
intX = -1, intY = -1
FindPic 172,52,1197,573,“Attachment:空的圣水瓶.png”,“010101”,0,0.9,intX,intY
If intX > -1 And intY > -1 Then
deadfish = deadfish + 1
TracePrint intX
TracePrint intY
TracePrint “空的圣水瓶找到”
End If
Else
TracePrint “<300000”
Goto aaa
End If
If deadfish > 0 Then
TracePrint “deadfish>0”
isDeadFish = 1
Else
Goto aaa
End If
Rem aaa
isDeadFish = 0
End Function
// 检测死鱼
Function trueAttack()
Swipe 900, 100, 900, 300
Delay 1000
Tap 252, 657
Delay 50
For 2
Tap 322, 292
Delay 50
Tap 662, 101
Delay 50
Tap 890, 276
Delay 50
Next
Tap 60, 657 // bbr
For 2
Tap 322, 292
Delay 50
Tap 662, 101
Delay 50
Tap 890, 276
Delay 50
Next
//322 292 662 101 890276
End Function*/
Function exitTroopsWindow()
Tap 1200, 36
End Function
// 退出军队界面
/*
法术识别,备用
Dim intX,intY
FindPic 60,347,842,377,“Attachment:闪电概况.png”,“000000”,0,0.9,intX,intY
If intX > -1 And intY > -1 Then
TracePrint intX
TracePrint intY
End If
*/
// #### 4 战斗函数 ####
Function startAttack()
Tap 82, 640
Delay 1000
// If CmpColorEx(“460|115|667D84-111111,204|562|0E5FE9-111111,198|510|42BDFF-111111”,0.9) = 1 Then
Tap 290, 549
// Else
// TracePrint 0
// End If
End Function
// 开始战斗(点击二次按钮)
Function zoomFightScreenUp()
TouchDown 1000, 60, 1
TouchDown 870, 190, 2
TouchMove 935, 125, 1, 120
TouchMove 935, 125, 2, 120
TouchUp 1
TouchUp 2
Delay 500
Swipe 1000, 60, 400, 400
Delay 500
Swipe 1000, 60, 400, 400
Delay 1300
End Function
// 战斗界面向右上角移动(含缩放)
Function zoomFightScreenDown()
Swipe 1000, 550, 730, 10
Delay 500
Swipe 1000, 550, 730, 10
Delay 1300
End Function
// 战斗界面向右下角移动
Function searchNext()
Tap 1168, 519
End Function
// 寻找下一个对手
/*
从远到近顺序,从上到下顺序
/
Function A方案上端下兵(intX1, intY1, intX2, intY2, intX3, intY3, intX4, intY4, intX5, intY5, intX6, intY6)
Delay 500
/
1 巨人,5野蛮人,7弓箭手
*/
Call 选中巨人()
Call 向左下方向释放(intX1, intY1, 1, 30)
Call 向左下方向释放(intX2, intY2, 1, 30)
Call 向左下方向释放(intX3, intY3, 1, 30)
Call 向右下方向释放(intX4, intY4, 1, 30)
Call 向右下方向释放(intX5, intY5, 1, 30)
Call 向右下方向释放(intX6, intY6, 1, 30)
Delay 2000
Call 选中野蛮人()
Call 向左下方向释放(intX1, intY1, 5, 30)
Call 向左下方向释放(intX2, intY2, 5, 30)
Call 向左下方向释放(intX3, intY3, 5, 30)
Call 向右下方向释放(intX4, intY4, 5, 30)
Call 向右下方向释放(intX5, intY5, 5, 30)
Call 向右下方向释放(intX6, intY6, 5, 30)
Delay 2000
Call 选中弓箭手()
Call 向左下方向释放(intX1, intY1, 7, 30)
Call 向左下方向释放(intX2, intY2, 7, 30)
Call 向左下方向释放(intX3, intY3, 7, 30)
Call 向右下方向释放(intX4, intY4, 7, 30)
Call 向右下方向释放(intX5, intY5, 7, 30)
Call 向右下方向释放(intX6, intY6, 7, 30)
End Function
Function A方案下端下兵(intX1, intY1, intX2, intY2, intX3, intY3, intX4, intY4, intX5, intY5, intX6, intY6)
Delay 2000
/*
1 巨人,5野蛮人,7弓箭手
*/
Call 选中巨人()
Call 向左上方向释放(intX1, intY1, 1, 30)
Call 向左上方向释放(intX2, intY2, 1, 30)
Call 向左上方向释放(intX3, intY3, 1, 30)
Call 向右上方向释放(intX4, intY4, 1, 30)
Call 向右上方向释放(intX5, intY5, 1, 30)
Call 向右上方向释放(intX6, intY6, 1, 30)
Delay 2000
Call 选中野蛮人()
Call 向左上方向释放(intX1, intY1, 5, 30)
Call 向左上方向释放(intX2, intY2, 5, 30)
Call 向左上方向释放(intX3, intY3, 5, 30)
Call 向右上方向释放(intX4, intY4, 5, 30)
Call 向右上方向释放(intX5, intY5, 5, 30)
Call 向右上方向释放(intX6, intY6, 5, 30)
Delay 2000
Call 选中弓箭手()
Call 向左上方向释放(intX1, intY1, 7, 30)
Call 向左上方向释放(intX2, intY2, 7, 30)
Call 向左上方向释放(intX3, intY3, 7, 30)
Call 向右上方向释放(intX4, intY4, 7, 30)
Call 向右上方向释放(intX5, intY5, 7, 30)
Call 向右上方向释放(intX6, intY6, 7, 30)
End Function
Sub 选中野蛮人()
If CmpColorEx(“140|697|587EC8-222222,143|630|30AEEC-222222”,0.9) = 1 Then
Tap 146, 658 // 选中野蛮人
选中野蛮人 = 1
Else
选中野蛮人 = 0
End If
End Sub
Sub 选中弓箭手()
If CmpColorEx(“233|699|20AF8F-111111,246|642|6229B8-111111”,0.9) = 1 Then
Tap 242, 658 // 选中弓箭手
选中弓箭手 = 1
Else
选中弓箭手 = 0
End If
End Sub
Sub 选中巨人()
If CmpColorEx(“331|625|85BEF8-060606,358|657|74ACF5-060606”,0.9) = 1 Then
Tap 336, 658 // 选中巨人
选中巨人 = 1
Else
选中巨人 = 0
End If
End Sub
Sub 向左下方向释放(intX, intY, tTime, dTime)
For tTime
Tap intX, intY
intX = intX - 16
intY = intY + 12
Delay dTime
Next
End Sub
Sub 向右下方向释放(intX, intY, tTime, dTime)
For tTime
Tap intX, intY
intX = intX + 16
intY = intY + 12
Delay dTime
Next
End Sub
Sub 向左上方向释放(intX, intY, tTime, dTime)
For tTime
Tap intX, intY
intX = intX - 16
intY = intY - 12
Delay dTime
Next
End Sub
Sub 向右上方向释放(intX, intY, tTime, dTime)
For tTime
Tap intX, intY
intX = intX + 16
intY = intY - 12
Delay dTime
Next
End Sub
Function isDeadFishII()
Delay 1000
Dim intX = 0
Dim intY = 0
FindMultiColor 0,0,1020,720,“BFAF8D-111111”,“8|-28|474344-111111,8|-18|24EDFF-111111,8|-22|24D6FF-111111”,0,0.9,intX,intY
If intX > -1 And intY > -1 Then
TracePrint “Dead”
isDeadFishII = 1
Else
TracePrint “活鱼”
isDeadFishII = 0
End If
Delay 1000
End Function