natiya Posted April 15, 2020 Share Posted April 15, 2020 I'm trying to automate the connection to a WiFi network through the WPS mechanism so I though I would record the clicks of the process. However, when I run the code, it doesn't do anything...This is my code: #region --- Au3Recorder generated code Start (v3.3.9.5 KeyboardLayout=0000040A) --- #region --- Internal functions Au3Recorder Start --- Func _Au3RecordSetup() Opt('WinWaitDelay',100) Opt('WinDetectHiddenText',1) Opt('MouseCoordMode',0) Local $aResult = DllCall('User32.dll', 'int', 'GetKeyboardLayoutNameW', 'wstr', '') If $aResult[1] <> '0000040A' Then MsgBox(64, 'Warning', 'Recording has been done under a different Keyboard layout' & @CRLF & '(0000040A->' & $aResult[1] & ')') EndIf EndFunc Func _WinWaitActivate($title,$text,$timeout=0) WinWait($title,$text,$timeout) If Not WinActive($title,$text) Then WinActivate($title,$text) WinWaitActive($title,$text,$timeout) EndFunc _AU3RecordSetup() #endregion --- Internal functions Au3Recorder End --- _WinWaitActivate("classname=Shell_TrayWnd","") MouseClick("left",1143,12,1) _WinWaitActivate("Network Connections","") MouseClick("left",130,273,1) MouseUp("left") _WinWaitActivate("classname=Shell_TrayWnd","") MouseClick("left",1143,19,1) #endregion --- Au3Recorder generated code End --- Not sure if there are specific classes to replace the clicks for something more specific like a built-in function. Otherwise,so you know why the click action is not working? Thanks! av8612 1 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 15, 2020 Moderators Share Posted April 15, 2020 Moved to the appropriate forum. Moderation Team av8612 1 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...
Nine Posted April 15, 2020 Share Posted April 15, 2020 (edited) MouseClick is not your best strategy to automate something. What exactly are you trying to do ? Probably there is a better solution. Edited April 15, 2020 by Nine av8612 and natiya 1 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
natiya Posted April 16, 2020 Author Share Posted April 16, 2020 On 4/15/2020 at 3:38 PM, Nine said: MouseClick is not your best strategy to automate something. What exactly are you trying to do ? Probably there is a better solution. I'd like to automate the process of connecting to router using WPS in a Windows 10 PC. Basically, this is what I want to automate. I've tried to record the clicks but it doesn't do anything when I run the script. If there is a way to enable that function, that'd be great too! Thanks! Link to comment Share on other sites More sharing options...
Nine Posted April 16, 2020 Share Posted April 16, 2020 I personally use UIAutomation for that. Try something and let us know how it goes. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy 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