dist7act Posted March 14, 2010 Posted March 14, 2010 I'am trying 2 make script that clicks on a certain pixel if it appears on my screen and ive ran into a snag. Heres my code with the error below it Script Local $Fun1 = 0x5A3701 While Not @error $ClickHere = PixelSearch( 318, 268, 1076, 690, 0x5A3701 ) If @error Then ExitLoop EndIf MouseClick (“left”, $ClickHere[1],$ClickHere[0]) WEnd Error C:\Program Files (x86)\AutoIt3\SciTE\test.au3(7,13) : ERROR: syntax error (illegal character) MouseClick (“ ~~~~~~~~~~~~^ C:\Program Files (x86)\AutoIt3\SciTE\test.au3 - 1 error(s), 0 warning(s) Any help would be nice.
JohnOne Posted March 14, 2010 Posted March 14, 2010 (edited) HotKeySet("!^c","_Click") Func _Click() Local $Fun1 = 0x5A3701 While Not @error $ClickHere = PixelSearch( 318, 268, 1076, 690, 0x5A3701 ) If @error Then ;not sure ExitLoop ;you need EndIf ;these lines MouseClick ("left", $ClickHere[1],$ClickHere[0]) WEnd EndFunc I dont know where your double quotes come from but they are not standard try above. Edited March 14, 2010 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Penisaurus Posted March 14, 2010 Posted March 14, 2010 (edited) Local $Fun1 = 0x5A3701 While Not @error $ClickHere = PixelSearch( 318, 268, 1076, 690, 0x5A3701 ) If @error Then ExitLoop EndIf MouseClick ("left", $ClickHere[1],$ClickHere[0]) WEndI retyped "left" and it didn't show any errors. o.oEdit:John got to it first. :c Edited March 14, 2010 by Penisaurus
dist7act Posted March 14, 2010 Author Posted March 14, 2010 (edited) Local $Fun1 = 0x5A3701 While Not @error $ClickHere = PixelSearch( 318, 268, 1076, 690, 0x5A3701 ) If @error Then ExitLoop EndIf MouseClick ("left", $ClickHere[1],$ClickHere[0]) WEnd I retyped "left" and it didn't show any errors. o.o Edit:John got to it first. :c thank you both but how would i add a hot key to it? so that i could start and stop the pixel search? Edited March 14, 2010 by dist7act
Penisaurus Posted March 14, 2010 Posted March 14, 2010 thank you both but how would i add a hot key to it? so that i could start and stop the pixel search? You could use this to start it, I'm not sure how to stop it without exiting the script though. HotKeySet("{F2}"), "Pixel_Search") Func Pixel_Search() Local $Fun1 = 0x5A3701 While Not @error $ClickHere = PixelSearch( 318, 268, 1076, 690, 0x5A3701 ) If @error Then ExitLoop EndIf MouseClick ("left", $ClickHere[1],$ClickHere[0]) WEnd EndFunc I'm still learning, if this is incorrect, let me know.
JohnOne Posted March 14, 2010 Posted March 14, 2010 HotKeySet("!^c","_Click") Func _Click() Local $Fun1 = 0x5A3701 While Not @error $ClickHere = PixelSearch( 318, 268, 1076, 690, 0x5A3701 ) If @error Then ;not sure ExitLoop ;you need EndIf ;these lines MouseClick ("left", $ClickHere[1],$ClickHere[0]) WEnd EndFunc AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
dist7act Posted March 14, 2010 Author Posted March 14, 2010 HotKeySet("!^c","_Click") Func _Click() Local $Fun1 = 0x5A3701 While Not @error $ClickHere = PixelSearch( 318, 268, 1076, 690, 0x5A3701 ) If @error Then ;not sure ExitLoop ;you need EndIf ;these lines MouseClick ("left", $ClickHere[1],$ClickHere[0]) WEnd EndFunc what is "!^c"?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now