Skip to content

Commit

Permalink
位置识别冗余处理、fix显示器分辨率与游戏分辨率不同时识别丁尼副本失败
Browse files Browse the repository at this point in the history
  • Loading branch information
UCPr251 committed Nov 26, 2024
1 parent 0cc2e69 commit 39b9e98
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 12 deletions.
2 changes: 1 addition & 1 deletion components/enterDennyFuben.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ enterDennyFuben(step := 2) {
static x := 251
static y := Floor(c.height * 0.9)
static ymin := c.height // 10
static maxO := Ceil(c.height / 2160 * 16)
static maxO := Ceil(c.height / 2160 * 24)
static GetPixel := PixelGetColor
static isPageDown := false
static calY(x0, y0, r, x) {
Expand Down
20 changes: 14 additions & 6 deletions components/recogLocation.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
recogLocation(loopTimes := 30) {
activateZZZ()

/** 通过三个特殊定位点判断所处界面 */
/** 通过特殊定位点判断所处界面 */
patterns := [[
c.角色操作.M,
c.角色操作.Q,
c.角色操作.T
[c.角色操作.T, c.角色操作.Tab]
], [
c.零号选择.资质考核,
c.零号选择.旧都列车,
Expand All @@ -24,20 +24,28 @@ recogLocation(loopTimes := 30) {
c.拿命验收.推荐等级
]]
static judge(patterns) {
UC:
for (pattern in patterns) {
if (!PixelSearchPre(&FoundX, &FoundY, pattern*)) {
return false
if (pattern[1] is Array) {
for (p in pattern) {
if (PixelSearchPre(&FoundX, &FoundY, p*)) {
continue UC
}
}
} else if (PixelSearchPre(&FoundX, &FoundY, pattern*)) {
continue
}
return false
}
return true
}
page := 0
uc:
UC:
loop (loopTimes) {
for (i, pattern in patterns) {
if (judge(pattern)) {
page := i
break uc
break UC
}
}
Sleep(100)
Expand Down
6 changes: 6 additions & 0 deletions utils/CoordsData.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class CoordsData {
M: [1800, 880, 1821, 908, 0xffffff],
Q: [1799, 1021, 1821, 1046, 0xffffff],
T: [355, 35, 375, 60, 0xffffff],
Tab: [1825, 116, 1865, 141, 0xffffff],
取消正在处理: [763, 608, 777, 644, 0xcb0000]
},
快捷手册: {
Expand Down Expand Up @@ -82,6 +83,7 @@ class CoordsData {
M: [1170, 880, 1800, 920, 0xffffff],
Q: [1770, 1020, 1790, 1050, 0xffffff],
T: [480, 35, 510, 60, 0xffffff],
Tab: [1800, 100, 1850, 130, 0xffffff],
取消正在处理: [694, 605, 715, 646, 0xcb0000]
},
零号选择: {
Expand Down Expand Up @@ -141,6 +143,7 @@ class CoordsData {
M: [1170, 880, 1800, 920, 0xffffff],
Q: [1770, 1020, 1790, 1050, 0xffffff],
T: [480, 30, 500, 55, 0xffffff],
Tab: [1800, 100, 1850, 130, 0xffffff],
取消正在处理: [690, 600, 720, 640, 0xcb0000]
},
快捷手册: {
Expand Down Expand Up @@ -207,6 +210,7 @@ class CoordsData {
M: [1769, 935, 1787, 948, 0xffffff],
Q: [1768, 1039, 1785, 1052, 0xffffff],
T: [480, 25, 500, 50, 0xffffff],
Tab: [1804, 90, 1846, 104, 0xffffff],
取消正在处理: [690, 590, 720, 620, 0xcb0000]
},
快捷手册: {
Expand Down Expand Up @@ -273,6 +277,7 @@ class CoordsData {
M: [1768, 943, 1787, 957, 0xffffff],
Q: [1769, 1042, 1786, 1054, 0xffffff],
T: [480, 20, 510, 50, 0xffffff],
Tab: [1802, 84, 1847, 97, 0xffffff],
取消正在处理: [700, 580, 720, 620, 0xcb0000]
},
快捷手册: {
Expand Down Expand Up @@ -337,6 +342,7 @@ class CoordsData {
; M: [0xffffff], ; 4个所需坐标参数,左上XY、右下XY
; Q: [0xffffff],
; T: [0xffffff],
; Tab: [0xffffff],
; 取消正在处理: [0xcb0000]
; },
; 快捷手册: {
Expand Down
10 changes: 5 additions & 5 deletions 零号业绩.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* @description 绝区零零号空洞零号业绩自动刷取、自动银行存款脚本
* @file 零号业绩.ahk
* @author UCPr
* @date 2024/11/21
* @version v2.1.3
* @date 2024/11/26
* @version v2.1.4
* @link https://github.com/UCPr251/zzzAuto
* @warning 请勿用于任何商业用途,仅供学习交流使用
***********************************************************************/
Expand Down Expand Up @@ -42,7 +42,7 @@ SetMouseDelay(-1)
#Include getDenny.ahk
#Include enterHDD.ahk
global Version := "v2.1.3"
global Version := "v2.1.4"
global ZZZ := "ahk_exe ZenlessZoneZero.exe"
init()
Expand Down Expand Up @@ -202,7 +202,7 @@ retry(reason?) {
RandomSleep()
page := 0
; 卡在空洞走格子、交互、确认界面,子界面
uc:
UC:
loop (6) {
Press('Space', 2)
if (PixelSearchPre(&X, &Y, c.空洞.确认*)) { ; 确认?
Expand Down Expand Up @@ -239,7 +239,7 @@ retry(reason?) {
RandomSleep(5600, 5800)
page := recogLocation()
if (page)
break uc
break UC
}
Sleep(100)
}
Expand Down

0 comments on commit 39b9e98

Please sign in to comment.