Leaderboard
Popular Content
Showing content with the highest reputation on 02/03/2017 in all areas
-
I've recently taken over the development of an extension for Visual Studio Code, which I've found to have a great mix of features as a code editor. I've recently been able to get the extension to a point that it could launch scripts from the editor, open the help docs on a highlighted keyword, and launch the Info app. I'm still working on wrapping my head around the inner workings of VSCode to be able to implement advanced features like Intellisense but would appreciate any feedback (bugs, feature requests, new different snippets) in this thread or on the GitHub page where I'm maintaining the extension. You check out the extension on the VSCode Marketplace here and view the code on GitHub here. Edit: Go to http://code.visualstudio.com/docs/setup/windows for information on installing Visual Studio Code. See http://code.visualstudio.com/docs/editor/extension-gallery for information on installing extensions to VS Code.1 point
-
Hello Here is my network UDF. Do not yell at me if it already exists ... I hope it will be useful to someone. Please, let me know if you have any problem. All functions that perform modifications required administrator rights Functions list : Internal functions only : Examples : #Include "network.au3" ; List of availables connections/cards #Include <array.au3> ; only for _ArrayDisplay() $infos = _GetNetworkAdapterList() _ArrayDisplay($infos) ; Network card informations for the network connection called "Local Area Network" $infos = _GetNetworkAdapterInfos("Local Area Network") _ArrayDisplay($infos) ; Disable a network connection _DisableNetAdapter("Broadcom NetLink (TM) Gigabit Ethernet") ; OR _DisableNetAdapter("Local Area Network") ; Enable a network connection _EnableNetAdapter("Local Area Network") ; OR _EnableNetAdapter("Broadcom NetLink (TM) Gigabit Ethernet") ; Enable DHCP (for IP Address) _EnableDHCP("Broadcom NetLink (TM) Gigabit Ethernet") ; OR _EnableDHCP("Local Area Network") ; Configure a static IP adress _EnableStatic("Broadcom NetLink (TM) Gigabit Ethernet", "192.168.10.11", "255.255.255.0") ; OR _EnableStatic("Local Area Network", "192.168.10.11", "255.255.255.0") ; Configure the default gateway _SetGateways("Broadcom NetLink (TM) Gigabit Ethernet", "192.168.10.1") ; OR _SetGateways("Local Area Network", "192.168.10.1") ; Configure DNS servers Local $DNS_SERVERS[4] = [ "192.168.100.1", "192.168.100.2", "192.168.100.3", "192.168.100.4" ] _SetDNSServerSearchOrder("Local Area Network", $DNS_SERVERS) ; OR _SetDNSServerSearchOrder("Broadcom NetLink (TM) Gigabit Ethernet", $DNS_SERVERS) ; Configure the DNS domain name _SetDNSDomain ("Local Area Network", "mondomain.loc") ; OR _SetDNSDomain ("Broadcom NetLink (TM) Gigabit Ethernet", "mondomain.loc") ; Configure the DNS suffixes for all connections : Local $DNS_SUFFIXES[2] = [ "mondomain.loc", "mydomain.priv" ] _SetDNSSuffixSearchOrder($DNS_SUFFIXES) ; Clear the DNS cache (like ipconfig /flushdns) _FlushDNS() ; Remove an entry from the DNS cache _FlushDNSEntry("www.autoitscript.com") ; Configure the WINS servers (very old, now ...) _SetWINSServer("Local Area Network", "192.168.100.251", "192.168.100.252") ; OR _SetWINSServer("Broadcom NetLink (TM) Gigabit Ethernet", "192.168.100.251", "192.168.100.252") ; Enable the two options : ; - Register this connection's address in DNS ( first parameter) ; - Use this connection's DNS suffix in DNS registration (second parameter) _SetDynamicDNSRegistration("Local Area Network", True, True) ; Release the DHCP lease _ReleaseDHCPLease() ; Renew the DHCP lease _RenewDHCPLease() ; Sets the Private category to the network connection called "LAN" _SetCategory("LAN", 1) Download link : Network.au31 point
-
What is MutiProcess UDF ? MutiProcess allows you to run several external programs at the same time and retrieve the exit code of each process. Originally, I created this UDF for my own need, to speed up the execution of many programs. How does it work ? MutiProcess works with jobs and tasks. A job is a list of tasks to execute. A task is the execution of an external program (like you can do with Run() ) When you launch a job, MutiProcess executes a specified number of tasks simultaneously. Each time a task finishes to execute, a new task is executed, in order to keep the maximum number of tasks simultaneously. Example, you want to launch 50 instances of notepad.exe (odd, isn't it?) with a maximum of 10 instances simultaneously. MutiProcess starts the first 10 processes, then it waits for one process to be finished. Since a processes is finished, MutiProcess launchs the next waiting task and so on, until the end of the tasks list. You can launch several jobs at the same time, each one with a lot of tasks if you want. Each job and task is identified by an uniq identifier (ID). How can I use it ? First, you have to create a MultiProcess job, using _MultiProcess_Create. It returns the ID of the job. Next, you have to add the tasks you want to execute in your job (for example : notepad.exe, ping, ...some external command), using _MultiProcess_AddTask. It returns the ID of the task. After that, you can launch the job using _MultiProcess_Run You can wait the end of execution of a job by using _MultiProcess_WaitClose You can cancel the execution of a job using _MultiProcess_Close, even if some tasks are in execution (it's possible to force the process to close) You can use _MultiProcess_SetOnEvent to call you own functions each time a job or task changes of state (start running, finished...). It's a good way to get the progression of the job. After all, you can get the result of each task, using _MultiProcess_GetResult. The result of a task is the exit code of its process. Example Here I want to process a "ping" command on 50 computers in my network. I could use the AutoIt Ping() function, but I use MultiProcess to launch 5 "ping" commands at the same time, to increase the time of execution . The external command that I want to launch is cmd /c ping 192.168.xxx.xxx -n 1 | find "TTL" : this command returns 0 on success and 1 on error. In the example, I give 2 methods to do the same thing : the first one with MultiProcess , the second with the AutoIt Ping() function. It's just to show you the difference of time execution. ; EXAMPLE 1 #Include <Array.au3> ; Just used for _ArrayDisplay #Include "multiProcess.au3" ; Build an array of hosts to Ping (the 2nd element of the array will contain the result (online/offline) Local $sSubNet = "192.168.1." Local $aHosts[50][2] For $i = 0 To UBound($aHosts) - 1 $aHosts[$i][0] = $sSubNet & ($i + 1) Next ; MultiProcess method ================================================================================ ConsoleWrite("Ping " & UBound($aHosts) & " hosts with MultiProcess method, please wait..." & @CRLF) Local $hTimer = TimerInit() ; Create a Multiprocess job _MultiProcess_Create() For $i = 0 To UBound($aHosts) - 1 ;~ ; Add a task, (external command) - returns an ID $aHosts[$i][1] = _MultiProcess_AddTask(@ComSpec & ' /c ping ' & $aHosts[$i][0] & ' -n 1 | find "TTL"', @SystemDir, @SW_HIDE) Next ; Launch the MultiProcess job, with a max of 5 simultaneous processes _MultiProcess_Run(5) ; Wait until the job finishes to execute _MultiProcess_WaitClose() ; Get the results of each task ;~ Local $aResult = _MultiProcess_GetResult() For $i = 0 To UBound($aHosts) - 1 $iExitCode = _MultiProcess_GetResult($aHosts[$i][1]) ; Retrieve to exit code of the process $aHosts[$i][1] = $iExitCode ? "------" : "Online" ; The command returns 0 on sucess Next ConsoleWrite("Elapsed time (in ms) : " & TimerDiff($hTimer) & @CRLF) _ArrayDisplay($aHosts) ; ==================================================================================================== ; Classic method ===================================================================================== ; Now, Classic method, using the Ping() function ConsoleWrite(@CRLF & "Ping " & UBound($aHosts) & " hosts with AutoIt Ping method, please wait..." & @CRLF) $hTimer = TimerInit() For $i = 0 To UBound($aHosts) - 1 $iRes = Ping($aHosts[$i][0]) ? "Online" : "------" Next ConsoleWrite("Elapsed time (in ms) : " & TimerDiff($hTimer) & @CRLF) _ArrayDisplay($aHosts) ; ==================================================================================================== I don't know if someone will by interested by the UDF, so if needed, I will provide more examples. Download link : multiProcess.au31 point
-
kemisten & newbie_pete
FrancescoDiMuro reacted to Melba23 for a topic
New users posting game-related questions normally does not attract sanctions - merely a pointer to the rules. But opening a second account and promptly reposting the same questions most certainly does - as you can see here. And seemingly not being that interested in learning anything about the language just makes the decision even easier. M231 point -
ControlClick is 100% accurate as long as the control and window are enabled (and sometimes required to be active) and ready to pick up the clicks...some apps require a longer click to get to that though, via AutoItSetOption. MouseClick and Send are not going to be a reliable way to get a repeatable script. With the above as a general statement, it would help to know what is being automated, a sample script, etc.1 point
-
is PID running ELEVATED [solved]
careca reacted to argumentum for a topic
1 point -
I know. ShellExecuteWait("AutoIt3.exe","funcLib.au3",@WorkingDir) ;execute scripts - look at the function - you can also pass parameters ...1 point
-
Nice one, thanks. Had to change a few things to get this working for the new Skype for Business. Mainly : $LyncTitle = "Skype for Business" MouseClick("Left", $LyncPos[0] + 20, $LyncPos[1] + 52, 1, 1) I also made sure the old title was removed, before the new one was added and the focus was taken off the status part of the screen : ClipPut($Note) WinActivate($LyncTitle) MouseClick("Left", $LyncPos[0] + 20, $LyncPos[1] + 52, 1, 1) Send("^a") Send("{del}") Send("^v") ClipPut("") MouseMove($CurMouse[0], $CurMouse[1], 1) MouseClick("Left", "", "", 1, 1)1 point
-
Finally Chillkat.au3 UDF is released:1 point
-
or even this (copy your data to the clipboard before run this listing) #include <array.au3> ; just to show result Local $aArray1 = StringSplit(StringStripCR(ClipGet()), @LF), $aArray2, $aResult[$aArray1[0]][1] For $i = 1 To $aArray1[0] $aArray2 = StringSplit($aArray1[$i], @TAB) If $aArray2[0] > UBound($aResult, 2) Then ReDim $aResult[$aArray1[0]][$aArray2[0]] For $i2 = 1 To $aArray2[0] $aResult[$i-1][$i2-1] = $aArray2[$i2] Next Next _ArrayDisplay($aResult) edit: skin as Function #include <array.au3> ; just to show result ; $sMyVar = ClipGet() ; from Clipboard to a variable _ArrayDisplay(_VarTo2D($sMyVar)) ; Func _VarTo2D($var, $sSeparator = @TAB) Local $aRows = StringSplit(StringStripCR($var), @LF), $aColumns, $aResult[$aRows[0]][1] For $iRow = 1 To $aRows[0] $aColumns = StringSplit($aRows[$iRow], $sSeparator) If $aColumns[0] > UBound($aResult, 2) Then ReDim $aResult[$aRows[0]][$aColumns[0]] For $iColumn = 1 To $aColumns[0] $aResult[$iRow - 1][$iColumn - 1] = $aColumns[$iColumn] Next Next Return $aResult EndFunc ;==>_VarTo2D1 point
-
Useful Snippets Collection Thread
argumentum reacted to KaFu for a topic
Added some interesting reading for 8. Facts on UAC.1 point