Sign in to follow this  
Followers 0
lava

MouseMove help

6 posts in this topic

#1 ·  Posted (edited)

Hi sorry for the extremely broad title, I wasn't sure what to call this. Basically what I'm trying to do is, move my cursor to a position (point A), click, move it right, and move to back to the original position. And this will be in a loop. So also I want to move my mouse to the right by 2 pixels every time it goes back to point A.

Maybe I'm just not seeing it right, because I'm sure the answer is very simple, but I'm stuck at getting the cursor to move 2 pixels everytime it goes back to point A, I'm good with the rest.

If it helps to understand, here's why I want this. Point A is a slider, I want to drag the slider to the right by two pixels everytime the mouse gets there. And I eventually want the slider to be ~30 pixels away from where it started.

For example, here will be my code.

func Start()
Global $mousepos = MouseGetPos()
  for $i = 1 to 20

MouseUp("Primary")
MouseMove(156,665,0) ;Here is where I need to move the mouse two pixels to the right.
MouseClick("Primary")
MouseMove($mousepos[0],$mousepos[1],0)
MouseClick("Primary")

   next
EndFunc

Func End()
   Exit
EndFunc

while 1
   WEnd

At first it seems like adding the x value by 2 would work, but that would just bring it to the point 158 everytime. Any help I can get is appreciated, thanks.

Edited by lava

Share this post


Link to post
Share on other sites



If it helps to understand, here's why I want this. Point A is a slider, I want to drag the slider to the right by two pixels everytime the mouse gets there. And I eventually want the slider to be ~30 pixels away from where it started.

 

Look at MouseClickDrag()

Share this post


Link to post
Share on other sites

Hi sorry for the extremely broad title, I wasn't sure what to call this. Basically what I'm trying to do is, move my cursor to a position (point A), click, move it right, and move to back to the original position. And this will be in a loop. So also I want to move my mouse to the right by 2 pixels every time it goes back to point A.

Maybe I'm just not seeing it right, because I'm sure the answer is very simple, but I'm stuck at getting the cursor to move 2 pixels everytime it goes back to point A, I'm good with the rest.

If it helps to understand, here's why I want this. Point A is a slider, I want to drag the slider to the right by two pixels everytime the mouse gets there. And I eventually want the slider to be ~30 pixels away from where it started.

For example, here will be my code.

func Start()
Global $mousepos = MouseGetPos()
  for $i = 1 to 20

MouseUp("Primary")
MouseMove(156,665,0) ;Here is where I need to move the mouse two pixels to the right.
MouseClick("Primary")
MouseMove($mousepos[0],$mousepos[1],0)
MouseClick("Primary")

   next
EndFunc

Func End()
   Exit
EndFunc

while 1
   WEnd

At first it seems like adding the x value by 2 would work, but that would just bring it to the point 158 everytime. Any help I can get is appreciated, thanks.

 

What are trying to automate? (name of application please)

Share this post


Link to post
Share on other sites

What are trying to automate? (name of application please)

Um it's my own program I created in flash, it doesn't have a name nor is it online, so not sure what to tell you. (It's not a game, if that's what you're reffering to).

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Look at MouseClickDrag()

This probably isn't as efficient as i'd like, this would drag one end to the other. I want it to drag it by ~2 pixels at a time so that the slider has a different (and higher) value everytime the loop finishes. Unless I'm not understanding correctly, this isn't what I want.

Edited by lava

Share this post


Link to post
Share on other sites

Okay nevermind guys, I found it out. Thanks for your input anyway. I just used a variable for the X position and added 2 to the variable at the end of each loop, so I can work it from there, 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