Jump to content

Coding Help


Recommended Posts

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

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

  • Developers

@Asolidboat,

Welcome, but please read our forum rules before continuing posting in our forums as this clearly is related to game automation. :)\

*Click*

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Jos locked this topic
Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...