-
Posts
4,646 -
Joined
-
Last visited
-
Days Won
46
iamtheky last won the day on July 1 2019
iamtheky had the most liked content!
About iamtheky
- Birthday 11/14/1979
Profile Information
-
Member Title
þヨⓡᅷ∈℃⊥
-
Location
Tx
iamtheky's Achievements
-
DaveScotese reacted to a post in a topic: Why AutoIt, and not another language like C# or Python?
-
noellarkin reacted to a post in a topic: Coding Autoit & RESPECT
-
NoNameCode reacted to a post in a topic: Coding Autoit & RESPECT
-
SkysLastChance reacted to a post in a topic: compare 2 arrays with 3 arrays as a result
-
levila reacted to a post in a topic: run powerhsell command with input
-
TheDcoder reacted to a post in a topic: AutoIt Snippets
-
AutoIT nested dictionary - print using recursion
iamtheky replied to Renderer's topic in AutoIt General Help and Support
calling them back the way trancexx suggested in the above thread is the only way dictionary in dictionary ever really played nice for me (the add keyvaluepair function is just a wrapped add). -
Romano71 reacted to a post in a topic: _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)
-
Calling all RegEx Masters...
iamtheky replied to JockoDundee's topic in AutoIt General Help and Support
while "remove any character if preceded by 4 characters" is solid Is this task also: "remove any letter that is followed by whitespace"... maybe room to speed it up there? $txt = "g1f1 h3h2 f1e2 h2h1q a1h1 h8h1 f2f3n h1h4" & @crlf & _ "g1f3 h3h2 f1e2 h2h1n a1h1 h8h1 f4f1 h1h3" & @crlf & _ "f2f8 e7f8 e4f2 h3h2 e3e4 d5e4 f2e4 h2h1q d4g1 h1e4 g1f2 g7g5" msgbox (0, '' , StringRegExpReplace($txt , "\D\s" , " ")) -
iamtheky reacted to a post in a topic: Help understanding StringRegExp.
-
iamtheky reacted to a post in a topic: Help understanding StringRegExp.
-
Help understanding StringRegExp.
iamtheky replied to ReconX's topic in AutoIt General Help and Support
you know i dont know what any of those characters mean. if i cant .*? it, i use yours. -
Help understanding StringRegExp.
iamtheky replied to ReconX's topic in AutoIt General Help and Support
it seems to do the thing. However, if you just want two groups "date / everything else" and if all of your titles have a parenthetical 4 digit year at the end of the string, then i would be specific about the number of digits and end of the string. Scoops up a bunch of edge cases with a small modification. $s = "Movie (0000) (part1000) (2002)" ;~ $a = stringregexp($s , "([^\\]*?)\h*\((\d+)\)" , 3) ;~ _ArrayDisplay($a) $a = stringregexp($s , "(.*?)(\(\d{4}\)\z)" , 3) _ArrayDisplay($a) -
Search all Files for specific strings and replace them
iamtheky replied to Hyflex's topic in AutoIt General Help and Support
working backwards, looks like you just need to replace the dividers. Can probably run them all through the same func. #include<array.au3> local $aTest[6]=["C:\test1\test2\test3" , "C:\\test1\\test2\\test3" , "C:\\\test1\\\\test2\\\\test3" , "C:/test1/test2/test3" , "C:///test1///test2///test3" , "C:////test1////test2/////test3" ] $aScriptDir = stringsplit(@ScriptDir , "\" , 2) For $i = 0 to ubound($aTest) - 1 $sDiv = stringregexp($aTest[$i] , "\w:(.*?)\w" , 3)[0] $aTest[$i] = "" For $j = 0 to ubound($aScriptDir) - 1 $aTest[$i] &= $aScriptDir[$j] & $sDiv Next Next _ArrayDisplay($aTest) try 2, same result (hopefully) but a little more portable. probably still needs cleaning to verify the drive letter and catch edge cases, but definitely doable. #include<array.au3> local $aTest[6]=["C:\test1\test2\test3" , "C:\\test1\\test2\\test3" , "C:\\\test1\\\\test2\\\\test3" , "C:/test1/test2/test3" , "C:///test1///test2///test3" , "C:////test1////test2/////test3" ] For $i = 0 to ubound($aTest) - 1 $aTest[$i] = StringReplace(@ScriptDir , "\" , stringregexp($aTest[$i] , "\w:(.*?)\w" , 3)[0]) Next _ArrayDisplay($aTest) -
iamtheky reacted to a post in a topic: Experimental Maps UDF
-
key = 0-1 And the map UDFs that move beyond the handful of core functions could definitely stand a revisit (at least once every 4 years). I think my https://www.autoitscript.com/forum/topic/174758-scriptingdictionary-in-the-role-of-map/ may suffer from bloat more than the others, but things like the _Map_Append function wrap a one liner that takes less characters to write than the function call. But going down those trails allow you to pull off tricks that I would like to see incorporated more, like this mapappend fun:
- 22 replies
-
- maps
- new datatype
-
(and 2 more)
Tagged with:
-
iamtheky reacted to a post in a topic: AutoIt v3.3.15.2 Beta
-
Use AutoIT to open a file in Microsoft TEAMS
iamtheky replied to Valnurat's topic in AutoIt General Help and Support
Teams is Sharepoint. (the calls are coming from inside the house!!) - open your https://delve.office[.]com (or if govcloud https://delve-gcc.office[.]com/) From there you can hit the ellipses and copy the ugly link. Use one of those as the template. Also, switching to the UNC path... edit: just had a thought about cloud shell but i need to go try it rather than yolo it into your thead -
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)
-
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
-
iamtheky reacted to a post in a topic: How to find dissimilar dictionary?
-
Read last 10 lines of text file
iamtheky replied to maloysius's topic in AutoIt General Help and Support
#include<array.au3> msgbox(0, '' , _ArrayToString(FileReadToArray("test.txt") , @LF , @extended - 10)) this one only pulls the last 10 $fTest = fileopen("test.txt") $i = 10 $sOut = "" $total = ubound(filereadtoarray($ftest)) ;_filecountlines($ftest) do $sOut &= FileReadLine($fTest , $total - $i) & @LF $i -= 1 until $i = 0 fileclose($ftest) msgbox(0, '' , $sOut) -
Invalid FileInstall() function
iamtheky replied to r2du-soft's topic in AutoIt General Help and Support
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 -
Invalid FileInstall() function
iamtheky replied to r2du-soft's topic in AutoIt General Help and Support
- If you can F5 it you can make it happen on the target. Boredom made me give the question a plausible backstory like a server building custom deploys. Asking if that's the optimal way to gather/stage files is what I would do if I wasnt stuck in quarantine, instead I am going to spend a couple of days to relearn all the fun ways to write droppers. - At worst, you have all the information at the end of that function to have the script write the line into a separate au3 on the fly and fire it. And you find 1 or both of those to be Sisyphean? I don’t see this ending with “you can’t” so much as in a sea of workarounds. -
Invalid FileInstall() function
iamtheky replied to r2du-soft's topic in AutoIt General Help and Support
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)') -
Invalid FileInstall() function
iamtheky replied to r2du-soft's topic in AutoIt General Help and Support
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)