Jump to content
Sign in to follow this  
datkewlguy

Mouse Position Stuff

Recommended Posts

datkewlguy

hey just wondering, how could i write a script that would get the mouse position and move it slightly in one direction specified? Not to a new set position just higher lower or left and right... Also, anyway to set up the hotkeys so that the left key would move the mouse left, right right etc...

Share this post


Link to post
Share on other sites
this-is-me

MouseGetPos and MouseMove...


Who else would I be?

Share this post


Link to post
Share on other sites
datkewlguy

i know but thats only good for moving to one spot, i just wanna move the mouse in a direction not knowing exactly where to.

Share this post


Link to post
Share on other sites
this-is-me

Missing something?

;move right
$pos = MouseGetPos()
MouseMove($pos[0]+1,$pos[1])

Who else would I be?

Share this post


Link to post
Share on other sites
trids

I would do something like this ..

  • set $nXoffset to +1 or -1 depending on which arrow key is pressed (left or right).
  • set $nYoffset to +1 or -1 depending on which arrow key is pressed (up or down).
  • After setting the offsets, call a UDF that applies both offsets with a MouseMove.
  • The UDF should also set both offsets to 0 before it returns.
HTH :idiot:

Edit: spelling etc.

Edited by trids

Share this post


Link to post
Share on other sites
datkewlguy

hey thx, but now im setting the diagnal motions (northeast, northwest, southeast, southwest), how do i do that? if

Func s()

$pos = MouseGetPos()

MouseMove($pos[0], $pos[1] + $sp, 1)

EndFunc

is down, then how do i do diagnals?

Share this post


Link to post
Share on other sites
datkewlguy

uh that mean no one knows or its impossible? i gotta find out how to set the mouse to move into a diagnal position...

Share this post


Link to post
Share on other sites
Valik

You're going to feel like such an idiot when you realize the answer to this...

What happens when the mouse moves, say, south-west? What directions does it move in?

Share this post


Link to post
Share on other sites
datkewlguy

gah i am an idiot yes, ive been doing this for a couple days now, but i see what you're saying ( i think ) and it didnt work, can you give me a code?

Share this post


Link to post
Share on other sites
layer

.... just use corrdinates... like this...

MouseMove (0, 0)
MouseMove (525, 400)

now you feel the idiot in yourslef coming in? :idiot: jk


FootbaG

Share this post


Link to post
Share on other sites
datkewlguy

no no no, it cant be coordinates, i have the system down, basically i thought you just do + the variable from right and up to make northeast, but that makes southwest, im trying to be able to control the moues with arrow keys and everything works except diagnals. no its not even so much about having them i just want them so i dont feel so stupid lol.

Share this post


Link to post
Share on other sites
this-is-me

Try minus.

This should help:

| y
    |
    |
--------- x
    |
    |
    |
Edited by this-is-me

Who else would I be?

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  

×