Sign in to follow this  
Followers 0
Sharkpad

How can i add hotkey here.

3 posts in this topic

#1 ·  Posted

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



#2 ·  Posted

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

#3 ·  Posted

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  
Followers 0