Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Having problems with quickly closing a macro
#3
I use a corsair keyboard with the ICUE software. I have an issue where the hardware drivers for the corsair bus keep corrupting for some reason(possibly because of the speed of input) causing my macro to no longer work and the toggle key to be non-functional. I got annoyed at reinstalling the software multiple times a day so i decided to find some macro software that could get the job done. I was able to create a functional macro in autohotkey, but then i realized AHK was blocked by the game i am playing. I'm not using a script to hack the game or cheat or anything like that. I just need a simple high speed loop so i can get into a pilot seat of an aircraft before other players do by spamming spacebar(the other players are also spamming spacebar or using a macro to do it so getting the pilot seat is still a 50% chance roughly). The server tick rate for the game i am playing is 60 hz, so it registers input every 16.6666 milliseconds. This is why my input needs to be every 20 milliseconds.

The purpose of toggle was to create my own variable to try a while(!toggle) loop, it is not being used at this point. That was before i realized how script.pause worked and shortly after realized i didnt even need script.pause because the HK command in the triggers file. Im just not sure if the script closing with the hot key press is not working properly because of some buffer overflow, or because its closing the application everytime, or if its actually a limitation of the scripting language itself. I mean its C# so i assumed execution would be very speedy. The script is working for the game i play, but it wont turn off properly sometimes. I also wanted to add some functionality to play a sound when it turns on and when it turns off. If the script could continue running in the tray and wait/listen for a toggle key combo without closing, that is probably the ideal way to get it to function properly. Sorry im not the best programmer, but i did go to school for computer science. I would use AI as an assist, but we both know its going to give me garbage code for LA.
Quote:Is it full script? What is the purpose of the `toggle` variable?

Edit: I just realized my code posted previously did not have a programmed delay. Even with delay it is still locking up and not closing properly, requiring multiple hotkey toggles to shut it off.

This is the full script. Here is what im using now:
Code:
Copy      Help
/*/ ifRunning end; /*/
script.setup(trayIcon: true, sleepExit: true, exitKey: KKey.MediaStop, pauseKey: KKey.MediaPlayPause);

sound.speak("Toggle On");
bool toggle = false;
while (!toggle)
{
    keys.send("Space");
    20.ms();
}


Messages In This Thread
RE: Having problems with quickly closing a macro - by AshesOfHegemony - 10-17-2025, 02:56 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)