lava Posted October 26, 2014 Share Posted October 26, 2014 (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 October 26, 2014 by lava Link to comment Share on other sites More sharing options...
Zedna Posted October 26, 2014 Share Posted October 26, 2014 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() Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Bert Posted October 27, 2014 Share Posted October 27, 2014 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) The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
lava Posted October 27, 2014 Author Share Posted October 27, 2014 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). Link to comment Share on other sites More sharing options...
lava Posted October 27, 2014 Author Share Posted October 27, 2014 (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 October 27, 2014 by lava Link to comment Share on other sites More sharing options...
lava Posted October 27, 2014 Author Share Posted October 27, 2014 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! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now