Jump to content

argumentum

MVPs
  • Posts

    4,943
  • Joined

  • Last visited

  • Days Won

    151

argumentum last won the day on August 7

argumentum had the most liked content!

About argumentum

Profile Information

  • Member Title
    ✨Universalist ✨
  • Location
    I'm in your browser now =)
  • WWW
    https://www.youtube.com/watch?v=SjwX-zMRxO0&t=5s
  • Interests
    Relax

Recent Profile Visitors

13,102 profile views

argumentum's Achievements

  1. Local $pid = Run(@ComSpec & " /c netsh interface ipv4 show config", "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) Local $resultado = "" Do $resultado &= StdoutRead($pid) Until @error MsgBox(0, "", BinaryToString(StringToBinary($resultado, 1), 4)) Exit this worked as expected _OemToStr($sOEM, $iCodepage = 65001) ; also worked just fine.
  2. Zip the file so that I can download it in my Portuguese Win11 and see what you see.
  3. Am installing his version and language to see what would work 🤯
  4. ConsoleWrite('- ' & HourAmPm("1999/12/31 18:59:59.999", Default, 7, True) & @CRLF) ; - 06:59 PM Added "NoDate" because in the pic shows a full date and time but also say in 90 minutes so, might as well exclude the date because, dah
  5. The function header is thanks to your "press F10" toy @ioa747
  6. And !, I don't disagree. But I've been here for so long that my brain has a hard time..., feeling, what time it is. As far as time formats, the one that comes out of AutoIt's Date.au3 UDF is YYYY/MM/DD HH:MM:SS and this HourAmPm() is just for that scenario. I have become personally fond of the YYYY/MM/DD format and that !, should be mandatory everywhere too I added the "( yes, one more )" to the title, because there are a bunch of all encompassing AM/PM functions in the forum that I found to be "overengineered". I use this in my personal stuff: and is not American or any counties standard. Is AutoIt's standard that I liked, plus the AM/PM I did think of that ( $sSign = "AM/PM" ) , but I'll replace $iSignUpper with $sSign = "AM/PM", as it does make it more usable. That I'll change.
  7. ; #FUNCTION# ==================================================================================================================== ; Name...........: HourAmPm ; Description....: Converts a time in 24-hour format to AM/PM format. ; Syntax.........: HourAmPm( $sDateTime [, $sAmPm = "AM|PM" [, $iTrimRight = 0]] ) ; Parameters.....: $sDateTime - The time (with date or not) string with "HH:" in it. ; $sAmPm - [optional] The AM/PM representation (default is "AM|PM"). ; $iTrimRight - [optional] The number of characters to trim from the right of the result (default is 0). ; $iNoDate - [optional] Whether to omit the date from the output. Defaults to False. ; Return values .: Success: Returns the formatted date and time in AM/PM format. ; Failure: None. ; Author ........: argumentum ; Modified ......: ; Remarks .......: This function takes a 24-hour time string, converts it to AM or PM format, and returns the result with optional trimming. ; Related .......: ; Link ..........: https://www.autoitscript.com/forum/index.php?showtopic=213061 ; Example .......: MsgBox(64, "Converted Time", HourAmPm("12/31/1999 18:59:59")) ; =============================================================================================================================== Func HourAmPm($sDateTime, $sAmPm = Default, $iTrimRight = Default, $iNoDate = Default) Local $aAmPm = StringSplit((StringInStr($sAmPm, "|") ? $sAmPm : "AM|PM"), "|"), $sFormat = $aAmPm[2] Local $iHourPos = StringInStr($sDateTime, ":"), $sHour = StringMid($sDateTime, $iHourPos - 2, 2) Local $sDate = StringLeft($sDateTime, $iHourPos - 3), $sTime = StringTrimLeft($sDateTime, $iHourPos - 1) If $sHour < 12 Then $sFormat = $aAmPm[1] ; https://www.autoitscript.com/forum/index.php?showtopic=213061 $sHour = Mod($sHour, 12) If Not $sHour Then $sHour = 12 Return StringTrimRight((Int($iNoDate) ? "" : $sDate) & StringRight('0' & $sHour, 2) & $sTime, Int($iTrimRight)) & " " & $sFormat EndFunc ;==>HourAmPm ...am always looking for these ( because am disorganized ) and when I find them they are more than needed so, I decided to simplify it and flexibly-cate** it. All that's needed is the hour, the rest of the date-time string should be anything as long as there is a "HH:" in it. ; Examples: ConsoleWrite('- ' & HourAmPm("18:59") & @CRLF) ; - 06:59 PM ConsoleWrite('- ' & HourAmPm("18:59:59.999") & @CRLF) ; - 06:59:59.999 PM ConsoleWrite('- ' & HourAmPm("1999/12/31 18:59:59.999") & @CRLF) ; - 1999/12/31 06:59:59.999 PM ConsoleWrite('- ' & HourAmPm("1999/12/31 18:59:59.999", Default, 7) & @CRLF) ; - 1999/12/31 06:59 PM ConsoleWrite('- ' & HourAmPm("1999/12/31 18:59:59", Default, 3) & @CRLF) ; - 1999/12/31 06:59 PM ConsoleWrite('- ' & HourAmPm("12/31/1999 18:59", "a|p") & @CRLF) ; - 12/31/1999 06:59 p ConsoleWrite('- ' & HourAmPm("1999/12/31 18:59:59.999", Default, 7, True) & @CRLF) ; - 06:59 PM Don't remember seeing this approach anywhere so I decided to share it **flexibly-cate [verb] To make it flexible
  8. ..but you did, and I personally appreciate the sharing of your results
  9. Fortunately npcap has these "&" that allows you to, instead of aiming the mouse, send the "ALT + n" to the window. Try that.
  10. ...the batch file is just the basics, to extract the files within it and a "run" command at the end. The rest of the cleanup ( delete the temp *.b64 files, etc. ) will have to be coded in the running script. In the example the command starts with "start" to free the batch file and exit it ( the batch file ) but you can just execute and by the nature of it ( a batch file ) it will wait until the last command executed. Therefore, add the deletion of every file other than itself ( the batch file ) after the run command. I bet you know these things but I wanted to clear my head
  11. Ok !. The the trac entry is marked as fixed
  12. Oh, ..that's you and me too. I don't do batch files because I use AutoIt as a batch file ( of sorts ). The code is very friendly. The function "_extract_b64_batch_chunk()" will extract all these files that have the tag "::filename:". Adding one more file, is a matter of adding another: ... ; we do the same for the other file(s) FileWriteLine($sWorkingDir & "\" & $sBatchFileToMake, "::filename:" & $sMyScript & ".b64" & @CRLF) RunWait(@ComSpec & ' /c type "' & $sWorkingDir & '\' & $sMyScript & '.b64" >>"' & $sWorkingDir & '\' & $sBatchFileToMake & '"', $sWorkingDir, @SW_HIDE) FileWriteLine($sWorkingDir & "\" & $sBatchFileToMake, @CRLF) ; again, add a separator for, the heck of it ... that at the end of the b64 to binary rebuilding/extraction, will run the rest of the batch file: ... ; then we add the run/start command, in this case autoit3.exe MyScript.au3 FileWriteLine($sWorkingDir & "\" & $sBatchFileToMake, @CRLF & ':runThem' & @CRLF & _ 'start ' & $sAutoItExe & ' "' & $sMyScript & '"' & @CRLF) ... May look as bit hard to wrap your head around it, but is as simple and straight forward as it can be. Be patient with the code. What I posted here as an explanation is chunks from that same script. I don't like the hacky idea of this solution but you only have 500 installs to do and this should work. Not that it will without a doubt but, give it a try.
  13. #include <Array.au3> _ArrayFromString ( $sArrayStr [, $sDelim_Col = "|" [, $sDelim_Row = @CRLF [, $bForce2D = False [, $iStripWS = $STR_STRIPLEADING + $STR_STRIPTRAILING]]]] ) $bForce2D [optional] default is False. True will force a 2 dimensional array even if 1 dimensional. If it does not work as described, let me know to fix it.
  14. ..and a question unrelated to the thread should go in a help area instead of taking one over. Ditto.
×
×
  • Create New...