diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index 08ba2e8..cd8bf2c 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -30,11 +30,18 @@ body: validations: required: true + - type: input + attributes: + label: 录屏链接 + description: 请输入该问题出现前后全过程的录屏链接。如果问题无法复现,在前面描述清楚忽略此项即可 + placeholder: https://lanzou.com + validations: + required: true + - type: input attributes: label: 使用的版本? - description: 所使用的脚本的版本 - placeholder: v1.3.1 + description: 所使用的脚本的版本,如v1.4.0 value: v1. validations: required: true @@ -67,11 +74,3 @@ body: attributes: label: 其他说明 description: 如果有任何补充说明,请在此补充 - - - type: input - attributes: - label: 录屏链接 - description: 请输入该问题出现前后全过程的录屏链接 - placeholder: https://lanzou.com - validations: - required: true diff --git a/README.md b/README.md index 21e40d2..4453fef 100644 --- a/README.md +++ b/README.md @@ -6,16 +6,19 @@ - 基于 [**AutoHotKey v2**](https://www.autohotkey.com) 实现的 **零号业绩** 和 **零号空洞银行存款** 快速刷取 > 3\~4分钟一把,20业绩+存款到手,3小时不到就能刷满一周900业绩上限 >
关闭存银行后约2.5分钟一把,2小时就能刷满 -- 简单轻量易用,~~对于不同 **分辨率、帧率、HDR、游戏内字体粗细等** 具有良好的适应性~~(等1.1版本大更后再适配新的走格子) +- 简单轻量易用,对于不同 **分辨率、帧率、缩放、HDR、游戏内字体粗细等** 具有良好的适应性 ## 使用前提 -**以下四个要求缺一不可!** +**以下要求缺一不可** - 1. **全屏** 运行游戏 -- 2. 默认战斗角色 **至少3位** +- 2. 默认 **3位** 战斗角色 - 3. **以管理员身份运行** 脚本 - 4. 已激活作战攻略的 **开局炸弹补给** +- 5. 设置要求(系统默认即可): + - 快捷手册快捷键:F2(用于进入零号空洞) + - 棋盘邦布插件快捷使用:长按(用于使用炸弹) ## 下载、打开方法 @@ -40,17 +43,17 @@ ## 注意事项 -1. 本脚本基于固定坐标和像素点颜色查找实现,设计分辨率1920\*1080,按照等比缩放处理其他分辨率,因此如果在不修改设置的情况下脚本无法正常运行,建议 **显示器和游戏** 的画面分辨率设置为 **长宽比16:9** 且 **关闭HDR** 后重新运行脚本 - > 已测试可用分辨率:1920\*1080、2560\*1440、2880\*1800(对应游戏分辨率2304\*1440)、3840\*2160 +1. 本脚本基于固定坐标和像素点颜色查找实现,设计分辨率比例:16:9、16:10,其他比例待适配 +
如果在不修改分辨率的情况下脚本无法正常运行,建议 **显示器和游戏** 的画面分辨率设置为 **长宽比16:9** 且 **关闭HDR** 后重新运行脚本 2. 由于实现原理较简易,此脚本无法保证在所有情况下都能稳定运行。
若出现失效、意外报错,请尝试重启脚本后于主界面重新运行。
若仍无法正常运行,请提出[issue](https://gitee.com/UCPr251/zzzAuto/issues/new?template=bug.yml)并按照[issue](https://gitee.com/UCPr251/zzzAuto/issues/new?template=bug.yml)模板描述提供所需信息 -3. 由于电脑配置的差异,实际动画加载时长可能比预设的更久进而导致错误,可自行修改源码的[休眠系数](零号业绩.ahk#L36)延长全局的等待时长 +3. 由于电脑配置的差异,实际动画加载时长可能比预设的更久进而导致错误,可自行修改源码的[休眠系数](零号业绩.ahk#L37)延长全局的等待时长 4. 战斗按照鲨鱼妹设计,其他角色只要哪怕一直a都能S评价即可 - > 战斗时长一般在20~50s以内,超过50s建议换个角色试试 + > 战斗时长一般在15~50s以内,超过50s建议换个角色 5. 为避免消息弹窗等的影响,建议在脚本运行期间开启 **免打扰模式** diff --git a/components/charOperation.ahk b/components/charOperation.ahk index 68b6535..1e6a330 100644 --- a/components/charOperation.ahk +++ b/components/charOperation.ahk @@ -6,26 +6,18 @@ charOperation() { activateZZZ() RandomSleep() ; 进入快捷手册 - Press('Escape') - RandomSleep(1300, 1500) - pixelSearchAndClick(699, 949, 734, 996, 730, 970, 0xffffff) + Press('F2') RandomSleep(1000, 1200) - ; 点击挑战 - if (PixelSearchPre(&X, &Y, 1490, 160, 1535, 200, 0xbbbbbb)) { + if (PixelSearchPre(&X, &Y, c.快捷手册.挑战_灰色*)) { SimulateClick(X, Y) } else { - pixelSearchAndClick(1490, 160, 1535, 200, 1513, 185, 0x000000) + pixelSearchAndClick(c.快捷手册.挑战_黑色*) } - RandomSleep() - ; 点击零号空洞 - pixelSearchAndClick(275, 463, 380, 490, 330, 475, 0xaaaaaa) - RandomSleep() - ; 点击前往 - pixelSearchAndClick(1424, 353, 1476, 390, 1450, 370, 0xffffff) - RandomSleep() - ; 点击确定(传送) - pixelSearchAndClick(1000, 600, 1100, 640, 1125, 620, 0x00cc0d) + pixelSearchAndClick(c.快捷手册.零号空洞*) + pixelSearchAndClick(c.快捷手册.前往*) + pixelSearchAndClick(c.快捷手册.传送*) RandomSleep(3000, 4000) + ; 验证是否成功进入零号空洞选择界面 mode := recogLocation() if (mode != 2) { return false diff --git a/components/choose.ahk b/components/choose.ahk index 3cef935..e8c393f 100644 --- a/components/choose.ahk +++ b/components/choose.ahk @@ -13,15 +13,16 @@ choose() { Press("Space", 16) rgbs := [ [0xb2eb47, () => 1], ; 恢复身体 - [0x10cbf4, () => pixelSearchAndClick(930, 700, 1000, 760, 960, 730, 0xffffff)], ; 降压准备 - [0xff802c, () => pixelSearchAndClick(930, 700, 1000, 760, 960, 730, 0xffffff)], ; 邦布插件 + [0x10cbf4, () => pixelSearchAndClick(c.空洞.2.降压准备*)], ; 降压准备 [0xc01c00, 1], ; 侵蚀物资 [0xaa7cff, 2], ; 垃圾物资或催化 ] clickFnc := 0 loop (10) { for (rgb in rgbs) { - PixelSearchPre(&FoundX, &FoundY, 1360, 490, 1390, 763, rgb[1]) + clone := c.空洞.选项框.Clone() + clone.Push(rgb[1]) + PixelSearchPre(&FoundX, &FoundY, clone*) if (FoundX && FoundY) { SimulateClick(FoundX, FoundY) clickFnc := rgb[2] @@ -37,25 +38,23 @@ choose() { ; 未找到对应选项 if (clickFnc = 0) { return false - ; 侵蚀物资 - } else if (clickFnc = 1) { + } else if (clickFnc = 1) { ; 侵蚀物资 ; 领取铭徽 MingHui() ; 加载侵蚀动画 - RandomSleep(4800, 5200) + RandomSleep(1800, 2000) loop (10) { ; 确认侵蚀 或 集齐四个同类铭徽触发的赠送铭徽确定(特殊) - if (PixelSearchPre(&X, &Y, 840, 620, 1000, 810, 0x00cc0d)) { + if (PixelSearchPre(&X, &Y, c.空洞.侵蚀*) || PixelSearchPre(&X, &Y, c.空洞.集齐铭徽*)) { SimulateClick(X, Y) - RandomSleep(4800, 5200) + RandomSleep(1800, 2000) } Sleep(100) } - ; 垃圾物资或催化 - } else if (clickFnc = 2) { + } else if (clickFnc = 2) { ; 垃圾物资或催化 loop (10) { ; 点击确定 - if (PixelSearchPre(&X, &Y, 930, 750, 985, 810, 0xffffff)) { + if (PixelSearchPre(&X, &Y, c.空洞.确定*)) { SimulateClick(X, Y) RandomSleep(4000, 4200) } diff --git a/components/common.ahk b/components/common.ahk index b94c8aa..6092306 100644 --- a/components/common.ahk +++ b/components/common.ahk @@ -22,7 +22,7 @@ RandomSleep(ms1 := 50, ms2 := 100) => Sleep(Random(Round(ms1 * sleepCoefficient) MingHui(isTry := false) { X := 0, Y := 0 loop (10) { - if (PixelSearchPre(&X, &Y, 930, 760, 1000, 810, 0xffffff, variation // 2)) { + if (PixelSearchPre(&X, &Y, c.空洞.铭徽*)) { break } Sleep(100) @@ -32,7 +32,7 @@ MingHui(isTry := false) { return false } MsgBox("未找到铭徽选择框,将使用默认位置", "警告", "Icon! T1") - X := 960, Y := 790 + X := c.空洞.铭徽[5], Y := c.空洞.铭徽[6] preprocess(&X, &Y) ; 缩放处理默认坐标 } SimulateClick(X, Y) @@ -69,8 +69,9 @@ RandomMouseMove(TargetX, TargetY) { MouseGetPos(&StartX, &StartY) Distance := Sqrt((TargetX - StartX) ** 2 + (TargetY - StartY) ** 2) MinSpeed := 25 - MaxSpeed := 35 - Speed := MinSpeed + Random() * (MaxSpeed - MinSpeed) + MaxSpeed := 30 + ; 鼠标移动速度,适当缩放确保效果 + Speed := (MinSpeed + Random() * (MaxSpeed - MinSpeed)) * (A_ScreenWidth / 1920) ; 生成随机控制点用于贝塞尔曲线 ControlPoint1X := StartX + Random() * (TargetX - StartX) / 2 ControlPoint1Y := StartY + Random() * (TargetY - StartY) / 2 @@ -101,7 +102,15 @@ SimulateClick(x?, y?, clickCount := 1) { } /** 对坐标进行缩放预处理的像素搜索,取真实坐标 */ -PixelSearchPre(&X, &Y, X1, Y1, X2, Y2, Color, Tolerance := variation) { +PixelSearchPre(&X, &Y, X1, Y1, X2, Y2, Color, Tolerance := variation, transColor?, transTolerance?) { + if (IsSet(transColor)) { + Color := transColor + if (IsSet(transTolerance)) { + Tolerance := transTolerance + } else { + Tolerance := variation + } + } preprocess(&X1, &Y1) preprocess(&X2, &Y2) return PixelSearch(&X, &Y, X1, Y1, X2, Y2, Color, Tolerance) @@ -119,19 +128,19 @@ PixelSearchPre(&X, &Y, X1, Y1, X2, Y2, Color, Tolerance := variation) { */ pixelSearchAndClick(X1, Y1, X2, Y2, defaultX, defaultY, Color) { X := 0, Y := 0 - loop (10) { + loop (25) { if (PixelSearchPre(&X, &Y, X1, Y1, X2, Y2, Color)) { break } Sleep(100) } if (!X || !Y) { - MsgBox("未找到像素点" Color ",将使用默认位置", "警告", "Icon! T1") + MsgBox(Format("未找到像素点{1:#x},使用默认位置" defaultX " " defaultY, Color), "警告", "Icon! T1") X := defaultX, Y := defaultY preprocess(&X, &Y) ; 缩放处理默认坐标 } - RandomSleep() SimulateClick(X, Y) + RandomSleep() return [X, Y] } diff --git a/components/coordsData.ahk b/components/coordsData.ahk new file mode 100644 index 0000000..36b628b --- /dev/null +++ b/components/coordsData.ahk @@ -0,0 +1,125 @@ +setRatio() { + coordsData := { + 16x9: { + 角色操作: { + M: [1170, 880, 1800, 920, 0xffffff], + Q: [1770, 1020, 1790, 1050, 0xffffff], + Tab: [1800, 100, 1850, 130, 0xffffff] + }, + 零号选择: { + 资质考核: [240, 700, 260, 750, 0x78cc00], + 旧都列车: [580, 780, 600, 850, 660, 770, 0x78cc00], + 施工废墟: [680, 410, 700, 450, 0x78cc00] + }, + 旧都列车: { + 前线: [1600, 349, 1800, 420, 1706, 374, 0xbff700], + 下一步: [1660, 960, 1740, 1040, 1707, 1028, 0xffffff], + 出战: [1660, 960, 1740, 1040, 1707, 1028, 0xffffff] + }, + 快捷手册: { + 挑战_灰色: [1490, 160, 1535, 200, 0xbbbbbb], + 挑战_黑色: [1490, 160, 1535, 200, 1513, 185, 0x000000], + 零号空洞: [275, 463, 380, 490, 330, 475, 0xaaaaaa], + 前往: [1424, 353, 1476, 390, 1450, 370, 0xffffff], + 传送: [1000, 600, 1100, 640, 1125, 620, 0x00cc0d] + }, + 空洞: { + 铭徽: [930, 760, 1000, 810, 960, 790, 0xffffff], + 侵蚀: [840, 620, 1000, 810, 0x00cc0d], + 确定: [930, 750, 985, 810, 0xffffff], + 选项框: [1360, 490, 1390, 763], + 集齐铭徽: [840, 620, 1000, 810, 0x00cc0d], + 1: { + 右上终点: [1300, 220, 1380, 270, 0xf63d49], + 右下终点: [1300, 840, 1400, 900, 0xeb2a2c], + 战斗: { + 计时: [1230, 430, 1370, 610, 0xffc300], + 确定键: [1130, 840, 1190, 1020, 0xffffff], + 确定绿勾: [1000, 840, 1040, 1020, 0x00cc0d] + } + }, + 2: { + 降压准备: [930, 700, 1000, 760, 960, 730, 0xffffff], + 银行: { + 礼包: [1340, 540, 1380, 600, 0xaa7cff], + 不要礼包: [1400, 660, 1460, 690, 1653, 678, 0xffffff] + } + }, + 退出副本: { + 放弃: [1580, 960, 1600, 1050, 1712, 1026, 0xcb0000], + 确定: [1000, 600, 1100, 640, 1125, 620, 0x00cc0d] + }, + 结算: { + 零号业绩: [1320, 600, 1440, 666, 0xffb500], + 完成: [1670, 970, 1730, 1040, 1700, 1027, 0xffffff] + } + } + }, + 16x10: { + 角色操作: { + M: [1170, 880, 1800, 920, 0xffffff], + Q: [1770, 1020, 1790, 1050, 0xffffff], + Tab: [1800, 100, 1850, 130, 0xffffff] + }, + 零号选择: { + 资质考核: [240, 700, 260, 750, 0x78cc00], + 旧都列车: [580, 780, 600, 850, 660, 770, 0x78cc00], + 施工废墟: [680, 410, 700, 450, 0x78cc00] + }, + 旧都列车: { + 前线: [1600, 349, 1800, 420, 1706, 374, 0xbff700], + 下一步: [1660, 960, 1740, 1040, 1707, 1028, 0xffffff], + 出战: [1660, 960, 1740, 1040, 1707, 1028, 0xffffff] + }, + 快捷手册: { + 挑战_灰色: [1490, 160, 1535, 200, 0xbbbbbb], + 挑战_黑色: [1490, 160, 1535, 200, 1513, 185, 0x000000], + 零号空洞: [275, 463, 380, 490, 330, 475, 0xaaaaaa], + 前往: [1424, 353, 1476, 390, 1450, 370, 0xffffff], + 传送: [1000, 600, 1100, 640, 1125, 620, 0x00cc0d] + }, + 空洞: { + 铭徽: [930, 760, 1000, 810, 960, 790, 0xffffff], + 侵蚀: [840, 620, 1000, 810, 0x00cc0d], + 确定: [930, 750, 985, 810, 0xffffff], + 选项框: [1360, 490, 1390, 763], + 集齐铭徽: [840, 620, 1000, 810, 0x00cc0d], + 1: { + 右上终点: [1300, 220, 1380, 270, 0xf63d49], + 右下终点: [1300, 840, 1400, 900, 0xeb2a2c], + 战斗: { + 计时: [1230, 430, 1370, 610, 0xffc300], + 确定键: [1130, 840, 1190, 1020, 0xffffff], + 确定绿勾: [1000, 840, 1040, 1020, 0x00cc0d] + } + }, + 2: { + 降压准备: [930, 700, 1000, 760, 960, 730, 0xffffff], + 银行: { + 礼包: [1340, 540, 1380, 600, 0xaa7cff], + 不要礼包: [1400, 660, 1460, 690, 1653, 678, 0xffffff] + } + }, + 退出副本: { + 放弃: [1580, 960, 1600, 1050, 1712, 1026, 0xcb0000], + 确定: [1000, 600, 1100, 640, 1125, 620, 0x00cc0d] + }, + 结算: { + 零号业绩: [1320, 600, 1440, 666, 0xffb500], + 完成: [1670, 970, 1730, 1040, 1700, 1027, 0xffffff] + } + } + }, + } + ratio := A_ScreenWidth / A_ScreenHeight + for (key, value in coordsData.OwnProps()) { + sp := StrSplit(key, "x") + designRatio := sp[1] / sp[2] + if (designRatio = ratio) { + global c := value + return + } + } + MsgBox("当前显示器分辨率" A_ScreenWidth "x" A_ScreenHeight "无内置数据,将使用16:9的分辨率比例数据进行缩放处理`n若此脚本无法正常运行,请尝试更改显示器分辨率比例为16:9", "警告", "Icon! 0x40000") + global c := coordsData.16x9 +} \ No newline at end of file diff --git a/components/enterFuben.ahk b/components/enterFuben.ahk index 0c761cc..8503a63 100644 --- a/components/enterFuben.ahk +++ b/components/enterFuben.ahk @@ -6,19 +6,9 @@ enterFuben() { activateZZZ() debugLog("【step1】进入副本") RandomSleep() - - ; 进入旧都列车 - pixelSearchAndClick(610, 750, 750, 820, 665, 792, 0xffffff) - ; 加载动画 - RandomSleep(1000, 1200) - ; 进入旧都列车·前线 - pixelSearchAndClick(1600, 349, 1800, 420, 1706, 374, 0xbff700) - ; 下一步 - pixelSearchAndClick(1660, 960, 1740, 1040, 1707, 1028, 0xffffff) - ; 加载动画 - RandomSleep(1000, 1200) - ; 出战 - pixelSearchAndClick(1660, 960, 1740, 1040, 1707, 1028, 0xffffff) - ; 加载动画 + pixelSearchAndClick(c.零号选择.旧都列车*) + pixelSearchAndClick(c.旧都列车.前线*) + pixelSearchAndClick(c.旧都列车.下一步*) + pixelSearchAndClick(c.旧都列车.出战*) RandomSleep(17000, 18000) } \ No newline at end of file diff --git a/components/exitFuben.ahk b/components/exitFuben.ahk index f695790..be3e8f6 100644 --- a/components/exitFuben.ahk +++ b/components/exitFuben.ahk @@ -9,11 +9,9 @@ exitFuben() { ; 退出副本 Press("Escape") - RandomSleep(1000, 1200) ; 点击放弃 - pixelSearchAndClick(1580, 960, 1600, 1050, 1712, 1026, 0xcb0000) - RandomSleep(600, 700) + pixelSearchAndClick(c.空洞.退出副本.放弃*) ; 点击确定 - pixelSearchAndClick(1000, 600, 1020, 650, 1121, 625, 0x00cc0d) + pixelSearchAndClick(c.空洞.退出副本.确定*) RandomSleep(4400, 4600) } \ No newline at end of file diff --git a/components/fight.ahk b/components/fight.ahk index 7408209..3b24c4b 100644 --- a/components/fight.ahk +++ b/components/fight.ahk @@ -7,8 +7,8 @@ fight() { debugLog("【step4】战斗") RandomSleep() - ; 点击进入战斗 - pixelSearchAndClick(1390, 540, 1500, 570, 1650, 570, 0xffffff) + ; 进入战斗 + Press("1") /** 判断是否位于对应界面 */ judge(patterns) { @@ -22,9 +22,9 @@ fight() { /** 通过三个特殊定位点判断所处界面 */ patterns := [ - [1230, 430, 1370, 610, 0xffc300], ; 战斗计时 - [1130, 840, 1190, 1020, 0xffffff], ; 确定键 - [1000, 840, 1040, 1020, 0x00cc0d] ; 确定绿勾 + c.空洞.1.战斗.计时, + c.空洞.1.战斗.确定键, + c.空洞.1.战斗.确定绿勾 ] /** 判断战斗是否结束 */ @@ -57,7 +57,7 @@ fight() { } ; 加载动画 - RandomSleep(16000, 16200) + RandomSleep(16300, 16400) ; 战斗循环,约8s一循环 loop (12) { if (A_Index != 1) { diff --git a/components/getMoney.ahk b/components/getMoney.ahk index 5aeba48..c2fa88e 100644 --- a/components/getMoney.ahk +++ b/components/getMoney.ahk @@ -17,10 +17,10 @@ getMoney() { ; 获得零号业绩(如果有) Press('w') ; 加载动画 - RandomSleep(2000, 2200) + RandomSleep(1600, 1800) X := 1800, Y := 900 preprocess(&X, &Y) ; 点击确定(如果有) SimulateClick(X, Y, 2) - RandomSleep(1000, 1200) + RandomSleep(800, 1000) } \ No newline at end of file diff --git a/components/isLimited.ahk b/components/isLimited.ahk index fde3bf4..e947e9b 100644 --- a/components/isLimited.ahk +++ b/components/isLimited.ahk @@ -7,7 +7,7 @@ isLimited() { ; debugLog("【step9】判断是否上限") ; 结算界面判断是否达到周上限 loop (20) { - if (PixelSearchPre(&FoundX, &FoundY, 1320, 600, 1440, 666, 0xffb500)) { + if (PixelSearchPre(&FoundX, &FoundY, c.空洞.结算.零号业绩*)) { return false } Sleep(100) diff --git a/components/reachEnd.ahk b/components/reachEnd.ahk index f1e0109..a392a65 100644 --- a/components/reachEnd.ahk +++ b/components/reachEnd.ahk @@ -9,12 +9,12 @@ reachEnd() { mode := 0 loop (10) { ; 对指定区域进行RGB检测 - if (PixelSearchPre(&FoundX, &FoundY, 1300, 220, 1380, 270, 0xf63d49)) { + if (PixelSearchPre(&FoundX, &FoundY, c.空洞.1.右上终点*)) { mode := 1 break } ; 对指定区域进行RGB检测 - if (PixelSearchPre(&FoundX, &FoundY, 1300, 840, 1400, 900, 0xeb2a2c)) { + if (PixelSearchPre(&FoundX, &FoundY, c.空洞.1.右下终点*)) { mode := 2 break } @@ -38,7 +38,7 @@ reachEnd() { RandomSleep(1900, 2100) } - /** 右上角终点 */ + /** 右上终点 */ above() { ; 使用炸弹 bomb() @@ -53,16 +53,19 @@ reachEnd() { Press("w", 2) } - /** 右下角终点 */ + /** 右下终点 */ below() { ; 代理人接应窗口 Press('s') - RandomSleep(800, 1200) - Press("Space", 6) - RandomSleep(2400, 2600) - ; 取消接应 - pixelSearchAndClick(1400, 650, 1620, 685, 1545, 672, 0xffffff) - Press("Space", 6) + RandomSleep(1000, 1200) + Press("Space", 4) + RandomSleep(800, 1000) + ; 接应 + Press('1') + RandomSleep(800, 1000) + Press('1') + RandomSleep(800, 1000) + Press('Escape') RandomSleep(1800, 2000) ; 使用炸弹 bomb() diff --git a/components/recogLocation.ahk b/components/recogLocation.ahk index 42cdc62..9d2dacb 100644 --- a/components/recogLocation.ahk +++ b/components/recogLocation.ahk @@ -2,14 +2,14 @@ recogLocation() { /** 通过三个特殊定位点判断所处界面 */ patterns1 := [ - [1170, 880, 1800, 920, 0xffffff], ; M - [1770, 1020, 1790, 1050, 0xffffff], ; Q - [1800, 100, 1850, 130, 0xffffff] ; Tab + c.角色操作.M, + c.角色操作.Q, + c.角色操作.Tab ] patterns2 := [ - [240, 700, 260, 750, 0x78cc00], ; 资质考核 - [580, 780, 600, 850, 0x78cc00], ; 旧都列车 - [680, 410, 700, 450, 0x78cc00] ; 施工废墟 + c.零号选择.资质考核, + c.零号选择.旧都列车, + c.零号选择.施工废墟 ] judge(patterns) { for (pattern in patterns) { diff --git a/components/refuse.ahk b/components/refuse.ahk index d1ebf48..0639838 100644 --- a/components/refuse.ahk +++ b/components/refuse.ahk @@ -9,11 +9,11 @@ refuse() { ; 开局铭徽(如果有) MingHui(true) ; 对话 - Press("Space", 10) + Press("Space", 8) ; 拒绝 - pixelSearchAndClick(1400, 670, 1520, 690, 1662, 676, 0xffffff) + Press('2') ; 对话 - Press("Space", 10) + Press("Space", 8) ; 加载动画 RandomSleep(5000, 5200) } \ No newline at end of file diff --git a/components/saveBank.ahk b/components/saveBank.ahk index 36a5d8e..6ed7ff9 100644 --- a/components/saveBank.ahk +++ b/components/saveBank.ahk @@ -13,31 +13,30 @@ saveBank() { Press('a') RandomSleep(2400, 2500) ; 强行闯入 - pixelSearchAndClick(1355, 590, 1390, 660, 1668, 618, 0x296bfd) + Press("2") ; 对话 Press('Space', 8) ; 侵蚀 - RandomSleep(4000, 4500) + RandomSleep(1800, 2000) ; 确定侵蚀 - pixelSearchAndClick(950, 630, 1000, 660, 970, 650, 0xffffff) - RandomSleep(4500, 4800) + Press('Escape') + RandomSleep(4200, 4400) Press('a', 3) - RandomSleep(1300, 1500) + RandomSleep(1000, 1200) ; 对话 - Press('Space', 20) + Press('Space', 18) ; 如果有礼包 - if (PixelSearchPre(&X, &Y, 1347, 548, 1380, 595, 0xaa7cff)) { - pixelSearchAndClick(1403, 668, 1457, 689, 1653, 678, 0xffffff) ; 不要礼包 + if (PixelSearchPre(&X, &Y, c.空洞.2.银行.礼包*)) { + pixelSearchAndClick(c.空洞.2.银行.不要礼包*) Press('Space', 4) } ; 存款 - Coords := pixelSearchAndClick(1360, 440, 1390, 500, 1640, 470, 0x296bfd) loop (6) { - SimulateClick(Coords[1], Coords[2], 2) + Press('1') Press('Space', 2) ; 如果有礼包 - if (PixelSearchPre(&X, &Y, 1340, 540, 1380, 600, 0xaa7cff)) { - pixelSearchAndClick(1400, 660, 1460, 690, 1653, 678, 0xffffff) ; 不要礼包 + if (PixelSearchPre(&X, &Y, c.空洞.2.银行.礼包*)) { + pixelSearchAndClick(c.空洞.2.银行.不要礼包*) Press('Space', 2) } ; 如果弹出选择铭徽界面 diff --git "a/\351\233\266\345\217\267\344\270\232\347\273\251.ahk" "b/\351\233\266\345\217\267\344\270\232\347\273\251.ahk" index 0894bda..61902c8 100644 --- "a/\351\233\266\345\217\267\344\270\232\347\273\251.ahk" +++ "b/\351\233\266\345\217\267\344\270\232\347\273\251.ahk" @@ -2,8 +2,8 @@ * @description 绝区零零号空洞零号业绩自动刷取、自动银行存款脚本 * @file 零号业绩.ahk * @author UCPr - * @date 2024/07/29 - * @version v1.3.1 + * @date 2024/08/15 + * @version v1.4.0 * @link https://github.com/UCPr251/zzzAuto * @warning 请勿用于任何商业用途,仅供学习交流使用 ***********************************************************************/ @@ -19,6 +19,7 @@ SetWinDelay(0) SetKeyDelay(-1) SetMouseDelay(-1) #Include ./components +#Include coordsData.ahk #Include charOperation.ahk #Include choose.ahk #Include common.ahk @@ -35,7 +36,7 @@ SetMouseDelay(-1) /** 休眠系数,加载动画等待时长在原基础上的倍率,可通过修改该值延长/缩短全局等待时长 */ global sleepCoefficient := 1 /** RGB颜色搜索允许的渐变值 */ -global variation := 40 +global variation := 60 /** 是否开启调试日志信息输出 */ global isDebugLog := true /** 是否开启银行模式 */ @@ -54,7 +55,7 @@ global statistics := [] } } -/** Ctrl+s 保存并重载程序 */ +; /** Ctrl+s 保存并重载程序 */ ; ~^s:: { ; if (InStr(WinGetTitle("A"), "Visual Studio Code") && InStr(WinGetTitle("A"), A_ScriptName)) { ; Send("^s") @@ -138,9 +139,7 @@ global statistics := [] /** 初始化 */ init() { MsgBox("`t`t绝区零零号空洞自动刷取脚本`n`n注意:此脚本必须在管理员模式下运行才能使用`n`n使用方法:`n Alt+Z :启动脚本(默认情况下会循环刷取直至零号业绩达到周上限)`n Alt+T :查看/关闭刷取统计`n Alt+S :关闭/开启银行存款(关闭后不再存银行)`n Alt+L :关闭/开启日志弹窗`n Alt+P :暂停/恢复脚本`n Alt+R :重启脚本`n Alt+Q :退出脚本`n Alt+B :银行模式(开启此模式后,无论是否达到上限都会一直刷取)`n`n仓库地址:https://github.com/UCPr251/zzzAuto", "UCPr", "0x40000") - if (A_ScreenWidth / A_ScreenHeight != 16 / 9) { - MsgBox("检测到当前显示器分辨率为" A_ScreenWidth "x" A_ScreenHeight "`n若此脚本无法正常运行,请尝试更改显示器分辨率比例为16:9", "警告", "Icon! 0x40000") - } + setRatio() } init() @@ -148,6 +147,11 @@ init() /** 开始,检测所在页面 */ main() { activateZZZ() + WinGetClientPos(, , &w, &h, "ahk_exe ZenlessZoneZero.exe ahk_class UnityWndClass") + if (w != A_ScreenWidth && h != A_ScreenHeight) { + MsgBox("【错误】请全屏运行游戏", "错误", "Iconx 0x40000") + Exit() + } mode := recogLocation() if (!mode) { return MsgBox("请位于 <零号空洞关卡选择界面> 或 <角色操作界面> 重试", "错误", "Iconx 0x40000") @@ -205,8 +209,8 @@ retry(reason) { ; 退出副本 exitFuben() ; 点击完成 - pixelSearchAndClick(1670, 970, 1730, 1040, 1700, 1027, 0xffffff) - RandomSleep(4600, 4800) + pixelSearchAndClick(c.空洞.结算.完成*) + RandomSleep(4800, 5000) ; 重新识别所处界面 mode := recogLocation() if (mode = 2) { @@ -226,7 +230,7 @@ run() { status := 0 ; 进入副本 enterFuben() - ; 拒绝好意,结束对话 + ; 拒绝好意 refuse() ; 前往终点 status := reachEnd() @@ -264,8 +268,8 @@ run() { } RandomSleep(800, 1000) ; 点击完成 - pixelSearchAndClick(1670, 970, 1730, 1040, 1700, 1027, 0xffffff) - RandomSleep(4600, 4800) + pixelSearchAndClick(c.空洞.结算.完成*) + RandomSleep(4800, 5000) ; 继续循环 run() } \ No newline at end of file