Jump to content
Sign in to follow this  
dist7act

Simple Code Help!!!

Recommended Posts

dist7act

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
JohnOne

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
dist7act

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
Penisaurus

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
JohnOne

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

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.