Skip to content

Commit

Permalink
fix locker
Browse files Browse the repository at this point in the history
  • Loading branch information
ubuntu committed Feb 17, 2022
1 parent c33a999 commit 08a303c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/info/window_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ pub const WINDOW_16_9: WindowInfo = WindowInfo {
star_x: 1469.4,
star_y: 123.9,

lock_x: 1451.0,
lock_y: 356.0,
lock_x: 1450.0,
lock_y: 357.0,

pool_pos: Rect(118.2, 1144.7 + 15.0, 510.3, 1144.7),
};
Expand Down Expand Up @@ -166,8 +166,8 @@ pub const WINDOW_8_5: WindowInfo = WindowInfo {
flag_y: 82.1,
star_x: 1321.3,
star_y: 111.3,
lock_x: 1306.0,
lock_y: 321.0,
lock_x: 1305.0,
lock_y: 322.0,
pool_pos: Rect(103.6, 1025.8 + 15.0, 460.7, 1028.5),
};

Expand Down Expand Up @@ -198,6 +198,6 @@ pub const WINDOW_4_3: WindowInfo = WindowInfo {
star_x: 1175.4,
star_y: 95.8,
lock_x: 1160.0,
lock_y: 285.0,
lock_y: 286.0,
pool_pos: Rect(93.2, 912.7 + 15.0, 412.4, 912.7),
};
10 changes: 6 additions & 4 deletions src/scanner/yas_scanner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,13 +403,14 @@ impl YasScanner {
(self.info.lock_x as i32 + self.info.left) as u32,
(self.info.lock_y as i32 + self.info.top) as u32,
);
// info!("Lock color: {} {} {}", color.0, color.1, color.2);

let color_t = Color::from(73, 83, 102);
let color_f = Color::from(243, 239, 234);
let color_f = Color::from(241, 237, 232);

if color_t.dis_2(&color) == 0 {
if color_t.dis_2(&color) <= 3 {
return true;
} else if color_f.dis_2(&color) == 0 {
} else if color_f.dis_2(&color) <= 3 {
return false;
} else {
return !lock_last; // switch animation
Expand Down Expand Up @@ -673,7 +674,8 @@ impl YasScanner {
self.move_to(row, col);
self.enigo.mouse_click(MouseButton::Left);

self.wait_until_switched();
// self.wait_until_switched();
utils::sleep(80);

let capture = self.capture_panel().unwrap();
let star = self.get_star();
Expand Down

0 comments on commit 08a303c

Please sign in to comment.