Jump to content

iamtheky

Active Members
  • Posts

    4,646
  • Joined

  • Last visited

  • Days Won

    46

Reputation Activity

  1. Haha
    iamtheky got a reaction from DaveScotese in Why AutoIt, and not another language like C# or Python?   
    1) From idea on the shitter --> proof of concept   is rarely measured in anything other than minutes.
    2) The helpfile is gd amazing (which often facilitates #1).
    3) people who have to maintain your uncommented code in the future get the luxury of 1 and 2.
     
  2. Like
    iamtheky got a reaction from noellarkin in Coding Autoit & RESPECT   
    Debating hammer efficacy is a lot less fun than building shit.  Explain that they are supposed to use the tools not be the tools. 
    These threads make me think of this meme, and i giggle every time. 
     

  3. Haha
    iamtheky got a reaction from NoNameCode in Coding Autoit & RESPECT   
    Debating hammer efficacy is a lot less fun than building shit.  Explain that they are supposed to use the tools not be the tools. 
    These threads make me think of this meme, and i giggle every time. 
     

  4. Like
    iamtheky got a reaction from SkysLastChance in compare 2 arrays with 3 arrays as a result   
    #include <Array.au3> Global $aCompare1[10] = [1, 3, 5, 6, 7, 8, 9, 10, 11, 12] Global $aCompare2[10] = [1, 2, 3, 4, 5, 6, 8, 10, 12, 13] Global $aBoth[0] For $i = ubound($aCompare1) - 1 to 0 step -1 $iMatch = _ArraySearch($aCompare2 , $aCompare1[$i]) If $iMatch <> -1 then _ArrayAdd($aBoth , $aCompare1[$i]) _ArrayDelete($aCompare1 , $i) _ArrayDelete($aCompare2, $iMatch) EndIf Next For $i = ubound($aCompare2) - 1 to 0 step -1 $iMatch = _ArraySearch($aCompare1 , $aCompare2[$i]) If $iMatch <> -1 then _ArrayAdd($aBoth , $aCompare2[$i]) _ArrayDelete($aCompare2 , $i) _ArrayDelete($aCompare1 , $iMatch) EndIf Next _ArrayDisplay ($aBoth, "In Both") _ArrayDisplay ($aCompare1, "Only in Compare 1") _ArrayDisplay ($aCompare2, "Only in Compare 2")
  5. Like
    iamtheky got a reaction from levila in run powerhsell command with input   
    have the user supply it beforehand, something like:
    $sName = inputbox('put yer name here'.........
    $CMD = 'New-psDrive ' & $sName
     
  6. Like
    iamtheky got a reaction from TheDcoder in AutoIt Snippets   
    You edited it to be additionally patronizing and are recommending a solution that involves redims as an improvement to a snippet that has none?  That is super.
    Dcoder, there are older examples, and i think the speed can be improved on yours.  And apparently you have upset Guinness, so that part is at least right.
    .https://www.autoitscript.com/forum/topic/120801-converting-array-1d-2d/
  7. Thanks
    iamtheky got a reaction from Romano71 in _StringBetween question   
    Your line looks for everything between "BOOK<colon><space>" and the next <space>"
    Your example does not contain the string BOOK, but if it followed that pattern would be "BOOK<space><colon><space>"
    You probably just want everything between your target and the carriage return
    Local $aFileRead = _StringBetween($sFileRead, "BOOK: ", @CRLF)  
  8. Like
    iamtheky reacted to mikell in Help understanding StringRegExp.   
    Hmm I also know that this assertion is not exactly true 
    But I'm surprised you didn't suggest such a solution
    $s = "Movie (0000) (part1000) (2002)" $r = StringSplit(StringMid($s, 1, StringInStr($s, "(", 0, -1)-1) & @crlf & StringMid($s, StringInStr($s, "(", 0, -1)+1, 4), @crlf, 3) _ArrayDisplay($r)
  9. Like
    iamtheky reacted to mikell in Help understanding StringRegExp.   
    To just add a little '$' to the previous expression was not good enough ?
    #Include <Array.au3> $s = "Movie (0000) (part1000) (2002)" $a = stringregexp($s , "([^\\]*?)\h*\((\d+)\)$" , 3) _ArrayDisplay($a)  
    @ReconX
    The best way is to translate the expression in common language , i.e. ([^\\]*?) means : "please capture 0 or more non-backslash characters (lazy way)" , or \((\d+)\) means : "please capture one or more digits enclosed with parenthesis"
  10. Like
    iamtheky got a reaction from wolflake in Modifying all values in an array   
    have to think there is a regex solution to be had...something heading down the path of
    #Include <Array.au3> Local $a[2][2] = [[0,1],[10,20]] $s = StringRegExpReplace(_ArrayToString($a) , "(\d+)" , "\1 + 5") local $aNew[0][2] _ArrayAdd($aNew , $s) _ArrayDisplay($aNew)  
  11. Like
    iamtheky reacted to jchd in Experimental Maps UDF   
    While negative ints in keys don't hard crash in latest beta anymore, version 3.3.15.1 allowed that and worked:
    Local $m[] $m[-5] = "aaa" _ArrayDisplay(MapKeys($m)) ConsoleWrite($m[-5] & @LF) >Running:(3.3.15.1):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\jc\Documents\AutoMAT\tmp\t.au3" +>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart or Ctrl+BREAK to Stop. aaa +>04:24:08 AutoIt3.exe ended.rc:0 +>04:24:08 AutoIt3Wrapper Finished. >Exit code: 0 Time: 4.272  
  12. Haha
    iamtheky got a reaction from Mike25de in Coding Autoit & RESPECT   
    Debating hammer efficacy is a lot less fun than building shit.  Explain that they are supposed to use the tools not be the tools. 
    These threads make me think of this meme, and i giggle every time. 
     

  13. Like
    iamtheky reacted to Jon in AutoIt v3.3.15.2 Beta   
    AutoIt v3.3.15.2 Beta
    View File 3.3.15.2 (13th May, 2020) (Beta)
    AutoIt:
    - Fixed: Map elements being lost due to a deep-copy logic fail.
    Submitter Jon Submitted 05/13/2020 Category Beta  
  14. Thanks
    iamtheky got a reaction from zeenmakr in Problem with _ArrayDelete()   
    the helpfile also states
    so:
    local $aArray[6] = [1,2,3,2,5,2] $aDel = _ArrayFindAll($aArray , 2) _ArrayDelete($aArray , _ArrayToString($aDel , ";")) _ArrayDisplay($aArray) or reduced
    local $aArray[6] = [1,2,3,2,5,2] _ArrayDelete($aArray , _ArrayToString(_ArrayFindAll($aArray , 2) , ";")) _ArrayDisplay($aArray)
     
  15. Haha
    iamtheky got a reaction from Deye in powershell to array   
    In addition to all of the optimization suggestions, you have fundamental issues, the return from the run command is the PID not the STDOUT.   You can then use the PID to read the output of the command.  But WMI is already slow without asking powershell to ask WMI.
    ;#RequireAdmin #include <Constants.au3> #include <Array.au3> $pidPrintlist = Run("powershell.exe get-printer" , @SystemDir , @SW_HIDE, $STDOUT_CHILD) ProcessWaitClose($pidPrintlist) $out = StdoutRead($pidPrintlist) _ArrayDisplay(stringsplit($out , @CR , 2))  
    yeah, pretty much what @Deye said at the same time he said it
  16. Like
    iamtheky reacted to mikell in How to find dissimilar dictionary?   
    For the fun only 
    #include <Array.au3> ;Global $aArray[10] = ["a","a","b","c","c","d","e","c","e"] Global $aArray[7] = ['script', 'autoit', 'autoit', 'script', 'script', 'forum', 'autoit'] _ArraySort($aArray) $r = StringReplace(StringRegExpReplace(_ArrayToString($aArray), '^\||(\w+)\|(?:\1\|*)+', ""), "|", @crlf) msgbox(0,"", $r)  
  17. Like
    iamtheky got a reaction from alienclone in Invalid FileInstall() function   
    Based off CheckEE creates a custom exe that fileinstalls only the payload assigned to the variable 'filename'.  Some of it unnecessary, Rube Goldberg style.  
    ;~ ;----------------------------------------------------- ;#Local Variables Local $Check_EE ;~ ;----------------------------------------------------- ;~ ;----------------------------------------------------- $Check_EE = "A" ;--- IF $Check_EE == "A" Then assign("filename" , "A.exe") ElseIF $Check_EE == "B" Then assign("filename" , "B.exe") ElseIF $Check_EE == "C" Then assign("filename" , "B.exe") EndIF ;--- $tgtfile = "testfileinstall_writeonfly_" & $Check_EE ; file name based off result of If FileWrite($tgtfile & ".au3" , 'FileInstall("' & @ScriptDir & '\' & eval("filename") & '", "' & @ScriptDir & '\test\' & eval("filename") & '")') ; Write the au3 that does the thing you want runwait("cmd /c " & FileGetShortName(@ProgramFilesDir) & "\AutoIt3\Aut2Exe\Aut2exe.exe /in " & @ScriptDir & "\" & $tgtfile & ".au3") ; compiles that au3 to an exe of the same name in the same dir ;~ run(@ScriptDir & "\" & $tgtfile & ".exe") ; runs that exe  
  18. Like
    iamtheky got a reaction from r2du-soft in Invalid FileInstall() function   
    you can, but not like that
    ;----------------------------------------------------- ;#Local Variables Local $Check_EE ;----------------------------------------------------- ;----------------------------------------------------- $Check_EE = "A" ;--- IF $Check_EE == "A" Then assign("filename" , "A.exe") ElseIF $Check_EE == "B" Then assign("filename" , "B.exe") ElseIF $Check_EE == "C" Then assign("filename" , "B.exe") EndIF ;--- FileInstall (@ScriptDir & "\" & eval("filename"), @ScriptDir & "\test\" & eval("filename"), 1)  
  19. Like
    iamtheky got a reaction from r2du-soft in Invalid FileInstall() function   
    wrapping shit in execute like this doesnt work either, it gets past the compiler but the resulting script fails.  This might entertain while we find a fun way to pull it off without too much maneuvering.
    *Also, i feel that there is a long thread on this topic somewhere on the forum, but i cant find it yet.
    ftr, gets past compiler, does not work once compiled:
    ;----------------------------------------------------- ;#Local Variables Local $Check_EE ;----------------------------------------------------- ;----------------------------------------------------- $Check_EE = "A" ;--- IF $Check_EE == "A" Then assign("filename" , "A.exe") ElseIF $Check_EE == "B" Then assign("filename" , "B.exe") ElseIF $Check_EE == "C" Then assign("filename" , "B.exe") EndIF ;--- execute('FileInstall (@ScriptDir & "\" & eval("filename"), @ScriptDir & "\test\" & eval("filename"), 1)')  
  20. Like
    iamtheky got a reaction from alienclone in Invalid FileInstall() function   
    you can, but not like that
    ;----------------------------------------------------- ;#Local Variables Local $Check_EE ;----------------------------------------------------- ;----------------------------------------------------- $Check_EE = "A" ;--- IF $Check_EE == "A" Then assign("filename" , "A.exe") ElseIF $Check_EE == "B" Then assign("filename" , "B.exe") ElseIF $Check_EE == "C" Then assign("filename" , "B.exe") EndIF ;--- FileInstall (@ScriptDir & "\" & eval("filename"), @ScriptDir & "\test\" & eval("filename"), 1)  
  21. Like
    iamtheky reacted to Melba23 in 2DArrayInsertRow   
    HeyTom,
    Why not use the _ArrayInsert function - that is why I wrote it:
    #include <Array.au3> #include <String.au3> ; Create original array Local $aArray[6][3] For $i = 0 To 5 For $j = 0 To 2 $aArray[$i][$j] = $i & " - " & $j Next Next _ArrayDisplay($aArray, "2D - Original") ; Create array to insert Local $aFill[][] = [["New", "2 - 1", "2 - 2"], ["New", "3 - 1", "3 - 2"], ["New", "4 - 1", "4 - 2"], ["New", "5 - 1", "5 - 2"]] ; Create delimited string to show where to insert - we insert each time at line 2 $sRange = _StringRepeat("2;", UBound($aFill)) $sRange = StringTrimRight($sRange, 1) ; And insert it _ArrayInsert($aArray, $sRange, $aFill) _ArrayDisplay($aArray, "2D data with row delim string range") M23
  22. Like
    iamtheky got a reaction from mikell in Flatten .au3 to have includes as part of the raw code   
    Oh shit no, I rarely have an idea whats going in your scripts, i just copy and paste.  Yer where I get all my good string manipulation knowledge, tout cela est grâce a vous.
    Also, 100% of the french I know is either Tolstoy or vulgar.
  23. Haha
    iamtheky got a reaction from seadoggie01 in Flatten .au3 to have includes as part of the raw code   
    Oh shit no, I rarely have an idea whats going in your scripts, i just copy and paste.  Yer where I get all my good string manipulation knowledge, tout cela est grâce a vous.
    Also, 100% of the french I know is either Tolstoy or vulgar.
  24. Like
    iamtheky reacted to mikell in Flatten .au3 to have includes as part of the raw code   
    how disappointing...  I was sure yet that despite that you would be able to understand the script... 
  25. Haha
    iamtheky got a reaction from seadoggie01 in Flatten .au3 to have includes as part of the raw code   
    It's about time someone apologized for it!  
×
×
  • Create New...