Jump to content

Real Time!


Recommended Posts

Can anyone make the ToolTip move in circles? I know it's something with Sin and Cos... :whistle: .

TrayTip("Controls", "Press Pause to toggle Real Time on and off." & @LF & "Press Esc to shutdown the program.", 1)
$toggle = 1
HotKeySet("{PAUSE}", "pause")
HotKeySet("{ESC}", "stop")
While 1
If $toggle = 1 Then
    $time = @HOUR & ":" & @MIN & ":" & @SEC
    ToolTip($time, x(), y())
EndIf
Sleep(50)
WEnd
Func x()
    $sec = @SEC
    Select
    Case $sec >= 0 And $sec < 15
        $a = (@DesktopWidth / 2) + ($sec / 15) * (@DesktopWidth / 2)
    Case $sec >= 15 And $sec < 30
        $a = @DesktopWidth - (($sec - 15) / 15) * (@DesktopWidth / 2)
    Case $sec >= 30 And $sec < 45
        $a = (@DesktopWidth / 2) - (($sec - 30) / 15) * (@DesktopWidth / 2)
    Case $sec >= 45 And $sec < 60
        $a = (($sec - 45) / 15) * (@DesktopWidth / 2)
    EndSelect
    Return $a
EndFunc
Func y()
    $sec = @SEC
    Select
    Case $sec >= 0 And $sec < 15
        $a = (($sec) / 15) * (@DesktopHeight / 2)
    Case $sec >= 15 And $sec < 30
        $a = (@DesktopHeight / 2) + (($sec - 15) / 15) * (@DesktopHeight / 2)
    Case $sec >= 30 And $sec < 45
        $a = @DesktopHeight - (($sec - 30) / 15) * (@DesktopHeight / 2)
    Case $sec >= 45 And $sec < 60
        $a = (@DesktopHeight / 2) - (($sec - 45) / 15) * (@DesktopHeight / 2)
    EndSelect
    Return $a
EndFunc
;--------------------------------------------
Func pause()
    $toggle = -1 * $toggle
    If $toggle <> 1 Then
        ToolTip("")
    EndIf
EndFunc
Func stop()
    If $toggle <> 1 Then
        ToolTip("")
    EndIf
    TrayTip("Real Time!", "Made by Scriptkiddie", 1)
    Sleep(5000)
    Exit
EndFunc

Thanks guys - Scriptkiddie

[-"Scriptkiddie, nice to meet you!"-]

Link to comment
Share on other sites

; top of script
local const $PI = 3.14159265358979
local const $TOOLTIP_WIDTH = 50
local const $TOOLTIP_HEIGHT = 17

; change functions
func x()
    return (@desktopWidth - $TOOLTIP_WIDTH) * (sin($PI * @SEC / 30) + 1) / 2
endFunc
func y()
    return (@desktopHeight - $TOOLTIP_HEIGHT) * (1 - cos($PI * @SEC / 30)) / 2
endFunc

Link to comment
Share on other sites

; top of script
local const $PI = 3.14159265358979
local const $TOOLTIP_WIDTH = 50
local const $TOOLTIP_HEIGHT = 17

; change functions
func x()
    return (@desktopWidth - $TOOLTIP_WIDTH) * (sin($PI * @SEC / 30) + 1) / 2
endFunc
func y()
    return (@desktopHeight - $TOOLTIP_HEIGHT) * (1 - cos($PI * @SEC / 30)) / 2
endFunc

<{POST_SNAPBACK}>

:dance: Well, thanks :whistle:

Greets - Scriptkiddie

[-"Scriptkiddie, nice to meet you!"-]

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...