Jump to content
Sign in to follow this  
Alexxander

while and pixel search idle

Recommended Posts

Alexxander

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 ?

 


Share this post


Link to post
Share on other sites
Danyfirex

AdlibRegister can help.

Saludos

  • Like 1

Share this post


Link to post
Share on other sites
Alexxander

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 ?


Share this post


Link to post
Share on other sites
Alexxander

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 ?


Share this post


Link to post
Share on other sites
Danyfirex

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

Share this post


Link to post
Share on other sites
FireFox

Hi,

What are you trying to do?

There may be more reliable ways to automate it.

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
JLogan3o13

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
  • Like 1

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
Alexxander

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 ?


Share this post


Link to post
Share on other sites
FireFox

You didn't tell us what is this for.

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

Edited by FireFox
  • Like 1

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
Alexxander

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 ?


Share this post


Link to post
Share on other sites
Bert

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.

Share this post


Link to post
Share on other sites
Alexxander

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


Share this post


Link to post
Share on other sites
FireFox

in hate forum

lol.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
Bert

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.

Share this post


Link to post
Share on other sites
Alexxander

lol.

i meant to say in this forum


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  

×