Sign in to follow this  
Followers 0
daxle

Need Help with loops

5 posts in this topic

Sleep(3000)
MsgBox(0,"Starting", "We are ready to start!")
$s=1
While $s=1
    $reaction = PixelSearch("413,551", "621,477", "849,559", "656,656", 0x00CC33)
    MouseClick("left", $reaction[0], $reaction[1])
WEnd

What im trying to do is loop it so that it constantly searches for the pixels, im having major trouble with this

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

From the Help File for PixelSearch:

Return Value

Success: Returns a two-element array of pixel's coordinates. (Array[0] = x, Array[1] = y) 
Failure: Sets @error to 1 if color is not found.

I would presume that you need to change it to:

Sleep(3000)
MsgBox(0,"Starting", "We are ready to start!")
$s=1
While $s=1
    $reaction = PixelSearch("413,551", "621,477", "849,559", "656,656", 0x00CC33)
    If Not @error Then
        MouseClick("left", $reaction[0], $reaction[1])
    EndIf
    Sleep (100) ; Thrown in just for good, non-cpu-hogging measure
WEnd
Edited by exodius

Share this post


Link to post
Share on other sites

well to start off the..

$s=1
While $s=1oÝ÷ ÙƧm殶­sgvÆRb33³b33°¢ââà¢ââà§vVæoÝ÷ Ù©Ý~í+ºÚ"µÍ  ÌÍÜXXÝ[ÛH^[ÙXÚ
    ][ÝÍLË
MLI][ÝË   ][ÝÍK

ÍÉ][ÝË  ][ÝÎ
K
MNI][ÝË   ][ÝÍM
M][ÝËÐÌÌÊB[ÝÙPÛXÚÊ   ][ÝÛY ][ÝË  ÌÍÜXXÝ[ÛÌK    ÌÍÜXXÝ[ÛÌWJoÝ÷ Û*.®j,¶X¤z zÛbaÇ«®êº

* If you have any questions feel free to ask!

Hope this helps! :)

- John


Latest Projects :- New & Improved TCP Chat

Share this post


Link to post
Share on other sites

sorry.. I was posting my reply while the guy above was I guess D;...


Latest Projects :- New & Improved TCP Chat

Share this post


Link to post
Share on other sites

Thanks everyone, its working great!!

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