Jump to content
Sign in to follow this  
Meep

Help!, Pixelgetcolor problems

Recommended Posts

:( It's me again, Hey I'am having problems with pixelgetcolor. I'am trying to get my script to search for a 'White paint bucket', Everything goes well and the pixelgetcolor works flawlessly. But when it detects the paint bucket and tells the mouse to move to the cords, it gave me this error:

Line 18 (file blah blah)

MouseClick("left", $coord[0], $coord[1], 5, 1)

MouseClick("left", ^ERROR

Error: Variable used eithout being declared.

Can anyone teach me how to declare that variable? to make my mouse move to it and prease the left mouse button. Thanks a Bunch!!

Share this post


Link to post
Share on other sites

WinActive("Counter-Strike Source")

While 1

If PixelGetColor(518, 410) = 16777215 Then

MouseClick("left", $coord[0], $coord[1], 5, 1)

sleep(1)

EndIf

Wend

Share this post


Link to post
Share on other sites

Have you noticed that the variable $Coord does not exist? You need to assign it to the PixelGetColor function like below...

WinActive("Counter-Strike Source")

While 1
   $Coord = PixelGetColor(518, 410)
   If $Coord = 16777215 Then
      MouseClick("Left", $Coord[0], $Coord[1], 5, 1)
      Sleep(1)
   EndIf
Wend

qq

Share this post


Link to post
Share on other sites

Now I got this error:

Line 19 (file blah blah)

MouseClick("Left", $Coord[0], $Coord[1], 5, 1)

MouseClick("Left", $Coord^ERROR

Error: Subscript used with non-Array variable.

Share this post


Link to post
Share on other sites

is the white paint bucket always in the same place?

or do you really have to search for it like you said in your first post?

edit: I see via your profile that you are off reading the link that I posted. You should also visit your rose online post... you have answers

http://www.autoitscript.com/forum/index.ph...t=0entry83356

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...