Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/22/2016 in all areas

  1. #include <MsgBoxConstants.au3> #include <WinAPIDiag.au3> #include <WinAPIDlg.au3> #include <WinAPISys.au3> #RequireAdmin Local $iNetworkConnected While 1 $iNetworkConnected = _WinAPI_IsNetworkAlive() If $iNetworkConnected Then ShellExecute ('C:\Users\Delta\Desktop\Project Charlie Sheen\Lulu.exe') Sleep(100) WEnd Welcome, It's not that your way wouldn't work,(using functions) it's just that there are many ways for the same. You don't want to re-declare a variable millions of times. Also to call a function all you need is to write it and () like 'funk()'
    1 point
  2. jchd

    Hassett Recv 2.0

    You can easily build an array of identifiers since they have a fixed pattern. I guess that the first three characters are always uppercase letters in [A-Z] and that the last 11 are always digits. If there is something missing or wrong, just chime. Note that none of the three wrongly formatted ID near the end are correctly ignored. Local $s = _ "EWRSEA98195198494 EWRSEA98195192948" & @CRLF & _ "" & @CRLF & _ "hf98h234f f0j32jfdsijf9823j" & @CRLF & _ "" & @CRLF & _ " ATLSEA89464684894 f8h3298hf23" & @CRLF & _ "ATLSE597048044051 A45SEA87946168456 ZZZSEA01234X56789" & @CRLF & _ " f23098fh DFWSEA98464548455" Local $aID = StringRegExp($s, "(?m)([A-Z]{3}SEA\d{11})", 3) _ArrayDisplay($aID)
    1 point
  3. JLogan3o13

    Reminder alert

    @n3wbie yes, typically scripts written 11 years and two dozen releases ago don't work so well. You would be better served starting a new topic in Help and Support, explaining exactly what you are wanting to do, and showing what you have tried. You can even link to this post if this is the script you have been using it.
    1 point
  4. Precisely what I thought. Please read through our forum rules, especially the part about "joke/spoof" scripts, and you'll see why this thread is locked (mainly because using a language as powerful as AutoIt to "troll friends" is amazingly childish and stupid). Hope to see you with a legitimate post in the future.
    1 point
  5. Happy to help Yeah, i imagine a better, faster way exists, but i don't know enough about it to be able to help, I'm afraid
    1 point
  6. BrewManNH

    Switch not working

    @ur If you want help with a picture, go to an image related forum, if you want help with a script, post the script and not a screenshot of it. If this script were bigger, and you wanted help with it, someone who wanted to run your script would have to retype the whole thing because all we have is a screenshot. People tend to ignore you when you post screenshots of a text file, post the text next time.
    1 point
  7. Here is a way to get the list of logged on users (from the registry) : #RequireAdmin #include <Security.au3> #include <Array.au3> Local $aLoggedOnUsers = _GetLoggedOnUsers() _ArrayDisplay($aLoggedOnUsers) Func _GetLoggedOnUsers() Local $sSubkey, $i = 0, $aUserInfo, $aResult[1][2], $iCount While 1 $i += 1 $sSubkey = RegEnumKey("HKEY_USERS", $i) If @error Then ExitLoop If StringRegExp($sSubkey, "^S-1-5-21-(\d+-){3}\d+$") Then $iCount += 1 $aUserInfo = _Security__LookupAccountSid ($sSubkey ) Redim $aResult[$iCount + 1][2] $aResult[$iCount][0] = $aUserInfo[1] & "\" & $aUserInfo[0] $aResult[$iCount][1] = $sSubkey EndIf WEnd $aResult[0][0] = $iCount Return $aResult EndFunc
    1 point
  8. I'm no expert with "winmgmts", but i can say the reason why the object fails, is the method "Get" with your properties is throwing an exception. And AutoIt does not work well with object exceptions, without catching object events. I would think the code below MIGHT be a solution. MsgBox(0, "", _Security__SidToStringSid(_Security__GetAccountSid($UserName))) otherwise something like this: $objAccount = $objWMIService.ExecQuery("SELECT SID FROM Win32_UserAccount WHERE Name='"&@UserName&"'"); i use @UserName, as the return from "_GetUsername()" contains string terminating char(s) and makes the query fail. For $row in $objAccount ConsoleWrite($row.Name&@CRLF) ConsoleWrite($row.SID&@CRLF) Next Anyway, i hope some of this will be helpful.
    1 point
  9. BrewManNH

    HotKeySet stucks keys

    https://www.autoitscript.com/wiki/FAQ#Why_does_the_Ctrl_key_get_stuck_down_after_I_run_my_script.3F
    1 point
  10. In the update monday WM_NOTIFY message handlers are implemented through subclassing. If you click "Run User Func" button in Examples2.au3 two _ArrayDisplayEx windows are displayed at the same time and two WM_NOTIFY message handlers are running at the same time through two subclasses. If you click "Exit Script" button in the window opened with "Run User Func" button, it's important that both subclasses are properly removed before the entire script exits. I forgot to do that in the monday update, and that's the reason for this new update. To remove the subclasses two variables are needed for each subclass: $hGUI and $pNotifyFunc. Then a subclass can be removed in this way: _ArrayDisplayEx_RemoveWindowSubclass( $hGUI, $pNotifyFunc, 1000 ) I can store all occurrences of $hGUI and $pNotifyFunc as local static variables in _ArrayDisplayEx_LocalStorage or I can store them in a global array. Since accessing variables through a function takes much longer time than accessing variables through an array, I've decided to remove _ArrayDisplayEx_LocalStorage completely and use an array to store all variables that are used globally. In the new update the global array $aArrayDisplayEx_Info is introduced. Because this example is all about displaying array data as fast as possible in a virtual listview, it seems to be a good idea to use an array instead of a function to store the global variables. Even if it's at the cost of a single global array. In Examples6.au3 you can click "Run User Func" to open the official version of _ArrayDisplay. If you click "Exit Script" in _ArrayDisplay GUI, the subclass in _ArrayDisplayEx is properly removed and Examples6.au3 exits nicely. Zip in post above updated.
    1 point
  11. Matt, The ":' should probably be a double quote (send stmt). kylomas
    1 point
  12. UEZ

    Ghost Interface

    If I understand you correctly, try this: #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <WinAPIGdi.au3> Global $hGUI = GUICreate("Ghost", 200, 100, @DesktopWidth - 210, 10, $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_TRANSPARENT)) GUISetBkColor(0x808080) Global $iLbl = GUICtrlCreateLabel("Hover me :-)", 10, 10, 180, 80, BitOR($SS_CENTERIMAGE, $SS_CENTER)) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetFont(-1, 24) GUISetState() Global $iMin = 64 AdlibRegister("HoverChk", 50) Do Until GUIGetMsg() = -3 AdlibUnRegister("HoverChk") GUIDelete() Func HoverChk() Local $iFadeIn = 8, $iFadeOut = 64 Local Static $iTransparency = 255 Local $aPos = WinGetPos($hGUI) If _WinAPI_PtInRectEx(MouseGetPos(0), MouseGetPos(1), $aPos[0], $aPos[1], $aPos[2] + $aPos[0] + 1, $aPos[3] + $aPos[1] + 1) Then If $iTransparency >= $iMin Then $iTransparency -= $iFadeOut $iTransparency = ($iTransparency < $iMin) ? $iMin : $iTransparency WinSetTrans($hGUI, "", $iTransparency) EndIf Else If $iTransparency <= 255 Then $iTransparency += $iFadeIn $iTransparency = ($iTransparency > 255) ? 255 : $iTransparency WinSetTrans($hGUI, "", $iTransparency) EndIf EndIf EndFunc
    1 point
  13. That's the best interpretation of @mLipok I have ever seen
    1 point
  14. Gianni

    Network configuration UDF

    tip: if is needed to post a screenshot, it is better to capture only the interested window instead of all the screen just press "ALT"+"PRINTSCREEN" instead of only "PRINTSCREEN" this will capture only the active windows (or popup)
    1 point
×
×
  • Create New...