How to use macro in an anti-cheat protected MMO?

3.4k Views Asked by At

In an MMORPG (Metin2) game, I need to click on certain places with the mouse, but the cheat protection prevents this. I can't even do this on the desktop when the game is open.

To be more specific, let's say I'm fishing in the game;

  1. While fishing, bait is attached to the fishing line by pressing the "1" button first.
  2. Then press the "space" button to shake the fishing rod.
  3. After a while, a fish icon appears on the character.
  4. When the fish icon appears, press the "space" button again to attract the fish.
  5. After a few repetitions, a question will appear on the screen to prove that you are not a bot. This question consists of 3 options, if you do not click on the right option, you will be kicked out of the game.
  6. This loop continues like this.

I can catch this fish with OpenCV, but as I said, anti-cheat prevents keys or any mouse clicks.

These clicks;

  1. Python Modules;
    • PyAuotit (it didn't work)
    • PyAutogui (it didn't work)
    • AutoPy (it didn't work)
    • PyNput (it didn't work)
    • PyWinAuto (it didn't work)
    • PyDirectinput (it didn't work)
    • Win32con (it didn't work)
  2. MacroRecorder v2; (it didn't work)
  3. Autoit; (it didn't work)
  4. Corsair ICUE Software (it worked)

Yes, the ICUE software allows me to make keyboard inputs and mouse clicks, but it cannot integrate with python.

Is there any other way I can do keyboard inputs and mouse clicks with Python? Or can I run ICUE software integrated in languages such as python, c++?

2

There are 2 best solutions below

3
kinshukdua On

There is an official python binding for the iCUE software

Installation:

  pip install -U cuesdk

Python:

from cuesdk import CueSdk

sdk = CueSdk()
sdk.connect()

print(sdk.protocol_details)

print(sdk.get_devices())

Here's the API reference

You can use something like OpenCV to detect the events in game.

0
GoktugCetin On

I been trying to same thing in the metin2, pydirectinput really worked after i run powershell/cmd with administrator rights.Key inputs are working but clicks still not working, i might use steelseries drivers for mouse, i couldnt figure out yet but you can send keyboard keys.

from time import sleep
import pydirectinput
import pyautogui as gui
sleep(4);
pydirectinput.keyDown('w')
sleep(1)
pydirectinput.keyUp('w')
sleep(1)
gui.moveTo(300,100)
gui.click(300,100)