#๐Ÿ”’ roblox doesn't detect mouse movement onto buttons

8 messages ยท Page 1 of 1 (latest)

surreal mortar
#

using pyautogui to move my mouse to a button is not being recognized, the button does not get darker (to show i've hovered over it) and clicking doesn't do anything until i've slightly moved my mouse by 1 pixel. what am i not understanding?

sage hamletBOT
#

@surreal mortar

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

surreal mortar
#
import pyautogui, time, win32gui, pywinauto, pydirectinput, win32api, win32con, autoit

class Buyer:
    def __init__(self):
        self.mainFunction()

    def keepRobloxActive(self):
        # brings ROBLOX to the foreground
        try:
            pywinauto.application.Application().connect(best_match='Roblox').top_window().set_focus()
            time.sleep(1)
        except:
            input("Unable to detect ROBLOX, are you sure it's open?")

    def locateSeedButton(self):
        # finds the seeds button coordinates to know where to click
        try:
            seedButton = pyautogui.locateOnScreen('images/seeds.png', confidence=0.8)
            x, y = seedButton.left, seedButton.top
            pyautogui.moveTo((x+10,y+10), duration=5) 
            time.sleep(0.1)
            pyautogui.leftClick()
        except:
            input('Unable to detect the seed button, resolution might be incorrect')

    def mainFunction(self):
        self.keepRobloxActive()
        self.locateSeedButton()

Buyer()
maiden kelp
#

What Roblox game is this for?

hoary shell
#

!rule tos

sage hamletBOT
#

5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.

sage hamletBOT
#
Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.