Jump to content

Recommended Posts

Posted

$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!!!

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

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
×
×
  • Create New...