1

I'm trying to learn how to code in python and I decided to make my first program a simple bot for a game.

The game is a downloadable game.

The goal is for my mouse to click a button at coordinates (200, 200)

I have tried many different ways to get this to work.

I've tried...

PyAutoGui implementation

pyautogui.click(200, 200)

pywin32 implementation

import win32api, win32con
def click(x,y):
    win32api.SetCursorPos((x,y))
    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,x,y,0,0)
    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,x,y,0,0)
click(10,10)

Any ideas? From what I understand I need to use a low level driver?

I just don't understand how to emulate it as if a real mouse was clicking

Community
  • 1
  • 1
  • @drum I linked to what code I was using. What do you mean Please show code? – PythonIsHard Oct 12 '16 at 04:37
  • Considering that you edited your question after my comment, I'm pretty sure you know what I meant by show code. – drum Oct 12 '16 at 04:38
  • @drum I literally copied and pasted the code from those links into the post lol. But yeah, you're right. it's probably easier for you guys to help if you don't have to go find it on the sites :) – PythonIsHard Oct 12 '16 at 04:40
  • Some game have anti bot clicking,maybe that is one of them. – okie Oct 23 '19 at 09:52

0 Answers0