Jump to content

2x if in a loop


Goss3N
 Share

Recommended Posts

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

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

Link to comment
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 =)
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...