Skip to content

Commit

Permalink
Merge pull request #74 from Night-stars-1:dev
Browse files Browse the repository at this point in the history
fix: 修复参数错误导致偏移未正常应用
  • Loading branch information
Night-stars-1 authored Jul 23, 2024
2 parents 3c67d6b + a98ebe8 commit abbb3ab
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions auto/run_business/buy.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ def click_bargain_button(num=0):
logger.info("降价失败")
return False


def click_buy_button():
"""
说明:
Expand All @@ -257,7 +256,7 @@ def click_buy_button():
input_tap((1056, 647))
time.sleep(1)
image = screenshot()
bgr = get_bgr(image, (1177, 459), 5)
bgr = get_bgr(image, (1177, 459), offset=5)
logger.debug(f"购买物品界面颜色检查: {bgr}")
if bgr != [2, 133, 253] and bgr != [251, 253, 253]:
return True
Expand Down
2 changes: 1 addition & 1 deletion auto/run_business/sell.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def click_sell_button():
input_tap((1056, 647))
time.sleep(1)
image = screenshot()
bgr = get_bgr(image, (1175, 470), 5)
bgr = get_bgr(image, (1175, 470), offset=5)
logger.debug(f"出售物品界面颜色检查: {bgr}")
if bgr == [227, 131, 82]:
logger.info("检测到包含本地商品")
Expand Down
4 changes: 2 additions & 2 deletions core/module/bgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ def __init__(self, b: int, g: int, r: int, offset: int = 5):
self.offset = offset

def __str__(self):
return f"B: {self.b}, G: {self.g}, R: {self.r}"
return f"B: {self.b}, G: {self.g}, R: {self.r}, O: {self.offset}"

def __repr__(self):
return f"BGR({self.b}, {self.g}, {self.r})"
return f"BGR({self.b}, {self.g}, {self.r}, O: {self.offset})"

def __eq__(self, other: Union["BGR", Tuple[int, int, int], List[int]]):
"""
Expand Down

0 comments on commit abbb3ab

Please sign in to comment.