Jump to content
Sign in to follow this  
Sharkpad

How can i add hotkey here.

Recommended Posts

Sharkpad

im new with autoit how can i add here hotkey.


$Variable = PixelSearch(500, 67, 714, 400, 0x02591E)
If IsArray($Variable) = True Then
  MouseClick("Left", $Variable [0], $Variable [1], 1)
  Else
    $Variable = PixelSearch(500, 67, 714, 400, 0x239A2A)
  If IsArray($Variable) = True Then
  MouseClick("Left", $Variable [0], $Variable [1], 1)
  Else
    $Variable = PixelSearch(500, 67, 714, 400, 0x93574E)
  If IsArray($Variable) = True Then
  MouseClick("Left", $Variable [0], $Variable [1], 1)
   Else
    $Variable = PixelSearch(500, 67, 714, 400, 0x3A0247)
  If IsArray($Variable) = True Then
  MouseClick("Left", $Variable [0], $Variable [1], 1)
         EndIf
      EndIf
    EndIf
EndIf

 

everytime when i press f2 to start this script once then when i press again f2 to start again unlimited.

Share this post


Link to post
Share on other sites
Sharkpad

everytime when i press f2 to start once and stop then if i press f2 again to go once again,hope someone will help me.

Share this post


Link to post
Share on other sites
anthonyjr2

Can you reiterate what you mean? If you want a hotkey you need to use

HotKeySet("{F2}", "search")

Func search()
  $Variable = PixelSearch(500, 67, 714, 400, 0x02591E)
  If IsArray($Variable) = True Then
    MouseClick("Left", $Variable [0], $Variable [1], 1)
    Else
      $Variable = PixelSearch(500, 67, 714, 400, 0x239A2A)
    If IsArray($Variable) = True Then
    MouseClick("Left", $Variable [0], $Variable [1], 1)
    Else
      $Variable = PixelSearch(500, 67, 714, 400, 0x93574E)
    If IsArray($Variable) = True Then
    MouseClick("Left", $Variable [0], $Variable [1], 1)
     Else
      $Variable = PixelSearch(500, 67, 714, 400, 0x3A0247)
    If IsArray($Variable) = True Then
    MouseClick("Left", $Variable [0], $Variable [1], 1)
           EndIf
        EndIf
      EndIf
  EndIf
EndFunc

 


UHJvZmVzc2lvbmFsIENvbXB1dGVyZXI=

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
Sign in to follow this  

×