Jump to content

Recommended Posts

Posted

$centerx=@DesktopWidth / 2
$centery=@DesktopHeight / 2

$CALx=0
$CALy=0
While 1
Local $pos = MouseGetPos()
If $pos[0] > $centerx Then
$CALx=$centerx-$pos[0]
ElseIf $pos[0] < $centerx Then
$CALx=$centerx+$pos[0]
EndIf
If $pos[1] > $centery Then
$CALy=$centery-$pos[1]
ElseIf $pos[1] < $centery Then
$CALy=$centery+$pos[1]
EndIf
ToolTip(_Angle($CALx,$CALy ))
WEnd

Func _Angle($X, $Y)

    Local $CX = $centerx, $CY = $centery

    If ($CX = $X) And ($CY = $Y) Then
        Return SetError(1, 0, -1)
    EndIf

    Local $Grad = ($Y <= $CY) * 180 - ATan(($CX - $X) / ($CY - $Y)) * 180 / 3.1415926535897932384626 + 90

    If $Grad = 360 Then
        $Grad = 0
    EndIf
    Return $Grad
EndFunc   ;==>_Angle

It sort of works but  doesn't.

can I get some help here?

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
  • Recently Browsing   0 members

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