Skip to content
This repository has been archived by the owner on Jul 25, 2023. It is now read-only.

Commit

Permalink
Fixed #18
Browse files Browse the repository at this point in the history
  • Loading branch information
WorldObservationLog committed Jul 24, 2023
1 parent 2210f3b commit 46321a8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ def show_raw_pixel_coordinate(self, x, y, canvas_index):
raw_y = y
return raw_x, raw_y

def get_board_relative_coords(self, raw_x, raw_y):
return raw_x + 1500, raw_y + 1000


def set_pixel_and_check_ratelimit(
self,
access_token_in,
Expand Down Expand Up @@ -425,10 +429,11 @@ def get_unset_pixel(self, x, y, index):
target_rgb, self.rgb_colors_array, self.legacy_transparency
)

if pix2[x + self.pixel_x_start, y + self.pixel_y_start] != new_rgb:
board_x, board_y = self.get_board_relative_coords(self.raw_pixel_x_start, self.raw_pixel_y_start)
if pix2[x + board_x, y + board_y] != new_rgb:
logger.debug(
"{}, {}, {}, {}",
pix2[x + self.pixel_x_start, y + self.pixel_y_start],
pix2[x + board_x, y + board_y],
new_rgb,
new_rgb != (69, 42, 0),
pix2[x, y] != new_rgb,
Expand All @@ -451,6 +456,7 @@ def get_unset_pixel(self, x, y, index):
x + self.pixel_x_start,
y + self.pixel_y_start,
)
logger.info("Same color, skipping...")
x += 1
loopedOnce = True
return x, y, new_rgb
Expand Down

0 comments on commit 46321a8

Please sign in to comment.