Jump to content
Sign in to follow this  
russell

Count down

Recommended Posts

russell

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 :)

Share this post


Link to post
Share on other sites
pieeater

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 by pieeater

[spoiler]My UDFs: Login UDF[/spoiler]

Share this post


Link to post
Share on other sites
JoHanatCent

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

Share this post


Link to post
Share on other sites
russell

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 :)

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  

×