Jump to content

How can i add hotkey here.


Recommended Posts

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.

Link to comment
Share on other sites

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=

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...