Metin2 SendInput (python)

04/04/2025 00:42 crzy666#1
i wish to make a clickbot with python to sendinput mouse clicks . i dont know how to get it to work. tried with postmessage and got an erroe "its blocked" something like that. am i doing right but getting ac block ?

EDİT:
008C0846 S WM_SETCURSOR hwnd:008C0846 hittest:HTCLIENT wMouseMsg:WM_MOUSEMOVE
008C0846 P WM_MOUSEMOVE fwKeys:0000 xPos:1187 yPos:523
008C0846 S WM_MOUSEACTIVATE hwndTopLevel:008C0846 hittest:HTCLIENT wMsg:WM_LBUTTONDOWN
008C0846 S WM_SETCURSOR hwnd:008C0846 hittest:HTCLIENT wMouseMsg:WM_LBUTTONDOWN
008C0846 P WM_LBUTTONDOWN fwKeys:MK_LBUTTON xPos:1187 yPos:523
008C0846 P WM_MOUSEMOVE fwKeys:MK_LBUTTON xPos:1187 yPos:523
008C0846 P WM_LBUTTONUP fwKeys:00 xPos:1187 yPos:523
008C0846 S WM_SETCURSOR hwnd:008C0846 hittest:HTCLIENT wMouseMsg:WM_MOUSEMOVE

i found this with spy++


MOUSEEVENTF_LEFTDOWN = 0x0002
MOUSEEVENTF_LEFTUP = 0x0004
WM_LBUTTONDOWN = 0x0201
WM_LBUTTONUP = 0x0202
WM_MOUSEMOVE = 0x0200

# Koordinatları normalize etmek için kullanılan fonksiyon
def normalize_coords(x, y):
screen_width = ctypes.windll.user32.GetSystemMetrics(0)
screen_height = ctypes.windll.user32.GetSystemMetrics(1)
return int(x * 65535 / screen_width), int(y * 65535 / screen_height)

# Fare tıklama işlemi (mouse hareket ettirmeden)
def send_click(hwnd, x, y):
# Sanal fare hareketi simülasyonu

# WM_MOUSEMOVE (fareyi hareket ettirme)
# Fare hareketi simülasyonu için fare pozisyonunu ayarla

ctypes.windll.user32.PostMessageW(hwnd, WM_MOUSEMOVE, 0, (y << 16) | x)
#time.sleep(0.05) # Hareket simülasyonu için küçük bir gecikme

# WM_LBUTTONDOWN (fareyi basma)
ctypes.windll.user32.PostMessageW(hwnd, WM_LBUTTONDOWN, 0, (y << 16) | x)

ctypes.windll.user32.PostMessageW(hwnd, WM_MOUSEMOVE, 0, (y << 16) | x)
#time.sleep(0.05) # Hareket simülasyonu için küçük bir gecikme

# WM_LBUTTONUP (fareyi bırakma)
ctypes.windll.user32.PostMessageW(hwnd, WM_LBUTTONUP, 0, (y << 16) | x)

tried this code clicking but not moving (without moving cursor)