Jump to content

Check Mouse Area


Recommended Posts

Hi guys,

i planned to redesign my program,

to give error if the X coodinate (vertical) changes more than 30, after the function is called

this is how far i got:

Func roflcopter()
    $mpos = MouseGetPos ( )
    while 1
        $finalpos = $mpos
        $finalpos[0] = $finalpos[0] + 30
        if $mpos[0] = $finalpos[0] Then
            MSGBOX(0, "Alert", "MOUSE MOVED TOO FAR!")
        EndIf
        sleep(100)
    WEnd
    return(1)
    Sleep(2000)
EndFunc

it doesn't even seem to work...

Any ideas for this?

Thank you mates!

Edited by sd333221
Link to comment
Share on other sites

Hi,

what about?

HotKeySet("1", "roflcopter")
While 1
    Sleep(100)
WEnd

Func roflcopter()
    Local $mpos = MouseGetPos()
    While 1
        $finalpos = MouseGetPos()
        ToolTip("Border : " & $mpos[0] + 30 & @CRLF & "Position : " & $finalpos[0])
        If $finalpos[0] >= $mpos[0] + 30 Then
            MsgBox(0, "Alert", "MOUSE MOVED TOO FAR!")
        EndIf
        Sleep(100)
    WEnd
    return (1)
    Sleep(2000)
EndFunc   ;==>roflcopter

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

maybe

roflcopter()

Func roflcopter()
    Local $mpos = MouseGetPos ( )
    Local $finalpos[1] 
    while 1
        $finalpos[0] = $mpos[0] + 30
        Local $mpos2 = MouseGetPos ( )
        if $mpos2[0] >= $finalpos[0] Then
            MSGBOX(0, "Alert", "MOUSE MOVED TOO FAR!")
            Exitloop ; ??????
        EndIf
        sleep(100)
    WEnd
    return(1)
    Sleep(2000)
EndFunc

EDIT: .... i like Mega's better

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

Hi,

what about?

HotKeySet("1", "roflcopter")
While 1
    Sleep(100)
WEnd

Func roflcopter()
    Local $mpos = MouseGetPos()
    While 1
        $finalpos = MouseGetPos()
        ToolTip("Border : " & $mpos[0] + 30 & @CRLF & "Position : " & $finalpos[0])
        If $finalpos[0] >= $mpos[0] + 30 Then
            MsgBox(0, "Alert", "MOUSE MOVED TOO FAR!")
        EndIf
        Sleep(100)
    WEnd
    return (1)
    Sleep(2000)
EndFunc   ;==>roflcopter

So long,

Mega

I love you :P
Link to comment
Share on other sites

I love you :P

Wow, thanks! :">

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

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...