Jump to content

Need Help with loops


Recommended Posts

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

Link to comment
Share on other sites

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
Link to comment
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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...