Jump to content

Recommended Posts

Posted

hi

 

i have this

while 1
    If PixelSearch(340,60,360,300,4558577) <> 0 Then pix()
        If PixelSearch(340,60,360,300,4558577) = 0 Then home()
wend

i want it to do pixel search if it is bigger than 0 do func pic

if pixel search = 0 for 10 seconds do func home and keep running the while loop

ho can i do this without using sleep ? the pixel search must never stop for any second 

but when their is no pixel found for 10 seconds it do home function and keep searching for that pixel

any ideas ?

 

Posted

TimerInit()

TimerDiff()

Both are in the help file with good examples.

 

thanks for replay bro

if i placed this in the while loop it will make a new timer in every second that pixel search = 0 or it will reset the time each time it equals 0 ?

i want it to keep running the timer untill the search result <> 0 

got the idea ?

Posted

AdlibRegister can help.

Saludos

i was not able to do it 

in the help example they used it to count how many times that finction is excuted 

how can i use it to check id no pixles found for 10 seconds ?

Posted (edited)

Maybe this way.

Local $hTimer = 0
Local $iDiff =0
local $iTotal=0
while True
$hTimer=TimerInit() 
sleep(10)
$iTotal+=TimerDiff($hTimer) 
If PixelSearch(340,60,360,300,4558577) <> 0 Then pix()
if $iTotal>=3000 Then
PixelSearch(340,60,360,300,4558577) = 0 Then home()
$iTotal=0
EndIf
WEnd

I cant run it cuz I don't have autoit right now.

Saludos

Edited by Danyfirex
  • Moderators
Posted (edited)

It would also make it much easier for those who are trying to help, if you didn't have 10 lines of empty space between each sentence. It is difficult enough trying to assist with what little information you are giving, without having to scroll through the unnecessary whitespace.

Edit: It is good to see you are moving away from the completely unnecessary bulletin board that was your previous signature, to a smaller bulletin board, though. Thanks for that ;)

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Posted

thanks for replay guys i'm now trying your sujesstions

another thing is can i make pixel search for 4 pixels ?

i mean somthing like this

If PixelSearch(340,60,360,300,4558577) > 4 Then pix()

so it works only when it find 4 pixels with this color 4558577 withoin the rectangle

any ideas ?

Posted

You didn't tell us what is this for.

Btw, please use autoit code tags to post your code :)

in prif 

the camera motion detection is in the blue color 

im using "yawcam"

and im scanning the view region to know the direction of that moment through pixel search for blue "4558577"

i know it is a stupid way to do this but it is easy and i made it from scratch 

somtimes thier is a camera glitsh so it view random blue pixles wich make troubles to me

so i want to make it search for at least 4 pixles 

any ideas ?

Posted

It would be great if you removed the joker pick from you signature and not use a pic at all please.

Second, what is prif? I did a Google search and I found a reference to games. Seeing you do not speak English as your first language if you would be so kind and please just post in your native language and we can translate what you need. That may make things easier.

Posted

It would be great if you removed the joker pick from you signature and not use a pic at all please.

Second, what is prif? I did a Google search and I found a reference to games. Seeing you do not speak English as your first language if you would be so kind and please just post in your native language and we can translate what you need. That may make things easier.

common guys whats wrong with the joker pic why u hate it in hate forum

Posted

Not to steer it off topic - For folks on slower connections lots of pictures makes it longer to load the page. That was one of the reasons why animated gifs are no longer allowed for avatars. Second - in the past some folks also like to have their responses designed so that all you see is their post on the page (in many cases you have one sentence by the poster that is the actual message and lots of background noise such as lots of white space and pictures) even when you have a large monitor. For folks on slow connections and small screens such as a smart phone this is annoying.

---------------------------

Anyway, back on topic - If the poster could post his request in his native language that would be great.

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
  • Recently Browsing   0 members

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