Jump to content

script to connect to a WiFi - (Moved)


Recommended Posts

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!

Link to comment
Share on other sites

  • Moderators

Moved to the appropriate forum.

Moderation Team

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...