Pyrex Posted June 11, 2008 Share Posted June 11, 2008 $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 Link to comment Share on other sites More sharing options...
Airwolf Posted June 11, 2008 Share Posted June 11, 2008 (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 June 11, 2008 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 Link to comment Share on other sites More sharing options...
Pyrex Posted June 11, 2008 Author Share Posted June 11, 2008 That works, thank you Link to comment Share on other sites More sharing options...
Tomb Posted June 11, 2008 Share Posted June 11, 2008 Change Not to <>. $var = PixelGetColor(320,67) $var2 = PixelGetColor(781,178) If (($var = 13552384) And ($var2 <> 16718362)) Then Send ("1") Sleep(1700) EndIf 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 Link to comment Share on other sites More sharing options...
Airwolf Posted June 11, 2008 Share Posted June 11, 2008 can really just do this $var = PixelGetColor(320,67) $var2 = PixelGetColor(781,178) If $var = 13552384 And $var2 <> 16718362 Then Send ("1") Sleep(1700) EndIfThe 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 Link to comment Share on other sites More sharing options...
Tomb Posted June 12, 2008 Share Posted June 12, 2008 don't really care, just telling the thread starter that he/she doesn't need to use them. 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