yoloswag Posted December 17, 2013 Share Posted December 17, 2013 hey guys. i need to create a very simple script, but after reading tutorials and trying for hours i can't figure this stuff out. i'm sure to anyone who knows a bit about autoit, it will be a 5 minute walk in the park. basically i need a script that when ran, does the following upon me pressing the "R" key: detect current mouse position, and store it in a variable move the mouse pointer to coordinates (364,49) perform a left click and move the mouse back to the stored position that's it. i would be infinitely grateful! thanks in advance for any help, or maybe even the bit of code needed. much love <3 Link to comment Share on other sites More sharing options...
markyrocks Posted December 17, 2013 Share Posted December 17, 2013 What's this for? Spoiler "I Believe array math to be potentially fatal, I may be dying from array math poisoning" Link to comment Share on other sites More sharing options...
gruntydatsun Posted December 17, 2013 Share Posted December 17, 2013 I had a good laugh at your username yoloswag (you had to know that username would be available) Have a look in the Help file under Mouse Management. Have a go and post your code if it goes wrong. Good luck Link to comment Share on other sites More sharing options...
Kidney Posted December 17, 2013 Share Posted December 17, 2013 HotKeySet("r", "Start") While 1 SLeep(100) WEnd Func Start() $aMousePos = MouseGetPos() MouseClick("Left", 364, 49, 1, 0) MouseMove($aMousePos[0], $aMousePos[1]) EndFunc Link to comment Share on other sites More sharing options...
yoloswag Posted December 17, 2013 Author Share Posted December 17, 2013 i'm a professional concept artist and needed a photoshop plugin to press a single button (that sadly cant be asigned to any key) that has an important feature for my workflow. i failed in my attempts to learn to code photoshop plugins and was awared on autoit! thank you so much! works like a charm wish all ya'll the best in your future endeavours! Link to comment Share on other sites More sharing options...
Bert Posted December 17, 2013 Share Posted December 17, 2013 HotKeySet("r", "Start") While 1 SLeep(100) WEnd Func Start() $aMousePos = MouseGetPos() MouseClick("Left", 364, 49, 1, 0) MouseMove($aMousePos[0], $aMousePos[1]) EndFunc The above script will do the job, but maybe a better way to go is get an ID on the control so you can activate the control without the mouse clicking on it. That would be much more stable. In the AutoIt suite of tools you installed is a tool called AutoIt Info Tool.. Run that and use it to get the ID of the control. Post the ID and we can quickly see if we can script a simple script that will do what you need. The Vollatran project My blog: http://www.vollysinterestingshit.com/ 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