asarandi / wordscapes-bot

python bot that plays wordscapes via scrcpy, pyautogui
https://en.wikipedia.org/wiki/Wordscapes
25 stars 14 forks source link

Not working on Galaxy Tab, #17

Open JaxzKyd opened 2 years ago

JaxzKyd commented 2 years ago

With these config settings

config = {
    "window_max_size": 768,
    "window_height": 768,
    "screenshot_region": (0, 0, 344, 768 + y_offset),
    "circle_center": (172, 596 + y_offset),
    "shuffle_button": (32, 507 + y_offset),
    "close_piggybank": (285, 210 + y_offset),
    "circle_radius": 109,
    "rearranged_box_size": 64,
    "rearranged_padding": 8,
    "forbid_three_circle": (43, 43 + 22, 685 + y_offset, 685 + 22 + y_offset),
    "letter_contour_dim": (30, 39, 6, 50),
}

on my galaxy tab (tablet) this is what the bot "sees" capture

Meanwhile this is the size of the scrcpy

Samsung Tab

same image but cropped

Samsung Tab CROPPED

How do i edit this to fix it not working?

asarandi commented 2 years ago

hi, as i mentioned here https://github.com/asarandi/wordscapes-bot/issues/15#issuecomment-1207153327 i recommend you open the screenshot in an image viewer/editor and figure out the Y,X positions of things then use the new values that you've figured out in the config object

JaxzKyd commented 2 years ago

"forbid_three_circle": (43, 43 + 22, 685 + y_offset, 685 + 22 + y_offset), How do I find information for this? What do the numbers mean

JaxzKyd commented 2 years ago
config = {
    "window_max_size": 768,
    "window_height": 768,
    "screenshot_region": (0, 0, 464, 768 + y_offset),
    "circle_center": (230, 538 + y_offset),
    "shuffle_button": (43, 427 + y_offset),
    "close_piggybank": (285, 210 + y_offset),
    "circle_radius": 140,
    "rearranged_box_size": 64,
    "rearranged_padding": 8,
    "forbid_three_circle": (43, 43 + 22, 660 + y_offset, 660 + 22 + y_offset),
    "letter_contour_dim": (30, 39, 6, 50),
}

I've tried this config so far, still doesn't work, I think i'm missing something

asarandi commented 2 years ago

i suggest you look at this comment: https://github.com/asarandi/wordscapes-bot/issues/15#issuecomment-1207156006

regarding forbid_three_circle - this a tuple of 4 coordinates (x0, x1, y0, y1) where x is distance from left margin and y is distance from top margin