edwarddd Posted June 16, 2007 Share Posted June 16, 2007 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 More sharing options...
narayanjr Posted June 16, 2007 Share Posted June 16, 2007 While 1 $coord = PixelSearch(0, 0, 806, 656, 0x7691AE, 5, 0) If Not @error Then MouseClick("", $coord[0], $coord[1], 1, 0) Sleep(6000) EndIf WEnd that might do it not really sure Link to comment Share on other sites More sharing options...
edwarddd Posted June 16, 2007 Author Share Posted June 16, 2007 (edited) 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 June 16, 2007 by edwarddd Link to comment Share on other sites More sharing options...
edwarddd Posted June 16, 2007 Author Share Posted June 16, 2007 bump Link to comment Share on other sites More sharing options...
narayanjr Posted June 16, 2007 Share Posted June 16, 2007 "http://ogreisland.com - OI client - Mozilla Firefox" you should not need all of that i dont think you should be able to get away with just having the first 2-3 words in the title of the window Link to comment Share on other sites More sharing options...
Generator Posted June 16, 2007 Share Posted June 16, 2007 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 More sharing options...
edwarddd Posted June 16, 2007 Author Share Posted June 16, 2007 From the help file: Code: Opt("WinTitleMatchMode",2) You can just put M as the title and it will work. Thanks, worked. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now