Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Having problems with quickly closing a macro
#7
Thumbs Up 
Thanks so much. This is exactly what i needed! The toggle sound effect plays during execution. YES. Big Grin
 
Code:
Copy      Help
/*/ ifRunning run; /*/
script.setup(trayIcon: !true, sleepExit: true, lockExit: true);

using var mutex = new Mutex(true, "mutex-BF6-spacebar", out bool createdNew);
run.thread(() => { sound.speak(createdNew ? "Toggle On" : "Toggle off"); }, background: false);
if (createdNew) {
    WndUtil.CreateMessageOnlyWindow("#32770", script.name);
} else {
    int id = wnd.findFast(script.name, "#32770", messageOnly: true).ProcessId;
    if (id != 0) script.end(id);
    return;
}

opt.key.KeySpeed = 15;
opt.key.NoBlockInput = true;
opt.key.NoModOff = true;

while (true)
{
    keys.send("Space");
}
Edit: This is ultimately the version i settled on because for some reason, keys.sendL() is skipping key presses in the game window, but works fine in every other window. Not sure what the issue is there.


Messages In This Thread
RE: Having problems with quickly closing a macro - by AshesOfHegemony - 10-18-2025, 11:59 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)