[HELP] Proton.me Captcha - How to Map Captcha Solution Coordinates to Browser Viewport for Drag-and-Drop in BAS

Support
  • Hello BAS Community,
    I’m working on a project where I need to solve a slider captcha (like a puzzle piece that must be dragged into a hole). I have an external solver that gives me the coordinates of the hole relative to the captcha image (let’s call these RESULT_X and RESULT_Y). However, I’m struggling with how to convert these coordinates to the browser viewport coordinates so I can use BAS’s mouse actions to drag and drop the puzzle piece correctly.
    What I Have:
    The captcha image is displayed in the browser.
    My solver gives me the coordinates of the hole (RESULT_X, RESULT_Y) relative to the original image size (e.g., 300x150).
    I can get the displayed image’s position and size in the browser using BAS’s “Get Element Coordinates” and “Get Element Size” actions:
    IMG_X, IMG_Y = top-left corner of the image in the browser window
    WIDTH, HEIGHT = displayed width and height of the image (may be different from the original image size if scaled)
    The original image size (ORIG_WIDTH, ORIG_HEIGHT) is known (from the file or solver).
    What I Need:
    I want to move the mouse (using BAS) from the puzzle piece’s starting position to the hole, but I need to map the solver’s coordinates to the actual browser window coordinates.

    xgcravt1jl.png
    e80fcb65-4950-4672-a421-4fe528355796-1703507357655_bg.png
    81ab9b34-6dd3-4b3c-933a-3a3e7e1c4842-1703507360635_bg.png 6bae12a5-4d82-4f94-b54e-b55cc6127a1a-1703507363452_bg.png 5d197b5e-d872-4c6a-85d6-779c08ebbe5f-1703507366185_bg.png 53bbab8a-ea0b-417e-8f5e-6233b5b4bac8-1703507368862_bg.png