ForsakenGod Posted November 17, 2009 Share Posted November 17, 2009 (edited) Well i am working in autoit second day so far and i ve tried everythink i know searched Google and didnt found anythink about this .I want to make the code to sleep after it has been done 2 times and untill the other color apears but when i do sleep() than the whole script does not look for color what i dont want i ve ;;showed the place where it should sleep with pixelsearch still active expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.0.0 Author: Unreal #ce ---------------------------------------------------------------------------- HotKeySet("{F3}", "StartProg") HotKeySet("{F4}", "ExitProg") While 1 Sleep(100) Wend Func StartProg() WinActivate("GBP/USD, 5-Minute, Bid") FirstCheck() EndFunc Func FirstCheck() PixelSearch(1471 ,22 ,1479 ,514 ,0xFFFF00) If @error = 0 Then WinActivate("Bez názvu – Poznámkový blok") Send(" Najdena Zlta ") WinActivate("GBP/USD, 5-Minute, Bid") Sleep(6000) $myColor = PixelSearch(1471 ,22 ,1479 ,514 ,0xFFFF00) If @error = 0 Then MouseClick("left",102,55,1,0) ;; After this has been 2 times it shouldnt execute anymore till the second color appears WinActivate("Bez názvu – Poznámkový blok") ;; After this has been 2 times it shouldnt execute anymore till the second color appears Send(" Potvrdene ");; After this has been 2 times it shouldnt execute anymore till the second color appears EndIf while($myColor = 0xFFFF00) $myColor = PixelSearch(1471 ,22 ,1479 ,514 ,0xFFFF00) WEnd Else SecondCheck() EndFunc Func SecondCheck() PixelSearch(1471 ,22 ,1479 ,514 ,0x8000FF) If @error = 0 Then WinActivate("Bez názvu – Poznámkový blok") Send(" Najdena Fialova ") WinActivate("GBP/USD, 5-Minute, Bid") Sleep(6000) $myColor2 = PixelSearch(1471 ,22 ,1479 ,514 ,0x8000FF) If @error = 0 Then MouseClick("left",23,59,1,0) WinActivate("Bez názvu – Poznámkový blok") Send(" Potvrdene ") EndIf EndIf EndFunc Func ExitProg() Exit 0 EndFunc Is there some way to do "balance" ? so when i reach some time of count some part of function disables untill i dont want it to stop being disabled ? Thank you Edited November 17, 2009 by ForsakenGod Link to comment Share on other sites More sharing options...
Info Posted November 17, 2009 Share Posted November 17, 2009 While PixelSearch(parameters) = @error Sleep(1000) ;will look for your pixel every one second WEnd Link to comment Share on other sites More sharing options...
ForsakenGod Posted November 17, 2009 Author Share Posted November 17, 2009 While PixelSearch(parameters) = @error Sleep(1000) ;will look for your pixel every one second WEnd Thanks but actually as i sayd i need it to just do 1 operation 2 times after finding a color and till the color presists dont do anythink but really anythink just look for second color Any ideas? Link to comment Share on other sites More sharing options...
mikjay Posted November 17, 2009 Share Posted November 17, 2009 If you just want the loop to end and do the second check after a period of time you could use Adlibenable(<time>) before the loop. Link to comment Share on other sites More sharing options...
ForsakenGod Posted November 18, 2009 Author Share Posted November 18, 2009 Well thanks Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now