Jump to content

If Then


Recommended Posts

hi

i cant get it to work...

so what i want is if i press the y key the message box with that right activate

and if i press n the message box with wrong sorry!

i know i can do that with hotkeys but i want to do that with this method is this possible?

if  "y"  then 
MsgBox(4096,"","Thats right") 
            
ElseIf "n" Then 
MsgBox(4096,"","Wrong sorry")   
            
EndIf

thx :D

Link to comment
Share on other sites

If you're dead-set on avoiding Hotkeys for something like this, you can use _IsPressed().

Adapted from the helpfile:

#include <Misc.au3>

$dll = DllOpen("user32.dll")

While 1
    Sleep ( 250   )
    If _IsPressed("59", $dll) Then
          MsgBox(4096,"", "Thats right")
        ExitLoop
    ElseIf _IsPressed("4E", $dll) Then
          MsgBox(4096,"", "Wrong sorry")
        ExitLoop
    EndIf
WEnd
DllClose($dll)

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Link to comment
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
 Share

  • Recently Browsing   0 members

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