简体   繁体   English

在游戏中移动十字准线

[英]moving a crosshair in Games

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我已经尝试使用 pyautogui 和 pydirectinput 以及其他一些我可以让它在浏览器中工作的东西但是当我进入游戏并且鼠标被中心锁定并且它不会将十字准线移动到右侧 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这是我到目前为止所做的并且对移动部分做了很多变化但无法让它移动十字准线。目前正在尝试在瞄准实验室中使用它它使用图像识别如果我能让它工作我可能会把它改成颜色所以它再次更准确这是供个人使用而不是在线或者我大大低估了做这样的事情的难度。我目前正在使用 python 3.10.8 最新版本

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM