# PixelGetColor - looping help maybe?

## Recommended Posts

i dont think i quite get this,

```;MyPixelLocation =(100, 100)
;MyRodLocationLeft =(40, 60)
;MyRodLocationRight =(60, 60)
\$MyPixelColor = hex(0xFFF1FF)
\$MyRodColor = hex(0xFF0FFF)
;!=   means "is not equal to" ?

While  PixelGetColor(100, 100) != \$MyPixelColor
Then;go back to while
else;?
if PixelGetColor(40, 60) = \$MyRodColor
then;press right
elseif PixelGetColor(60, 60) = \$MyRodColor
Then;press left
else;go back to first 'if statement'
EndIf @error```

any help or even a point in the right direction would help, thank you in advance.

Smithy963.

##### Share on other sites

```While 1
\$px = PixelGetColor(100, 100)
If \$px = \$MyPixelColor Then
If PixelGetColor(40, 60) = \$MyRodColor Then Send("{RIGHT}")
If PixelGetColor(60, 60) = \$MyRodColor Then Send("{LEFT}")
EndIf
WEnd```

# MY LOVE FOR YOU... IS LIKE A TRUCK- #

##### Share on other sites

so im reeling in a fish, my rod swings left, my program presses right, if my rod then swings right, it presses left?

##### Share on other sites

```While 1
\$px = PixelGetColor(100, 100)
If \$px <> \$MyPixelColor Then
If PixelGetColor(40, 60) = \$MyRodColor Then Send("{RIGHT}")
If PixelGetColor(60, 60) = \$MyRodColor Then Send("{LEFT}")
EndIf
WEnd
oÝ÷ Ú*ÞqÊ&zwZuØ§Ø^½ªâi¹^±«­¢+Ø(ÀÌØíI½a0ôÐÀ(ÀÌØíI½aHôØÀ(ÀÌØíI½dôØÀ(ÀÌØíI½MÑÉÑ`ôÄÀÀ(ÀÌØíI½MÑÉÑdôÄÀÀ((íÑ¡½Ñ¡¸½µÌè)]¡¥±Ä(ÀÌØíÁàôA¥á±Ñ
½±½È ÀÌØíI½MÑÉÑ`°ÀÌØíI½MÑÉÑd¤(%ÀÌØíÁà±ÐìÐìÀÌØí5åA¥á±
½±½ÈQ¡¸(%A¥á±Ñ
½±½È ÀÌØíI½a0°ÀÌØíI½d¤ôÀÌØí5åI½
½±½ÈQ¡¸M¹ ÅÕ½ÐííI%!QôÅÕ½Ðì¤(%A¥á±Ñ
½±½È ÀÌØíI½aH°ÀÌØíI½d¤ôÀÌØí5åI½
½±½ÈQ¡¸M¹ ÅÕ½Ðíí1QôÅÕ½Ðì¤(¹%)]¹(```

note: the variables make it easy for you to edit your script should the locations change.

Also, the other poster forgot the '<>(not equal to)' and just used the '=(equal to)' operator.

Lastly, any noobies who ever need help with a problem, please use this post as an example... So many times I've seen people write things like, "i dont know how to do this, help me!", with no script and no explanation of the problem. The OP here provided a well documented attempt and althought he is not particularly familiar with the language, it becomes really easy to help him.

Edited by ame1011

[font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font]

## Create an account

Register a new account

×

• Wiki

• Back

• #### Beta

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