awlekso

how can i add hotkeys on my script.

5 posts in this topic

hello everyone i'm new on autoit how can i add hotkeys on my script

to start and stop with f1.

really i hope someone can help me please.

 


$Variable = PixelSearch(18, 23, 1250, 951, 0x11223e)
If IsArray($Variable) = True Then
  MouseClick("Right", $Variable [0], $Variable [1], 1)
  Else
    $Variable = PixelSearch(18, 23, 1250, 951, 0x112442)
  If IsArray($Variable) = True Then
  MouseClick("Right", $Variable [0], $Variable [1], 1)
  Else
    $Variable = PixelSearch(18, 23, 1250, 951, 0x020307)
  If IsArray($Variable) = True Then
  MouseClick("Right", $Variable [0], $Variable [1], 1)
  Else
    $Variable = PixelSearch(18, 23, 1250, 951, 0x122116)
  If IsArray($Variable) = True Then
  MouseClick("Right", $Variable [0], $Variable [1], 1)
       Else
    $Variable = PixelSearch(18, 23, 1250, 951, 0x0b172d)
  If IsArray($Variable) = True Then
  MouseClick("Right", $Variable [0], $Variable [1], 1)
       Else
    $Variable = PixelSearch(18, 23, 1250, 951, 0x122036)
  If IsArray($Variable) = True Then
  MouseClick("Right", $Variable [0], $Variable [1], 1)
        Else
    $Variable = PixelSearch(18, 23, 1250, 951, 0x0e0d14)
  If IsArray($Variable) = True Then
  MouseClick("Right", $Variable [0], $Variable [1], 1)
                       EndIf
                  EndIf
             EndIf
         EndIf
      EndIf
    EndIf
EndIf

Share this post


Link to post
Share on other sites



Hi,

Welcome to our forum. What are you trying to accomplish here?

Share this post


Link to post
Share on other sites

Instead of so many else you should do elseif and then you'd only need 1 endif

 

You're probably better making an infinite loop for pixelsearches

 

HotKeySet("_KEY", "Function")

Func Function
    ;insert stuff
EndFunc

    

Share this post


Link to post
Share on other sites

@badcoder123 can you explan me how can i add all my colors on this way how are you saying,can you make new script with hotkey "F1" with all my colors please i really don't know how to work with autoit.

@KickStarter15 i want to have a script with hotkey "F1" to start my script with all my colors,ex f1 pixelsearch look for colors what i have on my script.

hope you guys will help me sorry if my english is bad.

 

Share this post


Link to post
Share on other sites

Why use all this difficult Pixelsearch() and MouseClicking for a regular program? I hope you read the forum rules as that explains which type of program we don't want to see any discussions on.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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