Sign in to follow this  
Followers 0
Smithy963

PixelGetColor - looping help maybe?

4 posts in this topic

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 this post


Link to post
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 this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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]

Share this post


Link to post
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
Sign in to follow this  
Followers 0