Sign in to follow this  
Followers 0
h3nno

mouse position.

3 posts in this topic

I am trying to make a mouse macro type thing. that makes your mouse go spastic.

This is the code i have tried, there are several mistakes in it, but I'm not sure how to fix the.

Dim $pos = MouseGetPos()
Dim $pos2 

While 1
     Sleep(100)
     
WEnd

If  $Pos2 = NOT  $Pos Then
    MouseMove(10, 100)
    EndIf

What I am trying to do is get the mouse position and set it to $pos and then if the mouse position is not $pos move the mouse to (10, 100)

Thanks.

Share this post


Link to post
Share on other sites



$pos = MouseGetPos()

While 1

     $pos2 = MouseGetPos()
     If $pos[0]+$pos[1] <> $pos2[0]+$pos2[1] Then
          MouseMove(10,100)
     EndIf

WEnd

Share this post


Link to post
Share on other sites

$pos = MouseGetPos()

While 1

     $pos2 = MouseGetPos()
     If $pos[0]+$pos[1] <> $pos2[0]+$pos2[1] Then
          MouseMove(10,100)
     EndIf

WEnd

hey thanks that really helped!!

i just have one more question

$pos = MouseGetPos()

HotKeySet("{End}",  "Terminate")

While 1
    Do
     $pos2 = MouseGetPos()
     If $pos[0]+$pos[1] <> $pos2[0]+$pos2[1] Then
            $x = Random(0, 1000)
            $y = Random(0, 1000)
            MouseMove($x, $y)
    EndIf
    Until "Terminate"

WEnd

Func  Terminate()
    Exit 0
EndFunc

how would i do it randomly? how i have it now, once you move the mouse it continually jumps around the screen to random coords.

and what i want is it to only move when the user moves the mouse :) thanks

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