Sniperwolf Posted August 17, 2007 Share Posted August 17, 2007 Hi guys! I have come across another problem, well for me it is atleast cause I dont know how to write it in code. I post the code I tried but didnt work then maybe you can get an Idea of what I am after here. $timer=30 Do PixelSearch(723,77,723,77,0,3) $timer=$timer-1 sleep(1000) Until @error Or Until $timer=0 I think you can easily se what I am after, I want it to check that spot over and over again, if it gets any other color than black I want it to stop looping this. Or if it has past 30 seconds I want it to stop aswell. But I know I cant write it like I did but how should I write it then? Link to comment Share on other sites More sharing options...
Monamo Posted August 17, 2007 Share Posted August 17, 2007 Hi guys! I have come across another problem, well for me it is atleast cause I dont know how to write it in code. I post the code I tried but didnt work then maybe you can get an Idea of what I am after here. $timer=30 Do PixelSearch(723,77,723,77,0,3) $timer=$timer-1 sleep(1000) Until @error Or Until $timer=0oÝ÷ Øay2¢ç欬{Z´¦iû^¬Ø¶!yÉ-«l¦h½êÚÚ/z¶ j)â~+`zÛ*-êÜ¢Z+¶§nVض-¢h¢§Øb°êâ~+ajÊZ²Ýô±ç(ÛÁ©íÛh²Ú)jÌPn´'£j{p®+^ÙbâÖî¶0².Ò0®+^Ûazêº^>,¹r²¶§X¤zØb±«¢+ØÀÌØíÑ¥µÈôÌÀ)¼($ÀÌØí½±½ÉÑÉÈôA¥á±MÉ ÜÈÌ°ÜÜ°ÜÈÌ°ÜÜ°À°Ì¤($ÀÌØíÑ¥µÈôÀÌØíÑ¥µÈ´Ä(%M±À ÄÀÀÀ¤(%%ÀÌØí½±½ÉÑÉÈôÄQ¡¸($%5Í ½à À°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½Ðí ½±½È¡¹ÑÑÅÕ½Ðì¤($%á¥Ð(%¹%()U¹Ñ¥°ÀÌØíÑ¥µÈôÀ()5Í ½à À°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½ÐíQ¥µÈáÁ¥ÉÅÕ½Ðì¤ - MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup] Link to comment Share on other sites More sharing options...
Sniperwolf Posted August 17, 2007 Author Share Posted August 17, 2007 Do $colortracker = PixelSearch(723, 77, 723, 77, 0, 3) $timer = $timer - 1 Sleep(1000) If $colortracker = 1 Then $timer=0 EndIf Until $timer = 0 Thanks mate! Works fine. Link to comment Share on other sites More sharing options...
weaponx Posted August 17, 2007 Share Posted August 17, 2007 You could use an actual timer: $STAMP = TimerInit() $colortracker = 0 Do $colortracker = PixelSearch(723, 77, 723, 77, 0, 3) MsgBox(0,"",Int(TimerDiff ($STAMP) / 1000)) Until $colortracker OR Int(TimerDiff ($STAMP) / 1000) >= 30 Link to comment Share on other sites More sharing options...
meekaah Posted August 28, 2007 Share Posted August 28, 2007 (edited) You could use an actual timer: $STAMP = TimerInit() $colortracker = 0 Do $colortracker = PixelSearch(723, 77, 723, 77, 0, 3) MsgBox(0,"",Int(TimerDiff ($STAMP) / 1000)) Until $colortracker OR Int(TimerDiff ($STAMP) / 1000) >= 30 Yes but is it possible to know if it goes on with the rest of the script because it found what it wanted, or because the timer ended? So that if the timer ended put a msgbox for timeout.. i cant find a way Edited August 28, 2007 by meekaah Link to comment Share on other sites More sharing options...
meekaah Posted August 28, 2007 Share Posted August 28, 2007 Oh nevermind i doded something that worked fine for what i wanted, thanx anyays 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