Asolidboat

Coding Help

3 posts in this topic

#1 ·  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

Share this post


Link to post
Share on other sites



#2 ·  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

 

Share this post


Link to post
Share on other sites

#3 ·  Posted

@Asolidboat,

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

*Click*

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.