Sign in to follow this  
Followers 0
sd333221

Check Mouse Area

5 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
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

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  
Followers 0