0

I'm aware of a program that can simulate a right-click at specific coordinates on my display at any given interval.

However, I'm wondering if it's possible to write a script that can perform a right-click at a specific position on my display when a very specific number is generated as a result of the first right-click?

For example, this website generates temporary phone numbers, which can also be purchased if you care to. After ten seconds or so, you can right click to have another five, ten digit phone numbers generated. Is there a way to have a script recognize when an exact ten digit number is generated, even if its very unlikely that the number will ever be generated?

Brass tacks is I'm trying everything I can to get an old phone number that is "available" (not owned by anyone else yet) but I'm unable to have my old phone carrier help in the process. I need a security code for an important g-mail account which uses my old phone number as a recovery option. This temp phone number website has generated a couple phone numbers that have had the first 6 digits correct so I figured it would be worth a shot making a script that could be run in the background waiting for the correct ten digit number to be generated, if by chance it ever does.

Kusalananda
  • 320,670
  • 36
  • 633
  • 936
Ryan
  • 1
  • 1
    Can you perform the interactions using `curl`? That likely would make the process you are proposing a lot easier. – bxm May 29 '23 at 07:02

1 Answers1

0

For doing this with a website, you'd be best off using selenium: https://www.selenium.dev/ for example, using the python library https://selenium-python.readthedocs.io/

If you want to do this just by interacting with the desktop, you'd have to script it to recognise when a particular image appears on the screen. xdotool doesn't support this (see this list of xdotool commands https://github.com/jordansissel/xdotool/blob/master/xdotool.pod) but pyautogui does: https://pyautogui.readthedocs.io/en/latest/screenshot.html#the-locate-functions

So you'd have to get an image of the correct number, search for it using the screenshot function, and loop for as long as the image isn't on screen

jmcb
  • 1
  • 1