Engineer Posted August 27, 2011 Share Posted August 27, 2011 $pixle2 = PixelSearch(309, 145, 347, 181, 0xDB5357) WinActivate("full screen") sleep(500) If $pixle2 Then MsgBox(1, "go", "go", 4) EndIf I'm pulling my hair out trying to figure out what I'm doing wrong with a simple if statment. it activates the paint window fine, but then just stops. tell me what it is before I take my louieville slugger to this comp!!! Link to comment Share on other sites More sharing options...
Realm Posted August 27, 2011 Share Posted August 27, 2011 (edited) Hello Engineer, Pixelsearch returns an array...so your statement If @pixle2 then will not do what you expect It will set an error to 1 if color is not found. Try this WinActivate("full screen") sleep(500) $pixle2 = PixelSearch(309, 145, 347, 181, 0xDB5357) If not @error Then MsgBox(1, "go", "go", 4) EndIf This will skip what you need to do if it does not find the color. Edit: Fixed code so that it better represents what I think your attempting to do. Edited August 27, 2011 by Realm My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. 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