How to pause at else if(ErrorLevel=0)

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Rlentless
Posts: 13
Joined: 19 Apr 2018, 06:16

How to pause at else if(ErrorLevel=0)

08 Nov 2018, 09:29

Hi,

I've got a little script with SendInput commands running if "else if(ErrorLevel=1)" and I would like to pause it if "else if(ErrorLevel=0)" in order to run a different set of SendInput commands until "else if(ErrorLevel=1)" again. How can I do this?

Reading the docs for 'Pause' didn't help me understand how this can be done :( I tried doing whats in the code below but it doesn't work only PressTheKey works

Code: Select all

else if (ErrorLevel=1)
                    {
                        Loop,

                            PressTheKey:
                            {
                                Send, {space down}	
                                Send, {F4 down}		
                                Sleep 10
                                Send, {F4 up}		

                                Send, {z down}		
                                Sleep 10
                                Send, {z up}		

                                Send, {1 down}		
                                Sleep 10
                                Send, {1 up}
                        
                    }
 else if(ErrorLevel=0) 
                    {
                        
                        
                        sleep 1000
                        SendInput, {ctrl down}
                        SendInput, {h down}
                        
                        sleep 500
                        SendInput, {ctrl up}
                        SendInput, {h up}
                        SendInput, {f1 down}
                        sleep 1000
                        SendInput, {f1 up}
                        SendInput, {ctrl down}
                        SendInput, {h down}
                        
                        sleep 500
                        SendInput, {ctrl up}
                        SendInput, {h up} 
                    }

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], joefiesta and 302 guests