Jump to content

ModemJunki

Active Members
  • Posts

    242
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

ModemJunki's Achievements

Polymath

Polymath (5/7)

22

Reputation

  1. I am seeing the same as in this post on a fresh install and wanted to know if in general should switch to the beta for general work or not? I've been away for a while. I retired. :P
  2. It gets stuck in Excel? Why not using the native Excel functions in AutoIT? (the helpfile is your friend...)
  3. @mLipok - line 57 Local $o_objTpm = $o_objWMITPM.Get("Win32_Tpm=@") declares $o_objTpm local but should not .. if I remove "Local" works OK on my system. (when run as admin of course).
  4. If you are using SciTE4AutoIt3 install from this website there are AutoIt3Wrapper directives that autoincrement the version when compiling with F7. This is what Subz gave as the solution (doing the steps inserts the first autoincrement directive into the script). It sounds like you also need the second directive to make the script version increment before the compile so that your script always calls the latest version (default is not to do that!). #AutoIt3Wrapper_Res_FileVersion_AutoIncrement=  ;(Y/N/P) AutoIncrement FileVersion. Default=N #AutoIt3Wrapper_Res_Fileversion_First_Increment=;(Y/N) AutoIncrement Y=Before; N=After compile. Default=N Look in the help for SciTe for all of the directives as they might be handy for you to know about instead of hunting through the menus in SciTe. 😄 #Region AutoIt3Wrapper directives section ;** This is a list of compiler directives used by AutoIt3Wrapper.exe. ;** comment the lines you don't need or else it will override the default settings ;=============================================================================================================== #Autoit3Wrapper_Testing=                        ;(Y/N) Skip Tidy, Au3Stripper and cvsWrapper for speed while testing. Default=N #AutoIt3Wrapper_ShowProgress=                   ;(Y/N) Show ProgressWindow during Compile. Default=Y #AutoIt3Wrapper_ShowGui=                        ;(Y/N) Show GUI when F7-Compiling like Ctrl+F7. Default=N ;=============================================================================================================== ;** AutoIt3 settings #AutoIt3Wrapper_UseX64=                         ;(Y/N) Use AutoIt3_x64 or Aut2Exe_x64. Default=N #AutoIt3Wrapper_Version=                        ;(B/P) Use Beta or Production for AutoIt3 and Aut2Eex. Default is P #AutoIt3Wrapper_Run_Debug_Mode=                 ;(Y/N) Run Script with console debugging. Default=N #AutoIt3Wrapper_Run_Debug=                      ;(On/Off) Switch debugging on/off #AutoIt3Wrapper_Run_SciTE_Minimized=            ;(Y/N) Minimize SciTE while script is running. Default=N #AutoIt3Wrapper_Run_SciTE_OutputPane_Minimized= ;(Y/N) Minimize SciTE output pane at run time. Default=N #AutoIt3Wrapper_Autoit3Dir=                     ;Optionally override the AutoIt3 install directory to use. #AutoIt3Wrapper_Aut2exe=                        ;Optionally override the Aut2exe.exe to use for this script #AutoIt3Wrapper_AutoIt3=                        ;Optionally override the Autoit3.exe to use for this script ;=============================================================================================================== ;** Aut2Exe settings #AutoIt3Wrapper_Icon=                           ;Filename of the Ico file to use for the compiled exe #AutoIt3Wrapper_OutFile=                        ;Target exe/a3x filename. #AutoIt3Wrapper_OutFile_Type=                   ;exe=Standalone executable (Default); a3x=Tokenised AutoIt3 code file #AutoIt3Wrapper_OutFile_X64=                    ;Target exe filename for X64 compile. #AutoIt3Wrapper_Compression=                    ;Compression parameter 0-4  0=Low 2=normal 4=High. Default=2 #AutoIt3Wrapper_UseUpx=                         ;(Y/N) Compress output program.  Default=Y #AutoIt3Wrapper_UPX_Parameters=                 ;Override the default settings for UPX. #AutoIt3Wrapper_Change2CUI=                     ;(Y/N) Change output program to CUI in stead of GUI. Default=N #AutoIt3Wrapper_Compile_both=                   ;(Y/N) Compile both X86 and X64 in one run. Default=N ;=============================================================================================================== ;** Target program Resource info #AutoIt3Wrapper_Res_Comment=                    ;Comment field #AutoIt3Wrapper_Res_CompanyName=                ;Company field #AutoIt3Wrapper_Res_Description=                ;Description field #AutoIt3Wrapper_Res_Fileversion=                ;File Version #AutoIt3Wrapper_Res_Fileversion_Use_Template=   ;Use a template to generate the fileversion based on date info: %YYYY/%YY/%MO/%DD/%HH/%MI/%SE #AutoIt3Wrapper_Res_FileVersion_AutoIncrement=  ;(Y/N/P) AutoIncrement FileVersion. Default=N #AutoIt3Wrapper_Res_Fileversion_First_Increment=;(Y/N) AutoIncrement Y=Before; N=After compile. Default=N #AutoIt3Wrapper_Res_HiDpi=                      ;(Y/N) Compile for high DPI. Default=N #AutoIt3Wrapper_Res_ProductName=                ;Product Name #AutoIt3Wrapper_Res_ProductVersion=             ;Product Version #AutoIt3Wrapper_Res_Language=                   ;Resource Language code . Default 2057=English (United Kingdom) #AutoIt3Wrapper_Res_LegalCopyright=             ;Copyright field #AutoIt3Wrapper_Res_LegalTrademarks=            ;Trademark field #AutoIt3Wrapper_res_requestedExecutionLevel=    ;asInvoker, highestAvailable, requireAdministrator or None (remove the trsutInfo section).  Default is the setting from Aut2Exe (asInvoker) #AutoIt3Wrapper_res_Compatibility=              ;Vista/Windows7/win7/win8/win81/win10 allowed separated by a comma     (Default=Win10) #AutoIt3Wrapper_Res_SaveSource=                 ;(Y/N) Save a copy of the Script_source in the EXE resources. Default=N
  5. Well I will throw my two cents in to this (convoluted) discussion. In my previous work, I created a fully automated Windows installation that ran from Windows PE to deploy a Windows image (WIM image) and then made custom settings including setting up and formatting partitions on additional disk drives after the WIM image was up and running on the system. The deployment could deal with multiple types of hardware. The reason for the PE deployment without something like SCCM was that the systems were isolated from the world at large so effective deployment had to be "stand-alone". Started with CDs as the media and moved to DVD then to USB devices. Requires that one knows about the Windows deployment tools as well as AutoIT and the inner workings of Windows, etc.. It's not easy but it can be done.
  6. Neat. Test spec says jiggle the mouse so I jiggle the mouse. But the DLL call is better to keep the system awake, I think.
  7. I had an interesting test case to move the mouse at random intervals and capture some data from that. I found this post from @mlowery from 2010 and didn't want to necropost: So I modified that to work with Random() and my own mouse mover to jiggle the mouse. Can anyone think of an easier way? #include <Date.au3> ;=============================================================================== ; Description: Moves mouse rando-periodically to prevent screen save ;=============================================================================== ;=============================================================================== ; MAIN ;=============================================================================== HotKeySet("!x", "_done") ; alt+x will exit Global $iRandom = Random(300000, 600000, 1) ; 3 to 10 minutes initial random wait time Beep() ; and why not? While 1 If _Get_Idle_Ticks() > $iRandom Then _MoveMouse() ; move the mouse and moves it back, see function for description $iRandom = Random(300000, 600000, 1) ; 3 to 10 minutes reset of random wait time Beep() ; and why not? EndIf Sleep(5000) ; wait 5 seconds in loop WEnd ;=============================================================================== ; Functions ;=============================================================================== ;=============================================================================== ; Description: Moves the mouse a specified number of pixels and then moves it back ; Parameter(s): $PixX = number of pixels to move in X coord ; $PixY = number of pixels to move in Y coord ; $Speed = 0 ; Requirement(s): None ; Return Value(s): None ; Note(s): High movement values make it look weird ;=============================================================================== Func _MoveMouse($PixX = 1, $PixY = 1, $Speed = 0) ; speed of zero is instantaneous Local $X = $PixX, $Y = $PixY Local $_aPos = MouseGetPos() ; 1st get Mouse x, y: and store in array MouseMove($_aPos[0] + $X, $_aPos[1] + $Y, $Speed) ; move Mouse to Mouse X + $X, Mouse y + $Y MouseMove($_aPos[0], $_aPos[1], $Speed) ; now move back to original coordinates EndFunc ;==>_MoveMouse ;=============================================================================== ; Description: Exits and resets hotkey ; Parameter(s): None ; Requirement(s): None ; Return Value(s): None ; Note(s): ;=============================================================================== Func _done() HotKeySet("!x") Exit EndFunc ;==>_done ;=============================================================================== ; Description: Returns number of ticks since system was idle (determined by mouse/key input) ; Parameter(s): None ; Requirement(s): None ; Return Value(s): Milliseconds since last user input (mouse/key) ; Note(s): ;=============================================================================== Func _Get_Idle_Ticks() Local $struct = DllStructCreate("uint;dword") ; DllStructSetData($struct, 1, DllStructGetSize($struct)) ; DllCall("user32.dll", "int", "GetLastInputInfo", "ptr", DllStructGetPtr($struct)) Local $last_active = DllStructGetData($struct, 2) Return _Date_Time_GetTickCount() - $last_active EndFunc ;==>_Get_Idle_Ticks
  8. Thanks, @seadoggie01!
  9. This is really great. I've been trying to figure out if I can right-justify (place above the notification icons) or center this but it's beyond my reach at the moment. 😞
  10. @Subz and @Malkey, thank you! I knew there had to be a cleaner way to do this. I will now try to actually understand your examples. ðŸĪŠ
  11. So I am parsing some log files and I grab from them a date and a byte count. But - on some days, there is more than one entry, example in the code below on 3/11/2020 there are two entries. I need to combine the byte counts for the days that have duplicates (and output the byte counts in GB, but that is the easy part). It took me a while to get this sorted but the below appears to work OK, yet I can't help but think there is a better/cleaner way to do it. Anyone have ideas? #include <array.au3> Local $a_inArr[7][2] = [["2020-03-11", "122589268273"], ["2020-03-12", "6901211441"], ["2020-03-13", "6934371045"], ["2020-03-11", "6428227853"], ["2020-03-16", "7358355171"], ["2020-03-17", "7113079607"], ["2020-03-18", "6907515243"]] Local $a_outArr[0][2] $a_fndDup = _ArrayUnique($a_inArr) For $i = 1 To UBound($a_fndDup) - 1 $a_fndArr = _ArrayFindAll($a_inArr, $a_fndDup[$i]) If IsArray($a_fndArr) And UBound($a_fndArr) >= 2 Then Local $s_totDta = 0 For $j = 0 To UBound($a_fndArr) - 1 $s_date = $a_inArr[$i][0] $s_totDta = $s_totDta + $a_inArr[$a_fndArr[$j]][1] Next _ArrayAdd($a_outArr, $a_fndDup[$i] & "|" & Round($s_totDta / 1073741824, 2)) EndIf Next For $i = 0 To UBound($a_outArr) - 1 For $j = 1 To UBound($a_inArr) - 1 If $a_inArr[$j][0] <> $a_outArr[$i][0] Then _ArrayAdd($a_outArr, $a_inArr[$j][0] & "|" & Round($a_inArr[$j][1] / 1073741824, 2)) Next Next _ArraySort($a_outArr) _ArrayDisplay($a_inArr, "Inbound Array", Default, Default, Default, "Date|Bytes") _ArrayDisplay($a_outArr, "Outbound Array", Default, Default, Default, "Date|GB")
  12. I did but did not get to try it. I have it set as a "follow up", so to speak. 😕
  13. Thank you @seadoggie01, but I need to set the follow=up flag for the recipient. The followup flag would have to be set in the message before it was sent.
  14. Do you need to put the array from PixelSearch to use later in your code? If so then maybe something like: $a_pos = PixelSearch(1580, 529, 1580, 529, 0x484A3F, 1) $a_pos2 = PixelSearch(1594, 579, 1594, 579, 0x3E423F, 1) If Not IsArray($a_pos) And Not IsArray($a_pos2) Then ConsoleWrite("Neither are an array, and so PixelSearch found nothing." & @CRLF) Else ConsoleWrite("PixelSearch did return an array." & @CRLF) EndIf If not then you can: If Not IsArray(PixelSearch(1580, 529, 1580, 529, 0x484A3F, 1)) And Not IsArray(PixelSearch(1594, 579, 1594, 579, 0x3E423F, 1)) Then ConsoleWrite("Neither are an array, and so PixelSearch found nothing." & @CRLF) Else ConsoleWrite("PixelSearch did return an array." & @CRLF) EndIf Of course if you don't need the Else you can make a one-line If..Then with your call to an action. @AutoBert, I tested with your script and it didn't work for me because you had declared a value for $bDoIt and thus it was always returning true for the If statement. I made a small correction and now this works but it's not how I would do it. Global $bDoIt $pos = PixelSearch(1580, 529, 1580, 529, 0x484A3F, 1) If Not @error Then $bDoIt = False If $bDoIt Then $pos2 = PixelSearch(1594, 579, 1594, 579, 0x3E423F, 1) If Not @error Then $bDoIt = False EndIf If $bDoIt Then ConsoleWrite("$bDoIt true" & @CRLF);here the stuff what' to be done Else ConsoleWrite("$bDoIt false" & @CRLF);here the stuff what' to be done EndIf If I wanted to capture the @error value I'd: $a_pos = PixelSearch(1580, 529, 1580, 529, 0x484A3F, 1) If @error Then $a_pos = @error $a_pos2 = PixelSearch(1594, 579, 1594, 579, 0x3E423F, 1) If @error Then $a_pos2 = @error If $a_pos = 1 And $a_pos2 = 1 Then ConsoleWrite("Both have the same value of 1 which should only happen when there are errors." & @CRLF) Else ConsoleWrite("something else" & @CRLF) EndIf
  15. Says you! 😝 I am still a hack, I could not do this easily. Finding time is hard as I get older -> I have two grandchildren and another on the way. (Not that it's relevant to the topic - I'm just so happy about it I tell everyone). ðŸĪĐ
×
×
  • Create New...