mithandir1 Posted May 27, 2008 Share Posted May 27, 2008 (edited) What I am doing is checking for white text on the character select screen after I login to a game. This is the only constant color on this particular screen. This works perfectly as a timer for load time variation. The problem is sometimes I get a server full try again message. So my script is searching for a color in an infinite loop. All the while the game is waiting for relog. How can I make this loop timeout after 30 seconds? func chardetect() do sleep (10) PixelSearch( 671, 71, 736, 137, 0xfefefe, 10);search for white on char screen $err2 = @error until $err2 < 1 ToolTip("Login Succesful", 0, 0) endfunc Edited May 27, 2008 by mithandir1 Link to comment Share on other sites More sharing options...
sandin Posted May 27, 2008 Share Posted May 27, 2008 (edited) func chardetect() Local $login = True Local $time = 30 ;sec $timer = TimerInit() do sleep (10) PixelSearch( 671, 71, 736, 137, 0xfefefe, 10);search for white on char screen $err2 = @error if TimerDiff($timer) >= $time*1000 Then $login = False ExitLoop EndIf until $err2 < 1 if $login = True Then ToolTip("Login Succesful", 0, 0, "GameName bot:", 1) Else ToolTip("Character wasn't detected within 30 sec.", 0, 0, "GameName bot:", 3) EndIf endfunc Edited May 27, 2008 by sandin Some cool glass and image menu | WinLIRC remote controler | Happy Holidays to all... | Bounce the sun, a game in which you must save the sun from falling by bouncing it back into the sky | Hook Leadtek WinFast TV Card Remote Control Msges | GDI+ sliding toolbar | MIDI Keyboard (early alpha stage, with lots of bugs to fix) | Alt+Tab replacement | CPU Benchmark with pretty GUI | Ini Editor - Edit/Create your ini files with great ease | Window Manager (take total control of your windows) Pretty GUI! | Pop-Up window from a button | Box slider for toolbar | Display sound volume on desktop | Switch hotkeys with mouse scroll Link to comment Share on other sites More sharing options...
mithandir1 Posted May 30, 2008 Author Share Posted May 30, 2008 this works perfectly. I also want to thank you for pointing out the tool tip options. 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