Jump to content

Recommended Posts

Posted

I want this code to be able to mouse move to the current location and click on it, once it can't find the specific pixel through pixel search . Can anyone help me I've been stuck for hours.

$left = 1079
$top = 34
$right = 1906
$bottom = 611

$color = 0xEFD21E

HotKeySet("{f1}", "myExit")

while(1)
   WinActivate("[V93] SpawnPK")
   $pix = PixelSearch($left, $top, $right, $bottom, $color, 1)

   if not(@error) Then
      MouseClick("left",$pix[0],$pix[1],1,1)
   EndIf
   if int(@error) Then
      Mousemove ( 1826, 119 [, speed = 10] )
   EndIf
WEnd

 

func myExit()
   Exit
EndFunc

Posted
5 minutes ago, Asolidboat said:
$left = 1079
$top = 34
$right = 1906
$bottom = 611

$color = 0xEFD21E

HotKeySet("{f1}", "myExit")

while(1)
   WinActivate("[V93] SpawnPK")
   $pix = PixelSearch($left, $top, $right, $bottom, $color, 1)

   if not(@error) Then
      MouseClick("left",$pix[0],$pix[1],1,1)
   EndIf
   if int(@error) Then
      Mousemove ( 1826, 119 [, speed = 10] )
   EndIf
WEnd



func myExit()
   Exit
EndFunc

My bad ^ didn't let me edit

 

  • Jos locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...