Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/16/2020 in all areas

  1. ... through recursion MsgBox(0, '', _stringsInsertDelims('ABCDEF123456', 4)) ; inserts delimiters after each group of nr. characters and returns the resulting string Func _stringsInsertDelims($sString, $iGroupsLen = 1, $sDelim = '-') If Number($iGroupsLen) < 1 Then Return SetError(1, 0, $sString) Local $sSnippt = StringLeft($sString, $iGroupsLen) Local $sReminder = StringTrimLeft($sString, $iGroupsLen) If $sReminder <> '' Then $sSnippt &= $sDelim & _stringsInsertDelims($sReminder, $iGroupsLen, $sDelim) Return $sSnippt EndFunc ;==>_stringsInsertDelims
    2 points
  2. ...after 4000 posts... it happens
    2 points
  3. Turns out I did create a topic: I just found that out when looking at the header comments in my UDF, very weird, I searched for this topic but I did not find anything, so I assumed I did not create a topic. @Mods is it possible to merge this thread into the other one, with the new posts appended?
    2 points
  4. Well I added another example peak.au3 it uses the Windows sound AudioMeterInfo.GetPeakValue code and displays it in a SSLG graph See for Trancex's original code: https://www.autoitscript.com/forum/topic/142523-master-loudnessvolume-via-peak-meter-windows-7-64-bit/?tab=comments#comment-1003940 Unfortunately I found a few more bugs which are (fortunately) now fixed AddSample did not check if UpdateGraph was currently running causing the graph to be cleared If Grid was enabled SetResizeGraph did not draw new gridlines after the resize Couple of error numbers were changed to match between AddSample and UpdateGraph Increments are now recalculated after IncrementsSize is calculated
    2 points
  5. paw

    _Crypt reset issue

    You immediately encrypt after calling _Reset() (after your first EndSwitch). You could make crypt a function and call it in each case except for "standard". Like this While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Combo1 Switch GUICtrlRead($Combo1) Case "MD2" $g_iAlgorithm = $CALG_MD2 _Encrypt() Case "MD4" $g_iAlgorithm = $CALG_MD4 _Encrypt() Case "MD5" $g_iAlgorithm = $CALG_MD5 _Encrypt() Case "standard" _Reset() EndSwitch EndSwitch WEnd Func _Encrypt() _Crypt_Startup() $Input1Read = GUICtrlRead($Input1) $Input2Read = GUICtrlRead($Input2) GUICtrlSetData($Input1, StringTrimLeft(_Crypt_HashData($Input1Read, $g_iAlgorithm), 2)) GUICtrlSetData($Input2, StringTrimLeft(_Crypt_HashData($Input2Read, $g_iAlgorithm), 2)) _Crypt_Shutdown() EndFunc ;==>_encrypt
    1 point
  6. Or like you did it just for a note, note that the dateisvalid works even without expressing the time units after the space in the date but i'm guessing the digits in the date are mandatory for the function to return true #include <Date.au3> Local $aDate, $aTime, $verifyNumbersOnly, $checkDate, $aDateExamples[3] $aDateExamples[0] = "2007/12/12 05:22:09" $aDateExamples[1] = "2007/12/12 rr:rrfrr" $aDateExamples[2] = "2007/12/08 rrfrrfrr" For $i = 0 To UBound($aDateExamples) - 1 If Not StringRegExp(StringRegExpReplace($aDateExamples[$i], "[/: ]", ""), "\D") And _DateIsValid($aDateExamples[$i]) Then $checkDate = "Valid" Else $checkDate = "Not Valid" EndIf ConsoleWrite($aDateExamples[$i] & " returns: " & $checkDate & @CRLF) Next
    1 point
  7. Try this: #include <Date.au3> Local $aDate Local $aDateExamples = ["2007/12/12 05:22:09", "2007/12/12 rr:rrfrr", "2007/12/12 rrfrrfrr", "2007/12/12 35:22:09"] For $i = 0 To UBound($aDateExamples) - 1 Local $checkDate = "Valid" If Not (StringRegExp($aDateExamples[$i], "^\d\d\d\d[/-]\d\d[/-]\d\d \d\d:\d\d:\d\d$") And _DateIsValid($aDateExamples[$i])) Then $checkDate = "Not " & $checkDate EndIf ConsoleWrite($aDateExamples[$i] & " returns: " & $checkDate & @CRLF) Next
    1 point
  8. Let's wrap it into a function: #include <StringConstants.au3> ConsoleWrite(_StringDelimiter("ABCDEFGH123456", 2) & @CRLF) Func _StringDelimiter($strString, $intNumber) Return Mod(StringLen($strString), $intNumber) = 0 ? StringRegExpReplace($strString, '\w{' & $intNumber & '}\K(?!$)', '-') : '' EndFunc
    1 point
  9. Danyfirex

    WM_COPYDATA return

    Try declaring $stStr as Global on top of your script. Saludos
    1 point
  10. Jon

    AutoIt v3.3.15.3 Beta

    2,063 downloads

    3.3.15.3 (16th May, 2020) (Beta) AutoIt: - Added #3681: Lang Variable prefix "o". - Fixed #2915: Map memory leak. - Fixed: Map errors with index < 0. UDFs: - Changed #3620: Removed "stable" from _ArraySort function header. - Added #3670: DriveGetDrive() @error doc clarification. - Added #3574: GuiCtrlCreateInput() Doc $ES_AUTOHSCROLL precision. - Fixed: Problem with _WinAPI_GetFontResourceInfo & _WinAPI_GetFontMemoryResourceInfo - Fixed #3728: Added optional parameter to force single column 2D array to 1D. - Fixed #3678: Amended Help file to show that function with no text blanks a line, not removes it. - Fixed #3757: Added note to GUICtrlListView_SetColor* pages about need to use BGR format. - Fixed #3697: _WinAPI_GetOverlappedResult() failure.
    1 point
  11. No need to run it twice to get a valid error checking $String = "ABCDEF123456" $new = StringRegExpReplace($String, "^(\w{4})(\w{4})(\w{4})$", "$1-$2-$3") MsgBox(0, @extended ? "ok" : "error", @extended ? $new : "error" )
    1 point
  12. $SerialStringExample1 = "ABCDEF123456" $delimiters1 = StringRegExpReplace($SerialStringExample1, '\w{4}\K(?!$)', '-') MsgBox(0,0, $delimiters1)
    1 point
  13. Zero0, Welcome to the AutoIt forum. A simple way is to use a RegEx like this: #include <MsgBoxConstants.au3> $sSerialStringExample1 = "ABCDEF123456" $sDelimiters1 = StringRegExpReplace($sSerialStringExample1, "(.{4})(.{4})(.{4})", "$1-$2-$3") MsgBox($MB_SYSTEMMODAL, "Delimited", $sDelimiters1) No doubt a RegEx guru will be along shortly to explain why that is not the best way , but it works for me! M23
    1 point
  14. ripdad

    TCP Send Message

    Happy to help when I can!
    1 point
  15. SciTE Customization GUI is intended to be your one-stop solution for your SciTE customization needs. With SciTE Customization GUI you can create new themes from scratch without having to touch a single configuration file. Simply select 'Default Theme' from the file menu. This will start you out with a default theme. Then make your changes to the theme. Finally, select 'Save As' from the file menu and give it a name. Or you can select from an already existing theme. You can see live changes to SciTE as you change things around (some settings are not live). You can change various SciTE4AutoIt3 settings such as Tidy, Tools, debug trace messages, etc. I mostly want to try out new ideas which I hope will get used in the official SciTE4AutoIt3. I also wanted to see how large of a program I could script in AutoIt before it become a mass of unmaintable spaghetti. I feel that I am successful in that regard. It is reasonably easy to debug, extend and understand. I feel that this was achieved by employing the Model-View-Controller pattern. I also used AutoItObject which allows me to achieve a level of information hiding which would not have been possible otherwise. I stand on the shoulders of giants so credit where credit is due. Thanks to Jos for the original SciTEConfig. Thanks to Jon for AutoIt. Melba23 for the SciTE Abbreviation Manager and the SciTE UserCalltip Manager. Credits and changelog have be moved to the script. Note: this is not an official script. Jon, Jos or the rest of the AutoIt team do not provide support. That's all up to me. SciTE Customization GUI.zip -- downloads: ~5253 SciTE Customization GUI -- Source.zip -- Includes all of the required dependencies.
    1 point
  16. You can use AdlibRegister to do this GUICreate("", 200, 200) Global $Label1 = GUICtrlCreateLabel("1", 100, 100, 50, 50) GUICtrlSetFont(-1, 38, 400, 0, "Arial Rounded MT Bold") GUICtrlSetColor(-1, 0xFFFFFF) GUISetState(@SW_SHOW) AdlibRegister("_Count", 1000) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case -3 Exit EndSwitch WEnd Func _Count() Local Static $var1 = 1 $var1 += 1 If $var1 = 4 Then Exit GUICtrlSetData($Label1, $var1) EndFunc
    1 point
  17. Ascend4nt

    _RunWithReducedPrivileges

    _RunWithReducedPrivileges An odd thing about Vista+ O/S's is that, once you run a process in elevated privileges mode, you can't run other processes in lower-privileged modes. Why, you ask, would that be important? Sometimes you want - or need - to limit the privileges of a process: A very common scenario for me is drag-and-drop. Windows' Explorer does NOT allow this to occur between lower privileged processes (like Explorer itself!) and other processes. This is very frustrating for users in programs that take advantage of that. There's also some problems using certain SendMessage commands from other unelevated processes.Setting the state or properties of windows that have an elevated privilege may not work either from other unelevated processes..An install or setup program that needs to launch the installed program will more often than not want to run that program on a lower privilege level (for some of the reasons mentioned above)So, after some looking around I found a way of running processes under a lower privilege mode.Check Elmue's comment 'Here the cleaned and bugfixed code' on this CodeProject page to see where my code was ported from:'Creating a process with Medium Integration Level from the process with High Integration Level in Vista' The usage is straightforward for this one: use it like Run/RunWait, but with the command-line as the 2nd parameter. [i.e. _RunWithReducedPrivileges(@ComSpec,' /k title Non-Admin prompt') ] Anyway, hope this helps someone out! Ascend4nt's AutoIT Code License agreement: While I provide this source code freely, if you do use the code in your projects, all I ask is that: If you provide source, keep the header as I have put it, OR, if you expand it, then at least acknowledge me as the original author, and any other authors I creditIf the program is released, acknowledge me in your credits (it doesn't have to state which functions came from me, though again if the source is provided - see #1)The source on it's own (as opposed to part of a project) can not be posted unless a link to the page(s) where the code were retrieved from is provided and a message stating that the latest updates will be available on the page(s) linked to.Pieces of the code can however be discussed on the threads where Ascend4nt has posted the code without worrying about further linking.Download the ZIP from my site
    1 point
  18. Hi and wellcome to the forum! Try this: Global $iLoop = True HotKeySet("{ESC}", "_ExitLoop") Func Button1() $iLoop = True While $iLoop StealMedium() If Not $iLoop Then ExitLoop StealAuto() If Not $iLoop Then ExitLoop DrivingLicense() If Not $iLoop Then ExitLoop Shootingrange() If Not $iLoop Then ExitLoop WEnd $iLoop = False EndFunc Func _ExitLoop() $iLoop = False EndFunc
    1 point
  19. Either, as you stated: $i = $i + 1 or else $i += 1
    1 point
  20. @Steph GuiCtrlSetState (ControlID, $GUI_DISABLE) Emiel
    1 point
  21. wyf

    AutoIt v3.3.15.3 Beta

    3.3.15.3 Still not included _GUICtrlHeader_GetFilterText ()
    0 points
×
×
  • Create New...