ia85 Posted June 9, 2015 Share Posted June 9, 2015 (edited) Hello, trying to write a simple script to move the mouse to a pos and hit left click every time a certain keystroke was detected. im getting some error msg .. any ideas ? HotKeySet("a" , "MouseClick") ; Pressing "a" moves the mouseHotKeySet("{ESC}", "On_Exit") ; Pressing ESCAPE exits the script; Use an infinite loop to keep the script alive - I bet this is what you did not have in your version While 1 Sleep(10)WEndFunc MouseClick() MouseClick ( "left" [, 100, 100 [, clicks = 1 [, speed = 10]]] )EndFuncFunc On_Exit() ExitEndFunc<snip> Edited June 9, 2015 by Melba23 Link removed Link to comment Share on other sites More sharing options...
argumentum Posted June 9, 2015 Share Posted June 9, 2015 mouseclick is an internal function and your function is mouseclick dah=P Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
argumentum Posted June 9, 2015 Share Posted June 9, 2015 (edited) ..and, would you kindly explain <snip> Edited June 9, 2015 by Melba23 Quoted link removed Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
MikahS Posted June 9, 2015 Share Posted June 9, 2015 Any chance we could find out what this is used to automate? I'm sure there might be a better solution for you besides using mouse functions. Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
taylansan Posted June 9, 2015 Share Posted June 9, 2015 (edited) #include <Misc.au3> HotKeySet("{ESC}", "On_Exit") Local $hDLL = DllOpen("user32.dll") While 1 If _IsPressed("41", $hDLL) Then ; A-key MouseClick("left", 100, 100, 1, 0) EndIf Sleep(20) ; sleep 20 is nice WEnd Func On_Exit() Exit EndFunc Edited June 9, 2015 by Melba23 Quoted link removed TY. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 9, 2015 Moderators Share Posted June 9, 2015 ia85,I have removed the link from your post (and others). If you wish to restore it, please explain what it does first.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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