Open JC-WebInfo opened 9 months ago
"When you use python -m mouseinfo
or python3 -m mouseinfo
, you will receive the x and y coordinates for clicking. For example: x-100, y-150."
example:
import pyautogui
import time
time.sleep(5)
pyautogui.moveTo(100, 150)
pyautogui.click()
so i need to get mouse coordonnate, move at them to avoid the random move? Like this example?
from time import sleep
import pyautogui
sleep(5);
x,y = pyautogui.position()
pyautogui.moveTo(x, y)
pyautogui.click()
I try to make bots for Modded Minecraft 1.16.2(modpack RAD2).
When i use pyautogui.click(), the cursor move inside Minecraft before clicking.
Minecraft: 1.16.2 (modpack RAD2, https://www.curseforge.com/minecraft/modpacks/roguelike-adventures-and-dungeons-2 ) Python: 3.10.12 Pyautogui: 0.9.54
Step to reproduct it: 1)Launch minecraft, load a world, pause game 2)open python 2)type in python:
3)return to minecraft, unpause it 4)wait 5 seconds 5)TADA !