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

##### Share on other sites

ok

i made it work by myself

it should be if \$pixel1=\$pixel2=...... then endif

##### Share on other sites

Maybe try this way

```\$X = StringSplit("22,44,15,27,55,33", ",")

\$Y = StringSplit("22,44,15,27,55,33", ",")

\$match = ""

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

If \$match = \$X[0] Then
; do this
; because they all match that color
EndIf```

8)

Edited by Valuater

##### Share on other sites

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?

Live for the present,
Dream of the future,
Learn from the past.

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

##### Share on other sites

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 ?

Live for the present,
Dream of the future,
Learn from the past.

##### Share on other sites

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

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

will fix

thx

8)

Edited by Valuater

##### Share on other sites

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

will fix

thx

8)

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

Live for the present,
Dream of the future,
Learn from the past.

## Create an account

Register a new account

×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...