Asolidboat Posted August 9, 2017 Share Posted August 9, 2017 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 More sharing options...
Asolidboat Posted August 9, 2017 Author Share Posted August 9, 2017 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 More sharing options...
Developers Jos Posted August 9, 2017 Developers Share Posted August 9, 2017 @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 More sharing options...
Recommended Posts