Sign in to follow this  
Followers 0
-=HWD=-

Help with This PixelSearch plz

9 posts in this topic

"$coord = PixelSearch(0,0,@DesktopWidth, @DesktopHeight, 16777215)"

hmm i am trying to make the mouse to click on this colour "16777215" but it just pop up with errors~ plz help correct this statement for mez ty.

Func Go()

while 1

sleep(2000)

----> $coord = PixelSearch(0,0,@DesktopWidth, @DesktopHeight, 16777215) <-----

if not @error then

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

EndIf

WEnd

EndFunc

Share this post


Link to post
Share on other sites



No error here, perhaps it is in the rest of your script.



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

ah ya i think it was thx~ sorry

Share this post


Link to post
Share on other sites

"$coord = PixelSearch(0,0,@DesktopWidth, @DesktopHeight, 16777215)"

hmm i am trying to make the mouse to click on this colour "16777215" but it just pop up with errors~ plz help correct this statement for mez ty.

Func Go()

while 1

sleep(2000)

----> $coord = PixelSearch(0,0,@DesktopWidth, @DesktopHeight, 16777215) <-----

if not @error then

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

EndIf

WEnd

EndFunc

-=HWD=-,

Try this:

; Find first pure white pixel
$coord = PixelSearch(0,0,@DesktopWidth, @DesktopHeight, 16777215)
If Not @error Then
    MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1])
    MouseClick("left", $coord[0], $coord[1], 1, 1)
EndIf
taurus905

"Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs

Share this post


Link to post
Share on other sites

but it doesnt seems to be clicking on the colour >.<

i used this to find the colour and insert it into the pixel colour~ have i scripted anything wrong? ><

---------------------------------------------------------------------------------------

dim $a = MouseGetPos(), $var = PixelGetColor($a[0], $a[1])

while 1

sleep(100)

WEnd

Func Start()

while 1

MsgBox(64, "Colour of Content", $var)

WEnd

EndFunc

Func Stop()

while 1

Sleep(50)

WEnd

EndFunc

-----------------------------------------------------------------------------------------

Then i inputed the colour into here:

---------------------------

HotKeySet("!{f7}", "Go")

HotKeySet("!{f8}", "Stop")

while 1

sleep(100)

WEnd

Func Go()

while 1

sleep(2000)

------> $coord = PixelSearch(0,0,@DesktopWidth, @DesktopHeight, 3238597) <----

if not @error then

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

EndIf

WEnd

EndFunc

Func Stop()

while 1

sleep(150)

WEnd

EndFunc

-----------------------------------------------------------------------------------------------

Share this post


Link to post
Share on other sites

Add a msgbox in before your MouseClick line and you will see where it is clicking. PixelSearch will find the first occurance of your colour starting left to right, top to bottom. You may have to restrict your search area.



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

but doesnt this mean the whole area of the screen?

"0,0,@DesktopWidth, @DesktopHeight"

Share this post


Link to post
Share on other sites

i added in MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1])

but it still wont do anything... so weird >.<

Share this post


Link to post
Share on other sites

is there something wrong with my find colour script?

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