Sign in to follow this  
Followers 0
G4ORCE

Pixel Seach

16 posts in this topic

Hi, i'm Chris now ive got a script that works perfect but when it gets up the the pixel search part it does not find it straight away i need it to keep searching

$coord = PixelSearch( 433, 823, 1243, 834, 0xC7FEFF, 11 )

If Not @error Then



MouseDown("left")
SLEEP(5000)
MouseUp("left")
for an amount of time.

now i need it to keep searching till it finds it

Share this post


Link to post
Share on other sites



Have you looked at Loops in the Autoit help file ?

Share this post


Link to post
Share on other sites

yee ive looked but still cant seem to find out how to make it keep looking for the colour?

Share this post


Link to post
Share on other sites

You mean after you found the first one.. you want to continue looking for the second one?

Share this post


Link to post
Share on other sites

no i want it to keep trying to find the first one till it finds it?

Share this post


Link to post
Share on other sites

How to loop:

While 1
;Code to repeat here
WEnd

Share this post


Link to post
Share on other sites

ok thanks mate could u help me out were to place that imm just new at autoit.

$coord = PixelSearch( 0, 0, 1243, 834, 0xC7FEFF, 11 )

If Not @error Then
   


MouseDown("left")
SLEEP(5000)
MouseUp("left")












Mousemove(882, 490, 5000)
sleep(100)

MouseUp("left")
Mousedown("left")





; Reaction Time
sleep(5700)



MouseDown("left")
Send("{UP}")
MouseUp("left")

Mousedown("left")

    
    
Else
        $coord = PixelSearch( 433, 823, 1243, 834, 0xC7FEFF, 10 )
     If Not @error Then

MouseDown("left")
SLEEP(5000)
MouseUp("left")


    
EndIf










endif

thanks mate chirss.

Share this post


Link to post
Share on other sites

IF NewToAutoIt() Then FileRead(@AutoItDir & '\AutoIt Help File.chm')

Share this post


Link to post
Share on other sites

lol man imm bad wif help files could u put the

While 1

;Code to repeat here

WEnd

and ill ad the code in the code to repeat here pleasee.

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

ive done that doesent work mate, it dose look ther but i need it to keep looking cause it takes awhile till that colour pops up in that postion. it is a amber light, while its rollinng the light is grey and it trys to find it but i need it to keep looking cause the car gets to the amber in like 5 seconds then it goes yellow i want it to stop when the yellow goes on.

Edited by G4ORCE

Share this post


Link to post
Share on other sites

what the hole code?

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

I will not help those who have trouble doing simple tasks and who do not seem willing to try help themselves.

If you cannot do something as simple as posting your code, find a new hobby.

Cheers,

Brett

Edited by BrettF

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

lol BrettF, you did ask.

G4ORCE

I think BrettF may hve meant to post the part of your code where you have tried to use loops to seach for your pixel.

You said you tried it but it did not work ?

The way it works here is that you try to learn how to do something

and if you are having problems with your new code, post it and someone may be able to help with what you have done wrong.

Its a good method and gets those who try, help, quicker than those who just want someone to write code for them.

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

All of this is extremely simple, and you could find 100 of tutorials and previous posts if you would just search a little before posting a new topic.

Mommy ain't gonna help ya if she knows you aren't learning anything

Edited by Tyranlol

[u]Only by Attempting the Impossible You Can Earn the Remarkable[/u]

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