russell Posted July 8, 2011 Share Posted July 8, 2011 Im trying to do a countdown but cant figure it out, this is what i have so far. $secs = @sec While 1 $pingcheck = Ping ("192.168.1.8") ;media server If $pingcheck Then ToolTip ("Media Server is ready to go") Else ToolTip ("Currently the server is offline. I'll tell ya what ill do. In " & $sec & " seconds ill try agin", 0,0) WEnd im not really sure how to make is go down muppet hands are so soft :) Link to comment Share on other sites More sharing options...
pieeater Posted July 8, 2011 Share Posted July 8, 2011 (edited) 1. your missing endif at the end 2. after the endif you could put : sleep(100) $sec -= 1 not sure if this is what your asking, if not check out TimerInit() and TimerDiff() in the help file instead of using sleep. Edited July 8, 2011 by pieeater [spoiler]My UDFs: Login UDF[/spoiler] Link to comment Share on other sites More sharing options...
JoHanatCent Posted July 8, 2011 Share Posted July 8, 2011 Im trying to do a countdown but cant figure it out, this is what i have so far. $secs = @sec While 1 $pingcheck = Ping ("192.168.1.8") ;media server If $pingcheck Then ToolTip ("Media Server is ready to go") Else ToolTip ("Currently the server is offline. I'll tell ya what ill do. In " & $sec & " seconds ill try agin", 0,0) WEnd im not really sure how to make is go down You can try: $msecs = 15 * 1000 $Sec = $msecs / 1000 $pingcheck = 0 While $pingcheck = 0 If $Sec < 0 Then $pingcheck = Ping("192.168.1.8", 250) ;media server $Sec = $msecs / 1000 EndIf ToolTip("Currently the server is offline. I'll tell ya what ill do. In " & $Sec & " seconds ill try agin!", 0, 0) Sleep(750) $Sec -= 1 WEnd Link to comment Share on other sites More sharing options...
russell Posted July 8, 2011 Author Share Posted July 8, 2011 Thank you both, I ended up using JoHanatCent's and altered it a little so it wasn't hammering my server. But the was my fault because how i first wrote it. But thank you both. I felt stupid after i read it, kept thing....why didn't i know that lol muppet hands are so soft :) 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