njp988 Posted December 21, 2008 Share Posted December 21, 2008 (edited) In this loop, I'm trying to get the mouse to click on a color that isnt white. In order to do this, I have the loop pick random coordinates inside a small rectangle. The problem is that it seems to just pick the first coordinate that it gets, and clicks on it. $f = 0 While $f = 0 $LowFL = 225 $HighFL = 250 $LowFR= 257 $HighFR = 286 $RandomNumber11 = Random($LowFL,$HighFL,1) ;Creates Variable That is a random number between 2 variables $RandomNumber12 = Random($LowFR,$HighFR,1) ;Creates Variable That is a random number between 2 variables $MP = PixelGetColor( $RandomNumber11, $RandomNumber12);;;;;here's where the program tries to find the monster If $MP <> 16777215 Then $f = 1;16777215 is the shade of white in the background. If the color isnt white, then f = 1 breaks this loop, and goes to the mouse click. If $MP = 14078934 Then $f = 0;this is the shade of black used as a border, which doesnt count if you click on it so I've excluded that too. If $MP = 16777215 Then $f = 0;the shade of white I dont want to click on. might be a little redundant WEnd mouseclick("`left", $RandomNumber11, $RandomNumber12) Edited December 21, 2008 by njp988 Link to comment Share on other sites More sharing options...
BrettF Posted December 21, 2008 Share Posted December 21, 2008 Pixel search for a white pixel? Then Don't click there... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
njp988 Posted December 21, 2008 Author Share Posted December 21, 2008 Pixel search for a white pixel? Then Don't click there... you mean something like this?If $MP <> 16777215 Then $f = 1;16777215 is the shade of white in the background. If the color isnt white, then f = 1 breaks this loop, and goes to the mouse click. Link to comment Share on other sites More sharing options...
njp988 Posted December 22, 2008 Author Share Posted December 22, 2008 can anyone help me? Link to comment Share on other sites More sharing options...
youknowwho4eva Posted December 22, 2008 Share Posted December 22, 2008 Look up the _colorgetblue green and red functions. When I made my barcode reading program I used those. For mine it was either black or white. So I believe I used red. I said if its below so much red then its white, if its above so much its black. Pushing the 24 hour bump limit aren't we? Giggity 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