Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/18/2017 in all areas

  1. water

    AD - Active Directory UDF

    Version 1.6.3.0

    17,292 downloads

    Extensive library to control and manipulate Microsoft Active Directory. Threads: Development - General Help & Support - Example Scripts - Wiki Previous downloads: 30467 Known Bugs: (last changed: 2020-10-05) None Things to come: (last changed: 2020-07-21) None BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort
    1 point
  2. Danyfirex

    Block Numeric Keys

    You can include <WinAPIvkeysConstants.au3> in order to avoid magic numbers. Case $VK_0 to $VK_9, $VK_NUMPAD0 to $VK_NUMPAD9 Saludos
    1 point
  3. 1 point
  4. Just a few things to start with. The buttons wont fire as you have GUIOnEventMode set to 1 but are checking for the button clicks in the while loop. Either remove the line or use GUIOnEventMode to set the function to be called when a control is clicked. $idPause = GUICtrlCreateButton("Pause", 175, 80, 70, 25) GUICtrlSetOnEvent(-1, 'Paused') The label is also stopping the buttons from being clicked. You need to disable this as it over the buttons $TimeLabel = GUICtrlCreateLabel ( "", 35, 0, 480, 180, $SS_CENTER ) GUICtrlSetState(-1, $GUI_DISABLE) You can use +=1 and -=1 to increase or decrease values such as $kV = $kV + 1 becomes $kV +=1 You have other while loops in the functions but don't exit them so the code for that function keeps running, one even says "just sleeps forever...." and GoBack() while is missing an expression such as 1. You also declare some variables but not others. Have a read here for some tips. The minimum Sleep value is 10ms so Sleep(1) just defaults to 10. $SS_CENTER is a global variable for styles and you need to add #include <StaticConstants.au3> to the top of the script
    1 point
  5. It's true that the crash during script end when the script is run as 64-bit code is caused by the subclasses have not been removed. You can remove the subclasses in the example in the first post in this way: #AutoIt3Wrapper_UseX64=y #include "SSCtrlHover_v3.au3" GUICreate(@AutoItVersion) $idLbl1 = GUICtrlCreateLabel("Label 1", 5, 5) SSCtrlHover_Register($idLbl1, "FnNormal", 0, "FnHover", 0, "FnActive", 0, "FnClick", 0) $idLbl2 =GUICtrlCreateLabel("Label 2", 5, 35) SSCtrlHover_Register($idLbl2, "FnNormal", 0, "FnHover", 0, "FnActive", 0, "FnClick", 5) GUISetState() While GUIGetMsg() <> -3 Sleep(10) WEnd _WinAPI_RemoveWindowSubclass(GUICtrlGetHandle($idLbl1), $__SSCTRLHOVER_PSUBCLASSEXE, GUICtrlGetHandle($idLbl1)) _WinAPI_RemoveWindowSubclass(GUICtrlGetHandle($idLbl2), $__SSCTRLHOVER_PSUBCLASSEXE, GUICtrlGetHandle($idLbl2)) Func FnNormal($idCtrl, $hWnd, $vData) ConsoleWrite(@CRLF & "Normal/Leave " & $idCtrl) EndFunc Func FnHover($idCtrl, $hWnd, $vData) ConsoleWrite(@CRLF & "Hover " & $idCtrl) EndFunc Func FnActive($idCtrl, $hWnd, $vData) ConsoleWrite(@CRLF & "Active " & $idCtrl) EndFunc Func FnClick($idCtrl, $hWnd, $vData) ConsoleWrite(@CRLF & "CLICK! " & $idCtrl & " - " & $hWnd & " - " & $vData) EndFunc
    1 point
  6. @Rogueffs, the problem is on line 32 Seriously, you cannot expect us to help without seeing your code...
    1 point
  7. Danp2

    _Ieattach [Problem with url]

    $oIE = _IEAttach('www.google.com', 'url') https://www.autoitscript.com/autoit3/docs/libfunctions/_IEAttach.htm
    1 point
  8. Again, the replace machinery isn't part of the legacy PCRE library API. Support of named groups and much more many constructs would require PCRE to make the replacement code work closely with the match process. PCRE by itself isn't that ambitious. It's however quite possible to add support for fancy constructs to a "replace" piece of code but that requires strong (and non trivial) links between the matching code and the replacing code. Such thing would be slightly easier to implement by using PCRE2 (a more recent release of the PCRE library) but as far as AutoIt goes, don't expect that much in a short laps of time. Most of the time, named groups and named subroutines are only used within the matching pass.
    1 point
  9. Hello. I did some typo I'm my above post. Here I wait 30 seconds(I put minutes just a typo :S) after I run something that match my criteria. ( I go to edit first post to change minute for seconds) leep(30 * 1000) ;wait 30 minute I check every five seconds the Gmail Atom Feeds ( you can set less econds But maybe slep(1000) = 1 Seconds or Sleep(3000) =3 seconds I think check Atom Feeds every 5 seconds is enough at least for me. I dont think you get problem with gmails considering that this is something like a RSS feature. While Sleep(5000) ;Check every 5 secounds to match your criteria do something like this: ;check $sSubject and do something If StringInStr($sSubject,"Boot Linux VM") Then Run("C:\start_linux_vm.bat") EndIf If StringInStr($sSubject,'Shutdown Linux VM') Then Run("C:\shutdown_linux_vm.bat") EndIf Saludos
    1 point
  10. hello. Welcome to AutoIt Forum. Now I can think in two solutions for handle this. 1.- Use some IMAP UDF or Library (I don't know if there is one in the forum) to connect with you IMAP Server. I noticed that you want to use Gmail, so this in the second solution that came to my mind. 2.-Using Gmail's Atom feeds. I think this would be an easy way to handle this. You need to create a Application Password. Check here. Then you could do something like this to, keep reading the Gmail Feeds and perform something based in the mail's subject. So Then you can do something like this. ( Run The Script and Send an Email You will see the new email subject,email address and date in the SciTE Console) #include <InetConstants.au3> #include <Array.au3> #include <StringConstants.au3> #include <String.au3> #include <Date.au3> HotKeySet("{ESC}", "_Terminate") Local $sData = '' Local $aEntry = '' Local $sDate = '' Local $sEmail = '' Local $sSubject = '' Local $iDateCalc = 0 Local $sUserName='' ;Your gmail user (without @gmail) Local $sApplicationPassword='' ;your application password While Sleep(5000) ;Check every 5 secounds $sData = InetRead('https://' & $sUserName& ':' & $sApplicationPassword & '@mail.google.com/mail/feed/atom/unread/', $INET_FORCERELOAD) $sData = BinaryToString($sData, $SB_UTF8) $aEntry = _StringBetween($sData, '<entry>', '</entry>') For $i = 0 To UBound($aEntry) - 1 $sDate = _ConvertDate(_GetItem($aEntry[$i], 'issued')) $sEmail = _GetItem($aEntry[$i], 'email') $sSubject = _GetItem($aEntry[$i], 'title') $iDateCalc = _DateDiff('s', $sDate, _NowCalc()) If Abs($iDateCalc) < 30 Then ConsoleWrite("+This is a New Message..." & @CRLF) ConsoleWrite(">Subject: " & @TAB & $sSubject & @CRLF) ConsoleWrite(">Date: " & @TAB & $sDate & @TAB & "Diff: " & $iDateCalc & @CRLF) ConsoleWrite(">Email: " & @TAB & $sEmail & @CRLF) ConsoleWrite(@CRLF) ;check $sSubject and do something Sleep(30 * 1000) ;wait 30 seconds EndIf Next WEnd Func _Terminate() Exit EndFunc ;==>_Terminate Func _ConvertDate($sDate) ;~ ConsoleWrite($sDate & @CRLF) $sDate = StringReplace($sDate, "-", "") $sDate = StringReplace($sDate, "Z", "") Local $sYear = StringLeft($sDate, 4) Local $sMonth = StringMid($sDate, 5, 2) Local $sDay = StringMid($sDate, 7, 2) Local $sHour = StringMid($sDate, 10, 2) Local $sMinute = StringMid($sDate, 13, 2) Local $sSecond = StringMid($sDate, 16, 2) Local $sEncodedGMT = _Date_Time_EncodeSystemTime($sMonth, $sDay, $sYear, $sHour, $sMinute, $sSecond) Local $sLocalTime = _Date_Time_SystemTimeToTzSpecificLocalTime(DllStructGetPtr($sEncodedGMT)) $sLocalTime = _Date_Time_SystemTimeToDateTimeStr($sLocalTime, 1) Return $sLocalTime EndFunc ;==>_ConvertDate Func _GetItem($sData, $Item) Local $aItem = _StringBetween($sData, $Item, StringReplace($Item, '<', '</')) ;~ _ArrayDisplay($aItem) If IsArray($aItem) Then Return StringReplace(StringReplace($aItem[0], '>', ''), '</', '') EndFunc ;==>_GetItem Saludos
    1 point
  11. Hi, Or just get rid of the variable altogether: #include <MsgBoxConstants.au3> MsgBox( $MB_OK, "Message", "It's " & ((@HOUR > 12) ? ("after") : ("before")) & " midday!" ) M23
    1 point
  12. This should probably be moved to GH&S, and I am not usually one for just handing out solutions... please ensure that follow up questions come with code you have attempted yourself and not just screenshots of the app you are trying to automate (as that will likely never be helpful). #include <AutoItConstants.au3> $pid = run('cmd /c powershell "Get-AppxPackage -name Microsoft.3DBuilder | select -expandproperty version"' , @SystemDir , @SW_HIDE , $STDOUT_CHILD) $sOut = "" While 1 $sOut &= StdoutRead($pid) If @error Then ExitLoop WEnd msgbox(0, '' , $sOut)
    1 point
  13. Greetings First off, I'd like to apologize for making a topic about this. I've searched for the last 20 mins but have been unable to answer my own question. What i am attempting to do is when a user clicks a button, a program is installed. My AutoIt script is in c:\test The file which i need to run is in c:\test\bin\cc\ I also need to pass command line arguments to it. I think this issue could be resolved by the workingdirectory parameter but i cant figure out the usage or find an example. I do not want to specify the ENTIRE path. Just bin\cc\ as this will be moved to different computers. Below is my code. Thank you in advance. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Process.au3> $MainPage = GUICreate("VCS Config", 201, 141, -1, -1) $BUT1_SysInfo = GUICtrlCreateButton("System Info", 8, 8, 185, 25) $BUT2_InstallCC = GUICtrlCreateButton("Install Calling Card", 8, 41, 185, 25) $BUT3_InstallOPT = GUICtrlCreateButton("Install Optimization Tools", 8, 73, 185, 25) $BUT4_EXT = GUICtrlCreateButton("Exit", 8, 106, 185, 25) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() IF $msg = $BUT2_InstallCC Then InstallCallingCard() ENDIF IF $msg = $BUT3_InstallOPT Then OPTPAK() ENDIF IF $msg = $BUT4_EXT Then Exit EndIf WEnd FUNC InstallCallingCard() $FREE = DriveSpaceFree("C:\") MsgBox(64,"TotalFree",$FREE) RunWait ( "vcscc.msi /norestart /quiet" [, "bin\cc\" ] ) EndFunc Func OPTPAK() MsgBox(64,"Button 3 Pressed!","Worked!!!") EndFunc
    1 point
  14. here's what windows uses: ;~ 4 Do not display a progress dialog box. ;~ 8 Give the file being operated on a new name in a move, copy, or rename operation if a file with the target name already exists. ;~ 16 Respond with "Yes to All" for any dialog box that is displayed. ;~ 64 Preserve undo information, if possible. ;~ 128 Perform the operation on files only if a wildcard file name (*.*) is specified. ;~ 256 Display a progress dialog box but do not show the file names. ;~ 512 Do not confirm the creation of a new directory if the operation requires one to be created. ;~ 1024 Do not display a user interface if an error occurs. ;~ 2048 Version 4.71. Do not copy the security attributes of the file. ;~ 4096 Only operate in the local directory. Don't operate recursively into subdirectories. ;~ 9182 Version 5.0. Do not copy connected files as a group. Only copy the specified files. _FileCopy("C:\Installed Apps\Patches\WindowsXP-KB835935-SP2-ENU.exe","C:\temp") Func _FileCopy($fromFile,$tofile) Local $FOF_RESPOND_YES = 16 Local $FOF_SIMPLEPROGRESS = 256 $winShell = ObjCreate("shell.application") $winShell.namespace($tofile).CopyHere($fromFile,$FOF_RESPOND_YES) EndFunc
    1 point
×
×
  • Create New...