0

im trying to make an aim bot for personal fun use against friends not to ruin others experience and to see if I can make one I am relatively new to programming and cant get my cross hair to move. I have tried using pyautogui and pydirectinput and a few other things I can get it to work in a browser but when I get into a game and the mouse is center locked and it doesn't move the crosshair to the right position

code:

from shutil import move

from time import sleep

import pyautogui 

import pydirectinput
x=5

while True:
   
 sleep(5)
   
 x, y = pyautogui.locateCenterOnScreen("ball.jpg", confidence = 0.8)
    
 pydirectinput.moveTo(x, y, duration = 0.1)
    
 pyautogui.leftClick()
 
 break

This is what I have so far and have made many variations to the move part but cant get it to move the crosshair .Currently trying to use it in aim lab it uses image recognition if I can get this to work I will probably change it to color so its more accurate once again this is for personal use not online or am I greatly underestimating the difficulty it is to do something like this .I'm currently using python 3.10.8 the latest version

is200
  • 1
  • 3

1 Answers1

0

Try change this code part:

from shutil import move
from time import sleep
import pyautogui 

while True:   
 sleep(5)   
 x, y = pyautogui.locateCenterOnScreen("ball.jpg", confidence = 0.8)    
 pyautogui.moveTo(10, 10, duration = 0.1)    
 pyautogui.leftClick() 
 break
Akshay
  • 1,019
  • 12
  • 21
Biggye
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 14 '22 at 21:30