Jump to content

short question about "and"


Recommended Posts

how i use the function "and" in

if ($pixel1 = 0x44943) and

$pixel2 = 0x44943 and

$pixel3 = 0x44943 and

$pixel4 = 0x44943 and

($pixel1b = 0x44943) and

($pixel2b = 0x44943) and

($pixel3b = 0x44943) and

($pixel4b = 0x44943) and

($pixel1c = 0x44943) and

($pixel2c = 0x44943) and

($pixel3c = 0x44943) and

($pixel4c = 0x44943) and

($pixel1d = 0x44943) and

($pixel2d = 0x44943) and

($pixel3d = 0x44943) and

($pixel4d = 0x44943)

then

when i compile i get this

if ($pixel1 = 0x44943) and

????????????????????????????????????????????????????????????????????????

and i want to know if i used correct if....then :)

Edited by AlexStoian
Link to comment
Share on other sites

  • Developers

For $i = 1 To $X[0]

If PixelGetColor($X[$i], $Y[$i]) = 0x44943 Then $match = $i

Next

Shouldn't that be changed to:

If PixelGetColor($X[$i], $Y[$i]) = 0x44943 Then $match +=1

To count the number of matches?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Shouldn't that be changed to:

If PixelGetColor($X[$i], $Y[$i]) = 0x44943 Then $match +=1

To count the number of matches?

I did notice that when I wrote it, however he was using "and" throughout his OP, I figured if $match = $i then he would have goten all the colors correct, however if he wanted to check how many were a match your way would be better. Then there is the other thought of knowing the actual number of "whitch ones" did match...

I was just to lazy to go that far... :)

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

  • Developers

I did notice that when I wrote it, however he was using "and" throughout his OP, I figured if $match = $i then he would have gootn all the colors correct, however if he wanted to check how many were a match your way would be better. The there is the other tought of knowing the actual numbner of "witch ones" did match...

I was just to lazy to go that far... :)

8)

... but the current way is wrong since the final test will always be true when the Last PixelGetColor() is true ... right ?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

Yes, you're right!... didn't see that :(

will fix

thx

8)

Sometimes its the simple things that go wrong ... just makes us human. :)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...