Sign in to follow this  
Followers 0
Goss3N

2x if in a loop

3 posts in this topic

Hi im having a problem with that i want two if statemens in one loop

#Region;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=Icon.ico
#EndRegion;**** Directives created by AutoIt3Wrapper_GUI ****
#include <misc.au3>

Dim $pos

AutoItSetOption("SendKeyDelay", 300)
While 1
    If _IsPressed("05") Then
        Send("{NUMPAD7}")
    EndIf
WEnd

and

#Region;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=Icon.ico
#EndRegion;**** Directives created by AutoIt3Wrapper_GUI ****
#include <misc.au3>

Dim $pos
AutoItSetOption("SendKeyDelay", 300)
While 1
    If _IsPressed("06") Then
        Send("{NUMPAD8}")
    EndIf
WEnd

how can i make theese in to one script

Share this post


Link to post
Share on other sites



#Region;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=Icon.ico
#EndRegion;**** Directives created by AutoIt3Wrapper_GUI ****
#include <misc.au3>

Dim $pos
$dll = DllOpen("user32.dll")
AutoItSetOption("SendKeyDelay", 300)
While 1
    If _IsPressed("05", $dll) Then
        Send("{NUMPAD7}")
    ElseIf _IsPressed("06", $dll) Then
        Send("{NUMPAD8}")
    EndIf
WEnd

Share this post


Link to post
Share on other sites

#Region;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=Icon.ico
#EndRegion;**** Directives created by AutoIt3Wrapper_GUI ****
#include <misc.au3>

Dim $pos
$dll = DllOpen("user32.dll")
AutoItSetOption("SendKeyDelay", 300)
While 1
    If _IsPressed("05", $dll) Then
        Send("{NUMPAD7}")
    ElseIf _IsPressed("06", $dll) Then
        Send("{NUMPAD8}")
    EndIf
WEnd
thanks =)

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