Jump to content

Recommended Posts

Posted (edited)

I'm writing a few macros for a game I play, it presses key combinations for me as the game's own in built method for quickly accessing features is too limited (anyone played NWN? that's the one I'm talking about). Anyway, a simple script for example:

HotKeySet("!s", "nwnStealth")

While 1
    Sleep(100)
WEnd

Func nwnStealth()
    Send("{NUMPAD0}{NUMPAD4}{NUMPAD4}")
EndFunc

Now the big kicker is that the game then thinks the key is still pressed down for some strange reason. You can add a sleep delay, but that relies on quick fingers. What I really need is a way to script a while loop, which waits until the alt or control keys are no longer being pressed down. Is this possible? I can't seem to find a function which would do what I'm after. There's MouseDown.. but no KeyDown. There's also _IsPressed, but that seems like a past tense check. Sure, it might have been pressed - maybe twice. I just need to know when it is released.

Edited by Suxen
Posted

have you looked at the relevant option settings ?

SendKeyDelay

SendKeyDownDelay

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Posted

I did indeed. Turns out _IsPressed is what I was after, though. I guess I'll live and learn on testing stuff properly.

Please post the code in this thread when you complete it.

Thanks.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...