Sign in to follow this  
Followers 0
HackerZer0

_ispressed help needed

5 posts in this topic

#1 ·  Posted (edited)

how could i create a script that does nothing until the user presses specified keys in a certain order instead of the same time?

ex:

the combo is.......... t e s t

i want to press "t", release, then "e", release, "s", release, "t", release and do the specified function

if i press "t" and then any other key other than "e" i want the proccess to start over, being the same case with the following "s" and "t"

i tried but i only got as far as a script that would do this, but without restarting on a wrong key press...

so the combos.... t e s a t ... t e k s t ... t f e h s h t ... etc

would work

as long as i manage to press the keys...

can anyone help me???

EDIT: problem further explained

Edited by HackerZer0

Share this post


Link to post
Share on other sites



Ar you ill talking about autohotkey? seriously dude they ripped autoits source code off so if your going to post autohotkey stuff leave the forum.

Heres a quick mod i through into one of Smoke_N's scripts

type test and then press enter

Global $nNumBuffer = ''
_HotKeySetNums()

While 1
    Sleep(0x7FFFFFFF)
WEnd

Func _HotKeySetNums()
    HotKeySet('t', '_HKBuffer')
    HotKeySet('e', '_HKBuffer')
    HotKeySet('s', '_HKBuffer')
    HotKeySet('t', '_HKBuffer')
    For $iCC = 0 To 4
        HotKeySet($iCC, '_HKBuffer')
    Next
    HotKeySet('{ENTER}', '_HKEnter')
    HotKeySet('{NUMPADENTER}', '_HKEnter')
EndFunc



Func _HKBuffer()
    $nNumBuffer &= @HotKeyPressed
EndFunc


Func _HKEnter()
    HotKeySet('{ENTER}')
    Send('{ENTER}')
    HotKeySet('{ENTER}', '_HKEnter')
    If $nNumBuffer = '' Then Return ''
    _ProgramsToRun($nNumBuffer)
    $nNumBuffer = ''
    Return ''
EndFunc

Func _ProgramsToRun($nNumProg)
    Switch $nNumBuffer
        Case "test"
            Run('NotePad.exe')
    EndSwitch
    Return ''
EndFunc

Share this post


Link to post
Share on other sites

that's what i've already accomplished...

i don't want it to run the program if i type

"teast"

or

"twegst"

only "test" ...

the script you posted will work as long as all the keys are pressed at some time, i want it manditory to have them be in order...

Share this post


Link to post
Share on other sites

When someone says they modded something of someone elses, I generally look up the function names in the advanced search here... by doing that you could find the original post usually if the function names were unique enough.

http://www.autoitscript.com/forum/index.php?showtopic=36518


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0