Jump to content

Move Mouse


Recommended Posts

Hello :P

I am writing a script to place down nodes for an application I'm running. I plan to map a square with the nodes which are placed and they need to start where the cursor is already.

HotKeySet("{F6}", "_support")
HotKeySet("{ESC}", "Terminate")

While 1
    Sleep(100)
WEnd

Func _support()
    
    MouseClick("left")
    MouseClick("left", +100)
EndFunc


Func Terminate()
    Exit 0
EndFunc

I am trying to get the mousemove function to move the mouse 100 pixels from it's current position. Is this possible?

Posted Image

Regards,

-Matt.

Edited by Googler24022
Link to comment
Share on other sites

For a start, look up MouseGetPos in the help file. You can then use those numbers to move the mouse to the new position.

[font="Verdana"]People who say it cannot be done should not interrupt those who are doing it. - George Benard Shaw[/font]

Link to comment
Share on other sites

I am trying to get the mousemove function to move the mouse 100 pixels from it's current position. Is this possible?

MouseGetPos() and then MouseMove()

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

MouseGetPos() and then MouseMove()

Cheers

Kurt

your func support should go like this

Func _support()

$position = mousegetpos()

$x = $position[0] + 100

$y = $position[1] + 100

;sorry buti kinda forgot the syntax of mouse click i mean the way they are put, i know that you have to specify x and y and what button to click and times and speed , but there i pretty much did almost everything for you just put that together

endfunc

MouseClick()

EndFunc

Link to comment
Share on other sites

HotKeySet("{HOME}", "MoveMouse");Sets the hotkey to "movemouse" function

While 1
    Sleep(1000);Waits for Hotkey to be pressed
WEnd

Func MoveMouse();WHat happens when Hotkey is presed
    $Pos = MouseGetPos() ;Gets current possition of mouse
    Mousemove($pos[0], $pos[1]-100); moves the mouse 100 pixels up from current location
EndFunc

If you want it to click, you can substitute mousemove for mouseclick

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