Jump to content

Help with Pixel search.. i believe?


Recommended Posts

Ok... So i'm making a bot for a game..

WinMove("http://ogreisland.com - OI client - Mozilla Firefox", "", 0, 0)
WinWaitActive("http://ogreisland.com - OI client - Mozilla Firefox", "")
Sleep(100)

    While 1
        $coord = PixelSearch(0, 0, 806, 656, 0x7691AE, 5, 0)
        MouseClick("", $coord[0], $coord[1], 1, 0)
        Sleep(6000)
    WEnd

That's the code.

It apparently just looks for the rock of the color 0x7691AE and clicks it every 6 seconds.

Thats all good.. But when there's no more rocks left to click.. or.. "0x7691AE" isn't found

on the screen, the program just closes. Can't i make it so that it just sleeps if "0x7691AE"

isn't found, until it is found?

Link to comment
Share on other sites

Yeah.. it works.. Thanks. now.. is there a way to make it so that.. the

Win move and Win wait active don't have to be so specific?

Like.. It can just move the window "oi client" and wait for the "oi client" window to be active.. instead of

http://ogreisland.com - OI client - Mozilla Firefox?

Edited by edwarddd
Link to comment
Share on other sites

From the help file:

WinTitleMatchMode - Alters the method that is used to match window titles during search operations.

1 = Match the title from the start (default)

2 = Match any substring in the title

3 = Exact title match

4 = Advanced mode, see Window Titles & Text (Advanced)

-1 to -4 = force lower case match according to other type of match.

Code:

Opt("WinTitleMatchMode",2)

You can just put M as the title and it will work.

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...