Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/10/2017 in Posts

  1. zelles

    Get Mac Address Efficiently

    I was trying to get the MAC address of the computer running the script and the most efficient way seams to be using this function. I found it somewhere, but it was broken and would not run at all, and after making some change I got it displaying the Mac address. Does anyone know a more efficient way? This seams pretty efficient. Also, even though it works without issue, did I do things right in the function? Working function to get the MAC address: $IP_Address = @IPAddress1 $MAC_Address = GET_MAC($IP_Address) MsgBox(0, "MAC Address:", $MAC_Address) Func GET_MAC($_MACsIP) Local $_MAC,$_MACSize Local $_MACi,$_MACs,$_MACr,$_MACiIP $_MAC = DllStructCreate("byte[6]") $_MACSize = DllStructCreate("int") DllStructSetData($_MACSize,1,6) $_MACr = DllCall ("Ws2_32.dll", "int", "inet_addr", "str", $_MACsIP) $_MACiIP = $_MACr[0] $_MACr = DllCall ("iphlpapi.dll", "int", "SendARP", "int", $_MACiIP, "int", 0, "ptr", DllStructGetPtr($_MAC), "ptr", DllStructGetPtr($_MACSize)) $_MACs = "" For $_MACi = 0 To 5 If $_MACi Then $_MACs = $_MACs & ":" $_MACs = $_MACs & Hex(DllStructGetData($_MAC,1,$_MACi+1),2) Next DllClose($_MAC) DllClose($_MACSize) Return $_MACs EndFunc
    1 point
  2. 10 bucks a line, I haven't heard prices like that since college.
    1 point
  3. Hi There are many possible regex patterns depending of the context The strictest could be this #Include <Array.au3> $s = "&#xF1;" & @crlf & _ "&#x00E1;" & @crlf & _ "&#x00C2;" & @crlf & _ "&#x00E6;" & @crlf & _ "&#x00E0;" & @crlf & _ "&#xE5;" & @crlf & _ "&#xE4;" & @crlf & _ "&#x2014;" & @crlf & _ "&#x2022;" ;msgbox(0,"", $s) $r = StringRegExp($s, '&#x((?:[[:xdigit:]]{2}){1,2})', 3) _ArrayDisplay($r)
    1 point
  4. Try this one: Func button1() If @Compiled Then ShellExecute(@ScriptFullPath) Else ShellExecute(@AutoItExe, @ScriptFullPath) EndIf Exit EndFunc BR?
    1 point
×
×
  • Create New...