Jump to content

Multiple If priority?


Recommended Posts

Good day my friends, how can i have priority over this script? i tried google and searching but i think i cant find the right question to ask?

#priority1
if $4 = 1 Then
ControlSend($hHandle,"","","{4}")
Sleep(500)
     EndIf
     
#priority2
if $e = 1 Then
ControlSend($hHandle,"","","{e}")
Sleep(500)
EndIf

#priority3
if $r = 1 Then
ControlSend($hHandle,"","","{r}")
Sleep(500)
EndIf

 

Edited by scriptshark
Link to comment
Share on other sites

Like this?

#priority1
If $4 = 1 Then
    ControlSend($hHandle, "", "", "{4}")
    Sleep(500)
Else
    #priority2
    If $e = 1 Then
        ControlSend($hHandle, "", "", "{e}")
        Sleep(500)
    Else
        #priority3
        If $r = 1 Then
            ControlSend($hHandle, "", "", "{r}")
            Sleep(500)
        EndIf
    EndIf
EndIf

or this should work likewise

Select
    Case $4 = 1
        #priority1
        ControlSend($hHandle, "", "", "{4}")
        Sleep(500)
    Case $e = 1
        #priority2
        ControlSend($hHandle, "", "", "{e}")
        Sleep(500)
    Case $r = 1
        #priority3
        ControlSend($hHandle, "", "", "{r}")
        Sleep(500)
EndSelect

Edit: Removed orphaned "then" in select statement

Edited by KaFu
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...