Countdown-Timer

Der Countdown wird mit /cdsend [Sekunden] [Minuten] [Stunden] gestartet.

Beispiel: /cdsend 30 5

#NewScriptBegin SendCountDown
 
Dim EndTime
Dim MyFrontFrame
 
Sub Load()
  MakeShortcut "", "cdsend", "/call SendCountDown.StartCountDown $1 $2 $3"
End Sub
 
Sub StartCountDown(TimeS, TimeM, TimeH)
  StartTimer 1000, 1
  EndTime = Timer + Val(TimeS)+Val(TimeM)*60+Val(TimeH)*3600
  MyFrontFrame = FrontFrameID
  NextSend = EndTime
End Sub
 
Sub TimerEvent(TimerID)
  if EndTime-Timer < 0 Then
    StopTimer 1
    ShowInfo ""
    BeepString "2500/100"
  Else
    Minu = (EndTime-Timer) \ 60
    Seku = (EndTime-Timer) mod 60
    ShowInfo Format(Minu, "00") & ":" & Format(Seku, "00"), valcGreen, 0, 0, 32
    if (EndTime-Timer) mod 30 = 0 Then
      SendTime Minu, Seku
    else
      if (EndTime-Timer) mod 10 = 0 and Minu=0 Then
        SendTime Minu, Seku
      else
        if (EndTime-Timer) < 10 Then SendTime Minu, Seku     
      End if
    End if
  End if
End Sub
 
Sub SendTime(Minu, Seku)
  Send "Verbleibende Zeit: " & Format(Minu, "00") & ":" & Format(Seku, "00"), MyFrontFrame
End Sub

Eigene Werkzeuge