How To Make Undetectable Macro

Hello i want to make so simple macro. im play game and i want my macro press z and 1 just this but game have shield they will banned for macro how can i make undetectable macro and how can i make work in background
thanks

I think you have to give more details.

In what sense does the game have a “shield”? When a macro doesn’t work in a game it is often because the game runs in fullscreen mode. Try to run the game in windowed or “borderless” mode, if available.

I think it is not that easy to detect if an input comes from the user or from a script/macro, unless you make it too obvious.

For example, if you repeat something (like a keystroke or a click), make the pauses in-between slightly random. Implement some checks, so that the macro doesn’t blindly continue for hours, for example when the in-game context has changed to something where the scripted action is no longer appropriate. (Found Image Condition may come in handy.)

But as said, without more details it is hard to give tips.

this game can be banned for macro but i dont make perfect script i just make press z and 1 mouse macros is work perfectly but i want to make work in background how can i do