Sign in to follow this  
Followers 0
dist7act

Simple Code Help!!!

8 posts in this topic

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.

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 by dist7act

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Control + Alt + C, see here

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0