4

up up down down left right left right b a enter :: Msgbox, konami code.

is there a way to do this?

Snob
  • 71
  • 5

1 Answers1

3

yes its actually pretty simple...

comb := "up|down|down|left|right|left|right|b|a|enter" 
~up::
Loop, parse, comb, |
{
    input, var,T.900,{%a_loopfield%}
    if inStr(ErrorLevel, "Timeout")
        return
}
msgbox Konami Code!!!
return

The first "up" is the one that will trigger the sequence hence only one "up" in the combination variable.

you can change the combination to whatever you want, but then you would have to change the hotkey to the first "key" that you want to press.

RaptorX
  • 331
  • 1
  • 9
  • 19
  • 2
    is there a way to output the msgbox after the whole combination has occurred? I'm testing it and instantly after "UP" the msgbox appears – Eric Fortis Dec 18 '10 at 05:11
  • Not sure why you have that problem, it worked for me as soon as i wrote that script, and even now i tried again and i got the desired effect... not sure why it shows up like that to you. – RaptorX Mar 14 '11 at 20:59
  • Are you running the script by itself or part of a large script? Something is not coded correctly causing the loop to terminate early. – Nelson Feb 11 '15 at 00:10