Jump to content

Recommended Posts

Posted

$var = PixelGetColor(320,67)
$var2 = PixelGetColor(781,178)


If $var = 13552384 And $var2 Not 16718362 Then
Send ("1")
Sleep(1700)
EndIf

It keeps saying:

If $var = 13552384 And $var2 Not 16718362 Then
If ^ ERROR

Error in expression

All I'm trying to do is If PixelGetColor(320,67) is 13552384 AND PixelGetColor(781,178) does not equal 16718362 Then send bla bla bla

Posted (edited)

Change Not to <>.

$var = PixelGetColor(320,67)
$var2 = PixelGetColor(781,178)


If (($var = 13552384) And ($var2 <> 16718362)) Then
Send ("1")
Sleep(1700)
EndIf
Edited by Airwolf
Certifications: A+, Network+, Security+, Linux+, LPIC-1, MCSA | Languages: AutoIt, C, SQL, .NETBooks: AutoIt v3: Your Quick Guide - $7.99 - O'Reilly Media - September 2007-------->[u]AutoIt v3 Development - newbie to g33k[/u] - Coming Soon - Fate Publishing - Spring 2013UDF Libraries: SkypeCOM UDF Library | ADUC Computers OU Cleanup | Find PixelChecksumExamples: Skype COM Examples - Skype4COMLib Examples converted from VBS to AutoIt
Posted

can really just do this

$var = PixelGetColor(320,67)
$var2 = PixelGetColor(781,178)


If $var = 13552384 And $var2 <> 16718362 Then
Send ("1")
Sleep(1700)
EndIf
The parenthesis are a bit arbitrary, but there are hundreds of ways you could write the statement to produce the same result. I just got into the habit of encapsulating statements, because if you use Not, then the parenthesis are very important. For example:

$var = 1
$var2 = 2

; You will see Yup
If $var = 1 And Not ($var2 = 1) Then
    MsgBox(0,"","Yup")
Else
    MsgBox(0,"","Nope")
EndIf

; You will see Nope
If $var = 1 And Not $var2 = 1 Then
    MsgBox(0,"","Yup")
Else
    MsgBox(0,"","Nope")
EndIf
Certifications: A+, Network+, Security+, Linux+, LPIC-1, MCSA | Languages: AutoIt, C, SQL, .NETBooks: AutoIt v3: Your Quick Guide - $7.99 - O'Reilly Media - September 2007-------->[u]AutoIt v3 Development - newbie to g33k[/u] - Coming Soon - Fate Publishing - Spring 2013UDF Libraries: SkypeCOM UDF Library | ADUC Computers OU Cleanup | Find PixelChecksumExamples: Skype COM Examples - Skype4COMLib Examples converted from VBS to AutoIt

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