Shasta Posted May 3, 2009 Share Posted May 3, 2009 Hello AutoITers, I'm having a bit of an issue with either MouseMove or MouseClickDrag or both. This isn't my code but I do know how to write it. Putting 0 after the X and Y coords of either one of these commands should make the speed "instantaneous". Well I have seen other programs make mouse moves instant and the cursor could never been seen at any point but the origin and destination. When I use this code and watch the cursor it is not actually instant, as I can see the mouse at points along the line when I use it, like there is still some minor delay. If my syntax is wrong or I have left something out please let me know. I want this to be as fast as possible, and it isn't instant like it should be. Thank you for the help in advance. expandcollapse popup#Region;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_icon=C:\Program Files\AutoIt3\Icons\Misc\bundle.ico #AutoIt3Wrapper_outfile=.\DFLoot.exe #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_Res_Comment=Darkfall Loot Macro #AutoIt3Wrapper_Res_Description=Darkfall Loot Macro #AutoIt3Wrapper_Res_Fileversion=1.0.2.4 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y #AutoIt3Wrapper_Res_LegalCopyright=© 2009 #AutoIt3Wrapper_Res_Language=1033 #EndRegion;**** Directives created by AutoIt3Wrapper_GUI **** #cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.12.1 Author: Jazkal Date: 03/12/2009 Script Function: Darkfall Loot Macro #ce ---------------------------------------------------------------------------- Opt("MouseClickDownDelay", 0) Opt("MouseClickDragDelay", 0); Alters the length of the brief pause at the start and end of a mouse drag operation. Opt("MouseCoordMode", 0); Sets the way coords are used in the mouse functions, 0 = relative coords to the active window If Not FileExists(@ScriptDir&"\_Macros.ini") Then IniWrite(@ScriptDir&"\_Macros.ini", "Bag", "X", "0") IniWrite(@ScriptDir&"\_Macros.ini", "Bag", "Y", "0") Sleep(500) EndIf Global $BagTargetX = IniRead(@ScriptDir&"\_Macros.ini", "Bag", "X", "0") Global $BagTargetY = IniRead(@ScriptDir&"\_Macros.ini", "Bag", "Y", "0") HotKeySet("{TAB}", "_MouseDragDrop"); Press 'Esc' key once mouse if over loot you want to grab. HotKeySet("!{`}", "_SetBagCoords"); Press 'Alt' 'Esc' to set the location of your bag, where you want to drag your loot too. While 1 Sleep(10) WEnd Func _MouseDragDrop() $MousePos = MouseGetPos() MouseClickDrag("left", $MousePos[0], $MousePos[1], $BagTargetX, $BagTargetY, 0) MouseMove($MousePos[0], $MousePos[1], 0) EndFunc Func _SetBagCoords() $MousePos = MouseGetPos() IniWrite(@ScriptDir&"\_Macros.ini", "Bag", "X", $MousePos[0]) IniWrite(@ScriptDir&"\_Macros.ini", "Bag", "Y", $MousePos[1]) $BagTargetX = $MousePos[0] $BagTargetY = $MousePos[1] EndFunc Link to comment Share on other sites More sharing options...
Yashied Posted May 3, 2009 Share Posted May 3, 2009 (edited) Hello AutoITers, I'm having a bit of an issue with either MouseMove or MouseClickDrag or both. This isn't my code but I do know how to write it. Putting 0 after the X and Y coords of either one of these commands should make the speed "instantaneous". Well I have seen other programs make mouse moves instant and the cursor could never been seen at any point but the origin and destination. When I use this code and watch the cursor it is not actually instant, as I can see the mouse at points along the line when I use it, like there is still some minor delay. If my syntax is wrong or I have left something out please let me know. I want this to be as fast as possible, and it isn't instant like it should be. Thank you for the help in advance. Try follows. Func _MouseDragDrop() $MousePos = MouseGetPos() ; MouseClickDrag("left", $MousePos[0], $MousePos[1], $BagTargetX, $BagTargetY, 0) MouseDown("left") MouseMove($BagTargetX, $BagTargetY, 1) MouseUp("left") MouseMove($MousePos[0], $MousePos[1], 1) EndFunc EDIT: Good idea. So far, I tested your script, I removed all the unnecessary files on my desktop to the Trash. Edited May 3, 2009 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
Shasta Posted May 4, 2009 Author Share Posted May 4, 2009 Wow nice job thats amazing. This is exactly what I wanted and it works perfect now. Thank you very much. I don't know how much harder it is but how about a macro that clicks every pixel within a given/set range (like a square) and drags it to the given location. In any case props to Yashied. 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