[Solved] My first Autohotkey runs too slow [closed]


Nevermind, I completely screwed up and I see now why. Thanks for the help guys….

EDIT: VERY WELL.

The whole script is just plain terrible like i said in the original post. As for what is wrong with it, not with the help of anyone here, even though I know there is people out there who have seen it and seen the mistakes and decided to just not help.

The IF statements and Searchimage were set within the wrong { }. As in the whole build of the script made no sense, its a miracle it even worked to begin with.

This is for starters what it should have looked like.

            ImageSearch pointX, pointY, 0, 0, 1920, 1080, *125 C:\Users\ICECOLD\Desktop\new_test\Starport_services.bmp ;Can we see starport services?
                {       
                    sleep 150
                    If ErrorLevel = 1 ; If it CAN'T find Starport Services, it will look for Mission Board instead.
                    {
                            sleep 150
                            ImageSearch pointX2, pointY2, 0, 0, 1920, 1080, *100 C:\Users\ICECOLD\Desktop\new_test\Mission_Board.bmp  ;Can we see Mission Board?
                            if ErrorLevel = 1 ;If it CAN'T find mission board, it will ask for it.
                        {
                                        MsgBox, 48, Something went wrong!, I can't find "Mission Board" or "Starport Services" anywhere.
                                        MsgBox, 4132, Something went wrong!, Do you wish to retry?
                                        IfMsgBox Yes
                            {
                                                MsgBox, 4160, Restarting, Click OK and switch back to game with "Starport Services" Open!! `n(YOU GET 15 SECONDS TIME)
                                            sleep 15000
                                            gosub labelstart
                                            ExitApp

                                If ErrorLevel = 0 ;If it finds Mission Board it will navigate to the Mission Board.
                                {
                                        Sleep 143
                                        SendEvent s
                                        Sleep 177
                                        SendEvent {Space}
                                        sleep 10000
                                        gosub LabelMissionBoard


                                If ErrorLevel = 0 ;If it finds Starport services it will navigate to the Mission Board.
                                    {
                                        Sleep 200
                                        SendEvent {space}
                                        sleep 15234
                                        SendEvent s
                                        sleep 134
                                        SendEvent {Space}
                                        sleep 10000
                                    }   gosub LabelMissionBoard
                                }       
                            }       
                        }
                    }       
                }

As you can see in the code above as opposed to what the start of the code I posted originally. Which has multiple things happening at the same time, so instead of stopping after having found a image it just kept on going regardless, it did NOT however press the buttons only count the ‘sleep’ for whatever reason it did that, I have no f&^*( clue, because I’m basically a beginner at this point. A salty one nonetheless. So there’s your darn answer, now excuse me while I never come back here again.

0

solved My first Autohotkey runs too slow [closed]