EmptySpace Posted May 18, 2012 Share Posted May 18, 2012 (edited) I was just experimenting and learning mouse click things and I stucked doing this: How I should do click few centimetres (y or smth, dont know how to say that) away from current mouse position? $pos=MouseGetPos() MouseClick("right",$pos[0],$pos[1],0) MouseMove($pos[0], and something here?) I dont need to click exactly in some spot on window. Just some pixels away from mouse pos down. So in y axis. x axis is ok, in same line. Edited May 19, 2012 by Edgaras Link to comment Share on other sites More sharing options...
water Posted May 18, 2012 Share Posted May 18, 2012 (edited) Just add the value you want to change the click position to parameter 2 and 3.MouseClick("right",$pos[0]+10,$pos[1]+10, 0)My example moves the mouse 10 pixel to the right and 10 pixels down. Why do you set parameter 4 to 0? This parameter denotes the number of clicks you want to do. To move the mouse fast to the position you have to set parameter 5 to 0. Edited May 18, 2012 by water My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted May 18, 2012 Moderators Share Posted May 18, 2012 (edited) Though I am tempted to ask what game you're trying to automate, try something like this to get you pointed in the right direction (from a very simple read of the helpfile): Local $pos = MouseGetPos() MsgBox(0, "Mouse x,y:", $pos[0] & "," & $pos[1]) MouseMove($pos[0] - 10, $pos[1] - 100, 0) Local $pos1 = MouseGetPos() MsgBox(0, "Mouse x,y:", $pos1[0] & "," & $pos1[1]) Edit: Dang beaten again Edited May 18, 2012 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
EmptySpace Posted May 18, 2012 Author Share Posted May 18, 2012 (edited) "Though I am tempted to ask what game you're trying to automate" whats wrong with you people? When I ask something all thinks that im making bot! I find fun in autoit and enjoy making things. I have alot of sheets in my pc of examples and other things. With melba help I learned few things with GUI. I wanted to change to something not so difficult and relax from that +100 line codes. So i moved into mouseclick. Thanks, it works. Didnt even thinked about that. Edited May 18, 2012 by Edgaras Link to comment Share on other sites More sharing options...
Autolaser Posted May 18, 2012 Share Posted May 18, 2012 This WORKS quickly without delay Example Scripts -> MouseClickFast & MouseMoveFast Regards Autolaser Link to comment Share on other sites More sharing options...
EmptySpace Posted May 19, 2012 Author Share Posted May 19, 2012 Hmm it would be great if I could understand it. But actually I dont need so fast mouse click. In topic name I wanted to say "fast question about mouse click" not for fast clicking. Link to comment Share on other sites More sharing options...
water Posted May 19, 2012 Share Posted May 19, 2012 It's described in the first post of the thread: "Standard MouseClick & MouseMove functions have got hardcoded Sleep(10)". The new functions eliminate this Sleep so they are a bit faster. But as speed doesn't matter for you I would stick with the AutoIt standard functions. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Autolaser Posted May 19, 2012 Share Posted May 19, 2012 right example _MouseClickFast(1180, 470) move the cursor to the position x1180 y 470 and performs a mouse click Regards Autolaser Link to comment Share on other sites More sharing options...
EmptySpace Posted May 19, 2012 Author Share Posted May 19, 2012 But how I can make something like this?MouseMove($pos[0] - 10, $pos[1] - 100, 0) Link to comment Share on other sites More sharing options...
water Posted May 19, 2012 Share Posted May 19, 2012 You already did. If you use $pos=MouseGetPos()to get the current mouse position. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki 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