Leaderboard
Popular Content
Showing content with the highest reputation on 01/25/2016 in all areas
-
Notify - New version 17 Mar 22
pixelsearch reacted to Melba23 for a topic
[NEW VERSION] - 17 Mar 22 Added: A new function _Notify_Size which allows you to adjust the size of the notification from its default 160x40. Please read the function header to see the max/min sizes that you can set for the width and height - the function returns informative @error/@extended values if these are not respected. Regardless of the size set, each notification will still display only 2 lines of text with the size of font used set automatically by the UDF. New UDF in the zip below. Previous changes: Changelog.txt A while ago I was asked to help port an AHK UDF to AutoIt. This was not too difficult and I found it useful myself (as a replacement for ConsoleWrite when debugging compiled scripts among other things). I have been polishing it for a while and thought I might release it in case it proves useful to anyone else. The notifications produced by Notify are small 2-line boxes that pop out of the edge of the display one above the other (you can select which side and in which direction they appear) - you can have as many as you want although only as many as can fit on your display will appear, the others will appear as soon as there is room. You can select whether they will retract after a certain time and/or when clicked. Colours and font are user-definable, and you can add an icon or image (bmp, jpg, gif or png) if you wish. When a notification retracts, the others move to leave space for more (you can select a smoooth slide or an instant move) - run the examples to see them in action. If you find the default sizing of the notifications is not to your liking you can change it by amending these values in the UDF (lines #354-356): ; Set default auto-sizing Notify dimensions Local $iNotify_Width_max = 300 Local $iNotify_Width_min = 150 Local $iNotify_Height = 40 A zip containing the UDF, example scripts and my StringSize UDF (which is also required): Notify.zip As usual happy for comments and/or compliments. M231 point -
Some Graphical Examples using GDI+ Vol. II
ShakibHasan reacted to UEZ for a file
1 point -
A fully detailed "What to know" for Maps101 can be found here I'm here to explain my opinion over maps, i like it so much, give to autoit someting of object orientet... I want to talk of the use i got from maps, specificlly Multi-Dimensional Maps Maps101 usage Global $mObj[] ; can be stored Global here, local inside a function or somiething like that $mObj.instance=1 ;the mObjct . instance was declared to be 1 or true msgbox(0,"",$mObj.instance) really easy, not? now something more hard i was impressed to the semplicity of maps give me to realize an artificial intelligence, a sort of little game of life (not konoweys) The maps can give you a multi-Dimensional tipe of array it's noting that $array[][] couldn't do but let me explain how much it's easyer thats a really simple algorithm that improve autoit object oriented like programming in this example i use some java syntax like to obtain someting like string.len or character.getPos.x else character.getPos.y ; i have a gridMap ;in one or more slot of the gridMap ;i have an individue, an essence, an object Global $aGridMap[10][10] ; declaring the grid map ; the gridMap goes from a range value of 0~9 ;now i want to instance some individue, essence or object ;on a grid of 10 x 10 i can declare 100 dinstincte object ;but i need to store it first in a multidimensional-Array Global $instance = 2 ;number of object that i want to initialize Global $aWorldArray[$instance][4] $aWorldArray[0][0] = 2 ;at this point i select a pos for the obj in the grid This is the x value $aWorldArray[0][1] = 4 ;this is the y vaue $aWorldArray[0][2] = 0x00FF00 ;this is the color of the element $aWorldArray[0][3] = "fruit" ;this is the type of the element $aWorldArray[1][0] = 5 ;same as up $aWorldArray[1][1] = 3 $aWorldArray[1][2] = 0xFF0000 $aWorldArray[1][3] = "animal" ;this dosen't look great, i really dosn't apprecciate this approach ;now i want to realize a sort of structure where i can modify the parameters how i want. ;_arrayToMaps transform the multidimensional array from world to a specified individue ;$array is the $aWorldArray, ;~ the $n is the instance, the element we want to grab Func _ArrayToMaps(ByRef $array, $n = 0);the byref grab the entire array Local $mIndividue[] ;preparing for maps Local $mPos[] ;creating the multidimension map for .x .y pos $mPos.x = $array[$n][0] $mPos.y = $array[$n][1] $mIndividue.getPos = $mPos ; with this trick someting magic appens, the .x .y was attached to the getPos node root $mIndividue.n = $n ;remember his own position into the world obj list $mIndividue.type = $array[$n][3] $mIndividue.color = $array[$n][2] ;we have now a single Individue from an array wolrd of objct ;but we want do more hazard thing :P let's destroy the compiler, (my brain maybe) ;we want the $mIndividue Maps store in its own node an entire multidimensional array $mIndividue.array = 0 ;a blank array node to the individue Local $aMultiDim[2][2] ; a structure that contain two names at [0][0] and [0][1] and two surname at [1][0] and [1][1] $aMultiDim[0][0] = "Mario" $aMultiDim[0][0] = "Mary" $aMultiDim[1][0] = "noodles" $aMultiDim[1][1] = "nuggets" ;let's add the multy dim array to $mIndividue.array $mIndividue.array = $aMultiDim ;now you have a complete $mIndividue that contain for example the name... ;How to use $mIndividue.array[1][0] to get "noodles" as a string! Absolutely crazy :D i've never seen or use something like that ;i really dosn't think that a map's really need a multidim array but that make the things more easyer ;i want now to operate with the individue structure, then return the map Return $mIndividue EndFunc ;==>_ArrayToMaps ;i make a function that operate on an individue obj type Func _changeSometing(ByRef $mIndividue) ;i want to move my object to an other position then $mIndividue.getPos.x = 6 $mIndividue.getPos.y = 3 ;i want to change the color then $mIndividue.color = 0x0000FF ;for blue, an hex RGB value, 0x 00 00 ff, on int it was R000 G000 B255 ;and i want also read some data from the array node Local $string = '' ;make a blanck string that contain the array info For $i = 0 To 1 For $u = 0 To 1 $string &= $mIndividue.array[$i][$u] & @CRLF ;usage of multidim array into the array map Next Next ;then output the array MsgBox(0, "lets Read the name!", $string) ;$string is only the concatenation of $mIndividue.array Return $mIndividue ;return the entire map! EndFunc ;==>_changeSometing ;i make now a function that rewrite back the individual information to a multidimensional array World Func _MapsToArray(ByRef $mIndividue) ;this time we don't need the position of the object in the array, because it was store in individue.n Local $n $n = $mIndividue.n ;get back it's own stacks $aWorldArray[$n][0] = $mIndividue.getPos.x ;at this point i select a pos for the obj in the grid This is the x value $aWorldArray[$n][1] = $mIndividue.getPos.y ;this is the y value $aWorldArray[$n][2] = $mIndividue.color $aWorldArray[$n][3] = $mIndividue.type ;useless because the $mIndividue.type wasn't changed but that eventually restore the value onto the world array obj ;~ $aWorldArray is stored globally then i don't need to return a parameters EndFunc ;==>_MapsToArray Func Main();i like to write a main function like c ;we have the entire project now let's concatenate ;~ i want my world array of obj goes to an single individue map then $aWorld = $aWorldArray ; i get the array parameter $mSingleObjectFromWorld = _ArrayToMaps($aWorld) ;given array tipe, return maps type MsgBox(0, "old Pos", $mSingleObjectFromWorld.getPos.x & @CRLF & $mSingleObjectFromWorld.getPos.y );read the pos $mSingleObjectFromWorld=_changeSometing($mSingleObjectFromWorld);lets the function modify someting MsgBox(0, "new Pos", _ $mSingleObjectFromWorld.getPos.x & @CRLF _ & $mSingleObjectFromWorld.getPos.y ) ;see what's changed ;now restore back the data to a single multidimensional array from each individue _MapsToArray($mSingleObjectFromWorld) ; thats restore the $mIndividue changes from single obj to the world multidim array of elements ;$mSingleObjectFromWorld know is index in the array, because it was stored as $mSingleObjectFromWorld.n where n is the array index EndFunc ;==>_Main Call("Main") easy explanation of possible uses one examples that took me into java syntax Func _simpleString($string);transofrm a string to someting like Java Local $mapString[] $mapString.string = $string $mapString.len = StringLen($string) Local $chAsci $chAsci = StringToASCIIArray($string) For $i = 0 To UBound($chAsci) - 1 $chAsci[$i] = Chr($chAsci[$i]) Next $mapString.char = $chAsci Return $mapString EndFunc ;==>_simpleString ;~-----the script starts here---- $strin = 'ciao' $mString = _simpleString($strin) MsgBox(0,"the string",$mString.string) MsgBox(0, "the lenght of the string", $mString.len) MsgBox(0, "the first character of the string", $mString.char[0]) MsgBox(0, "the last character of the string", $mString.char[$mString.len - 1]) isn't this like a well organizated structure?! i hope this was helpfull Kiss!1 point
-
#AutoIt3Wrapper_UseX64=N #include <MsgBoxConstants.au3> $wshShell = ObjCreate("wscript.shell") $strDesktop = $WshShell.SpecialFolders("Desktop") consolewrite("Folder " & $strDesktop & @CRLF) Example($strDesktop) Func Example($strFolder) ; Assign a Local variable the search handle of all files in the current directory. Local $hSearch = FileFindFirstFile($strFolder & "\*.*") ; Check if the search was successful, if not display a message and return False. If $hSearch = -1 Then MsgBox($MB_SYSTEMMODAL, "", "Error: No files/directories matched the search pattern.") Return False EndIf ; Assign a Local variable the empty string which will contain the files names found. Local $sFileName = "", $iResult = 0 While 1 $sFileName = FileFindNextFile($hSearch) ; If there is no more file matching the search. If @error Then ExitLoop ; Display the file name. $iResult = consolewrite("File: " & $sFileName & @CRLF) WEnd ; Close the search handle. FileClose($hSearch) EndFunc ;==>Example1 point
-
That wasn't too hard now was it. So the lesson for today: Stop the begging and start learning so you can get it done yourself. Jos1 point
-
Yes, actually, why all the whining at first?1 point
-
error471, Thanks, I will look into that. [Works for me as long as the empty ListView has the correct number of columns] [Now it works for all column values] That should not be too difficult. [Done] Go and read the function header for _GUIListViewEx_Init - that functionality is already incorporated in the UDF. That might be a bit more difficult as there is no native function on which to base the functionality. I will take a look, but only after I get the rest of it working (and you are not the only one looking for changes to this particular UDF). [I was wrong: there is a UDF function, but I am struggling to see how to implement it sensibly] M23 Edit 3: Do you see the "add column" functionality to work only when loading saved data (already done), or more generally?1 point
-
#include <Date.au3> $date = "2016/01/25 00:00:00" $t = _DateDiff("s", "1601/01/01 00:00:00", $date) & "0000000" ConsoleWrite( $t & @CRLF) $t = _DateDiff("s", "1601/01/01 00:00:00", _NowCalc()) & "0000000" ConsoleWrite( $t & @CRLF)1 point
-
Help with OutlookEX - Sending Email/ Monitoring File
9252Survive reacted to water for a topic
Just enter the name of the distribution list. For a list of recipients separate them with a semicolon.1 point -
ListView Input by Columm?
langthang084 reacted to BrewManNH for a topic
Try this change: If $Other <> '' Then ;MsgBox(0, '', $SubLine) _GUICtrlListView_AddSubItem($List_3, $SubLine, $Other, 1) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $SubLine = $SubLine + 1 EndIf1 point -
Hi UEZ, ...thanks for coming to see me here... In short, the purpose to get the dimension of the graphic object is because I'm "printing" dot matrix chars on the graphic object, and I have to wrap around to next line when I reach the right border. So I need to know the dimensions of the graphic object. Edit: I need to get dimensions in that way (directly from the graphic object) so that if I use different graphics objects, I can pass only his Handle to a function, and the dimension can be obtained directly from the handle of the graphic object instead of having to take track of the dimensions of any graphic used. Of course, I'm just playing "wild" with GDI+ for experimenting, so maybe I'm doing wrong steps. Anyway, here is what I'm playing with: While I was browsing around the web, I've seen this page: http://www.rinkydinkelectronics.com/r_fonts.php and I was curious to try to visualize those dot matrix fonts on a window with GDI+ so I wrote this draft and in some way it works... (even if this listing is a shit I'm proud anyway ). To be able to test it is necessary first download at least one of the DotMatrix fonts from the above page. The script will allow you to load the downloaded files from disk and will print using that dot matrix. I'm using the code provided by Danyfirex in lines from 70 to 75. #include <GDIPlus.au3> #include <String.au3> _GDIPlus_Startup() Global Const $aNibbles[16][2] = [ _ ["0000", "0"], _ ["0001", "1"], _ ["0010", "2"], _ ["0011", "3"], _ ["0100", "4"], _ ["0101", "5"], _ ["0110", "6"], _ ["0111", "7"], _ ["1000", "8"], _ ["1001", "9"], _ ["1010", "A"], _ ["1011", "B"], _ ["1100", "C"], _ ["1101", "D"], _ ["1110", "E"], _ ["1111", "F"]] ; Global Const $aDOS_color[16] = [ _ 0xFF000000, _ ; 0x0 = 00 = Black 0XFF000080, _ ; 0x1 = 01 = Blue 0XFF008000, _ ; 0x2 = 02 = Green 0XFF008080, _ ; 0x3 = 03 = Aqua 0XFF800000, _ ; 0x4 = 04 = Red 0XFF800080, _ ; 0x5 = 05 = Purple 0XFF808000, _ ; 0x6 = 06 = Yellow 0XFFC0C0C0, _ ; 0x7 = 07 = White 0XFF808080, _ ; 0x8 = 08 = Gray 0XFF0000FF, _ ; 0x9 = 09 = Light Blue 0XFF00FF00, _ ; 0xA = 10 = Light Green 0XFF00FFFF, _ ; 0xB = 11 = Light Aqua 0XFFFF0000, _ ; 0xC = 12 = Light Red 0XFFFF00FF, _ ; 0xD = 13 = Light Purple 0XFFFFFF00, _ ; 0xE = 14 = Light Yellow 0xFFFFFFFF]; ; 0xF = 15 = Bright White ; Global $iPixSide = 1, _ ; side of char's pixels $iVtab = 0, _ ; Vertical position of cursor $iHtab = 0, _ ; Horizontal position of cursor $iBG_DefaultColor = 0, _ ; Default Background color 0 = Black $iFG_DefaultColor = 10, _ ; Default Foreground color 7 = White $ahColors[2] = [ _ ; Array of brush handles _GDIPlus_BrushCreateSolid($aDOS_color[$iBG_DefaultColor]), _ ; default background for chars (Format AARRGGBB) _GDIPlus_BrushCreateSolid($aDOS_color[$iFG_DefaultColor])], _ ; default foreground for chars. $iWidth, _ ; Width in bit of char $iHeight ; height in bit of char HotKeySet("{ESC}", "_Terminate") ; ------------------ Local $iWinWidth = 500 Local $iWinHeight = 400 Local $hScreen = GUICreate("", $iWinWidth, $iWinHeight, 10, 10) Local $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hScreen) GUISetState(@SW_SHOW, $hScreen) Local $aFont, $tGraphic While 1 $aFont = _LoadFont() If IsArray($aFont) Then For $i = 0 To UBound($aFont) - 1 ; just for test, it prints all chars contained in the font _CharGen($hGraphic, $aFont[$i]); print a bitmapped char on the graphic object ; update cursor position $tGraphic = DllStructCreate("long width;long height", $hGraphic + 24) ; thanks to Danyfirex! $iHtab += ($iWidth * $iPixSide) If $iHtab > $tGraphic.width - ($iWidth * $iPixSide) Then $iVtab += ($iHeight * $iPixSide) $iHtab = 0 If $iVtab > $tGraphic.height - ($iHeight * $iPixSide) Then $iVtab = 0 EndIf Next EndIf _CharColor(Random(1, 15, 1)) ; random foreground color WEnd _Terminate() Func _CharGen($hGraphic, $vBits, $iBase = 8) If IsArray($vBits) Then ; if argument is an array then third parameter is ignored since it can be inferred from array dim and array content itself For $iRow = UBound($vBits) - 1 To 0 Step -1 ; UBound of array is the number of rows For $iBit = StringLen($vBits[$iRow]) To 1 Step -1;StringLen of array's content is the number of horizontal pixels _GDIPlus_GraphicsFillRect($hGraphic, _ ; it draws a single pixel at a time $iHtab + $iPixSide * $iBit, _ ; Horizontal pixel position within the matrix $iVtab + $iPixSide * $iRow, _ ; Vertical pixel position within the matrix $iPixSide, $iPixSide, _ ; pixel is a square $ahColors[StringMid($vBits[$iRow], $iBit, 1)]) ; bit 0 = background; bit 1 = foreground Next ; next horizontal pixel Next ; next row Else For $iBit = StringLen($vBits) - 1 To 0 Step -1 ; get all bits one by one _GDIPlus_GraphicsFillRect($hGraphic, _ ; it draws a single pixel at a time $iHtab + $iPixSide * Mod($iBit, $iBase), _ ; Horizontal pixel position within the matrix $iVtab + $iPixSide * Int($iBit / $iBase), _ ; Vertical pixel position within the matrix $iPixSide, $iPixSide, _ ; pixel is a square $ahColors[StringMid($vBits, $iBit + 1, 1)]) Next EndIf EndFunc ;==>_CharGen ; ------------------------------------------------------------ ; set Background and foreground colors for chars ; for DOS style pass 0x00 to 0xFF as single argument ; for custom colors use 0xAARRGGBB format for both arguments ; for reset to default colors just call func without arguments ; ------------------------------------------------------------ Func _CharColor($vBackGr = "", $vForeGr = "") If $vBackGr == "" And $vForeGr == "" Then ; set default _GDIPlus_BrushSetSolidColor($ahColors[0], $aDOS_color[$iBG_DefaultColor]) ; background _GDIPlus_BrushSetSolidColor($ahColors[1], $aDOS_color[$iFG_DefaultColor]) ; foreground ElseIf $vBackGr < 256 And $vForeGr = "" Then ; set as in DOS (use 0xNN N_=backgroung _N=foreground) $vForeGr = Dec(Hex($vBackGr, 1)) $vBackGr = Dec(StringLeft(String(Hex($vBackGr, 2)), 1)) _GDIPlus_BrushSetSolidColor($ahColors[0], $aDOS_color[$vBackGr]) ; background _GDIPlus_BrushSetSolidColor($ahColors[1], $aDOS_color[$vForeGr]) ; foreground Else ; set custom colors _GDIPlus_BrushSetSolidColor($ahColors[0], $vBackGr) ; background _GDIPlus_BrushSetSolidColor($ahColors[1], $vForeGr) ; foreground EndIf EndFunc ;==>_CharColor Func _LoadFont() ; Display an open dialog to select a list of file(s). Local $sFile = FileOpenDialog("Select a font file?", "", "All (*.c)", $FD_FILEMUSTEXIST) ; ; Read the file.c Local $hFile = FileOpen($sFile) Local $sFont = FileRead($hFile) FileClose($hFile) ; $aBytes = _StringBetween($sFont, "0x", ",") ; extract only binary bytes ; $iWidth = Dec($aBytes[0]) ; Width in bit of each single char $iHeight = Dec($aBytes[1]) ; height Local $iWhatis = Dec($aBytes[2]) ; ? Local $iChars = Dec($aBytes[3]) ; nr of chars in this font Local $iBytesPerChar = ($iWidth * $iHeight) / 8 Local $aFontMatrix[$iChars] Local $aTemp[$iHeight] Local $iNdx0 = 0, $iNdx1 = 0 ; ; Transform Hex bytes to binary digits For $i = 4 To UBound($aBytes) - 1 $aTemp[$iNdx1] &= _TextToBinaryString($aBytes[$i]) If StringLen($aTemp[$iNdx1]) = $iWidth Then $iNdx1 += 1 If $iNdx1 < $iHeight Then $aTemp[$iNdx1] = "" Else $aFontMatrix[$iNdx0] = $aTemp $iNdx0 += 1 $iNdx1 = 0 $aTemp[$iNdx1] = "" EndIf EndIf Next Return $aFontMatrix EndFunc ;==>_LoadFont Func _TextToBinaryString($sHexText) Local $sBits = "" For $i = 1 To StringLen($sHexText) $sBits &= $aNibbles[Dec(StringMid($sHexText, $i, 1))][0] Next Return $sBits EndFunc ;==>_TextToBinaryString Func _Terminate() If WinActive($hScreen) Then ; Clean up resources _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_BrushDispose($ahColors[0]) _GDIPlus_BrushDispose($ahColors[1]) _GDIPlus_Shutdown() MsgBox(0, "Debug", "Bye bye", 1) Exit EndIf EndFunc ;==>_Terminate1 point
-
@legend: Wow, that's a pretty bold claim. Care to back it up with real evidence? Because when I examine a task manager dump of a compiled Codecrypted script, I can find no trace whatsoever of, for example, a "Hello, world!" or "This is an Example" strings in the example below: #include <GUIConstantsEx.au3> #include <MCFinclude.au3> MsgBox (0, "Test","Hello, World!") Example() Func Example() ; adapted from Help file, first example for GuiCreate Local $hGUI = GUICreate("This is an Example") Local $idOK = GUICtrlCreateButton("Press to Quit", 140, 200, 120, 30) GUISetState(@SW_SHOW, $hGUI) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idOK ExitLoop EndSwitch WEnd GUIDelete($hGUI) EndFunc ;==>Example Re. obfuscation, Codecrypter already provides substantial support for that, also independently of encryption (if you don't want to use that, which is of course entirely up to you). Obfuscation currently covers both variable names and function names; what other parts of the language would you want it to support? To be honest, I cannot see how the "unencrypted script can be grabbed," as you claim, because the unencrypted script does not exist in the Codecrypted version, only as individual decryption calls for each line, that are only ever executed one by one, and only in memory, based upon a dynamic key that is only ever defined at runtime, and again, only in memory (and outside of the sanctioned environment, that key would be wrong). So I'm having trouble understanding how you can possibly extract and store a full unencrypted script that was never present in full unencrypted form in the excutable to begin with. Incidentally, you're skirting dangerously close to the prohibited topic of decompilation of AutoIt scripts here. But I'll leave that up to the forum moderators, as I appreciate that you may have legitimate concerns about whether an encrypted script is adequately protected (as you have expressed earlier). I've explained in the past under what specific cirumstances there may be a risk of a successful attack (notably, unfettered access by an attacker to the target machine on which the script is allowed to run), but 1) after studying several task manager dumps without finding a trace of plaintext code that was originally encrypted, 2) knowing that Codecrypter's decryption never, ever creates the entire unencrypted script as a single entity, and 3) decryption itself will produce utter garbage in any environment that does not match the sanctioned one in terms of the environment-dependent decryption key, I currently cannot see how you can possibly be right. But please enlighten me if I'm wrong; if it really were that easy to retrieve a complete unencrypted script, then I needn't have bothered. But it'll take more than that short last post of yours to convince me.1 point
-
VMware hard-drive monitoring
Pixel1191 reacted to Mriswith2k for a topic
The most basic solution would probably be to turn the entire function into a while loop that ends when it encounters an error Func SMART() while 1 ;Runs the entire function forever, or until the while loop is broken. Local $iPID = Run(@ComSpec & " /c " & 'esxcli -s 192.192.192.192 -u root -p password storage core device smart get -d t10.ATA_____harddrive___________________12345____', "C:\Program Files (x86)\VMware\VMware vSphere CLI\bin\", @SW_HIDE, $STDOUT_CHILD) ProcessWaitClose($iPID) Local $sOutput = StdoutRead($iPID) Local $aArray = StringSplit(StringTrimRight(StringStripCR($sOutput), StringLen(@CRLF)), @CRLF) If @error Then Run("blat.exe -server """ & $SMTPADD & """ -s """ & $SUBJECT & """ -body """ & $BODY & """ -u """ & $USERNAME & """ -pw """ & $PASSWORD & """ -t """ & $TO & """ -f """ & $from & """ -log """& $log & """","" , @SW_HIDE) exitloop ;exits the while loop after sending the email, else using exit will end the script. Else _ArrayDisplay($aArray) Sleep(120*1000) ;each time it works it sleeps for 2 minutes then re-runs EndIf WEnd ;Ends While Loop EndFunc If you want to, then instead of exiting the loop after sending the email you can make it go into a sub loop that it won't return from until it has been able to run successfully again Func SMART() while 1 ;Runs the entire function forever, or until the while loop is broken. Local $iPID = Run(@ComSpec & " /c " & 'esxcli -s 192.192.192.192 -u root -p password storage core device smart get -d t10.ATA_____harddrive___________________12345____', "C:\Program Files (x86)\VMware\VMware vSphere CLI\bin\", @SW_HIDE, $STDOUT_CHILD) ProcessWaitClose($iPID) Local $sOutput = StdoutRead($iPID) Local $aArray = StringSplit(StringTrimRight(StringStripCR($sOutput), StringLen(@CRLF)), @CRLF) If @error Then Run("blat.exe -server """ & $SMTPADD & """ -s """ & $SUBJECT & """ -body """ & $BODY & """ -u """ & $USERNAME & """ -pw """ & $PASSWORD & """ -t """ & $TO & """ -f """ & $from & """ -log """& $log & """","" , @SW_HIDE) _ErrorFoundOnHold() Else _ArrayDisplay($aArray) Sleep(120*1000) ;each time it works it sleeps for 2 minutes then re-runs EndIf WEnd ;Ends While Loop EndFunc Func _ErrorFoundOnHold() while 1 Local $iPID = Run(@ComSpec & " /c " & 'esxcli -s 192.192.192.192 -u root -p password storage core device smart get -d t10.ATA_____harddrive___________________12345____', "C:\Program Files (x86)\VMware\VMware vSphere CLI\bin\", @SW_HIDE, $STDOUT_CHILD) ProcessWaitClose($iPID) Local $sOutput = StdoutRead($iPID) Local $aArray = StringSplit(StringTrimRight(StringStripCR($sOutput), StringLen(@CRLF)), @CRLF) If @error Then sleep(120*1000) Else exitloop ;exits loop on succesful run EndIf WEnd EndFunc1 point -
I made example showing how it should be done: #include <ie.au3> #include <Timers.au3> _Example() Func _Example() ;~ http://www.aaronpeters.nl/blog/iframe-loading-techniques-performance?%3E ;~ Local $oIE = _IECreate('http://www.aaronpeters.nl/blog/testpages/iframe-dynamic-after-onload.htm', 0, 1, 0) ;~ Local $oIE = _IECreate('http://www.aaronpeters.nl/blog/testpages/iframe-dynamic-asynch.htm', 0, 1, 0) Local $oIE = _IECreate('http://stevesouders.com/efws/iframe-onload-nonblocking.php?t=1453416601', 0, 1, 0) Local $hStarttime = _Timer_Init() _IELoadWait($oIE) ConsoleWrite('> 1 = ' & _Timer_Diff($hStarttime) & @CRLF) _IELoadWait_ForAllFrames($oIE) ConsoleWrite('> 2 = ' & _Timer_Diff($hStarttime) & @CRLF) _IEQuit($oIE) EndFunc ;==>_Example Func _IELoadWait_ForAllFrames(ByRef $oObject, $iDelay = 0, $iTimeout = Default) _IELoadWait($oObject, $iDelay, $iTimeout) If @error Then Return SetError(@error, @extended, -1) Local $oFrames_coll = _IEFrameGetCollection($oObject) #forceref $oFrames_coll Local $iNumFrames = @extended Local $oFrame = Null For $iFrame_idx = 0 To ($iNumFrames - 1) $oFrame = _IEFrameGetCollection($oObject, $iFrame_idx) _IEDocGetObj($oFrame) If Not @error Then _IELoadWait($oFrame, $iDelay, $iTimeout) If @error Then Return SetError(@error, @extended, -1) EndIf Next Return SetError($_IESTATUS_Success, 0, 1) EndFunc ;==>_IELoadWait_ForAllFrames1 point
-
System Uptime on Windows10
argumentum reacted to EmilyLove for a topic
There is a really easy command for this. In command prompt, type "net statistics workstation" and press enter. You will see "Statistics since <DatePCStarted> <TimePCStarted>" at the top which essentially tells you when you started your computer. btw, you can just press windows key + r (run dialog) and type "cmd /k net statistics workstation" for the same effect. the /k flag tells cmd to remain open and accept new commands once the command is processed. Optionally, you can do "cmd /c pause | net statistics workstation" instead if you don't want cmd to accept new commands but still remain open. Note Pause must be first entry or it won't actually pause.1 point -
The Run() function provides the capabilities you seek. Firstly, it allows you to specify the "working directory" for a process (see the second parameter in the help article). As far as "interacting" with the output, there are a couple of ways to tackle that. One (arguabliy) more sophisticated way would be to capture the StdOut (console standard output) stream. Look at the StdOutRead() for a good example. You shoudl be able to manipulate the examples to get some initial working results. Let us know your progress.1 point
-
Need a kickstart concept
Xandy reacted to JLogan3o13 for a topic
@steve987, welcome to the forum. Since you're using Outlook, I would suggest you begin by familiarizing yourself with water's OutlookEX UDF: Download - Wiki - https://www.autoitscript.com/wiki/OutlookEX_UDF_-_General1 point -
Such a pity to have to dust off this section of the forum - is it really nearly 3 months since the last time it was needed? Anyway, posting grossly insulting language when offered pointers to answers which are easily available in the Help file is not something we want to encourage. Amongst the insults you mentioned that you intended to "quit the AutoIt forums" - so I will help you in keeping this New year resolution by banning your account. As all you do is ask about gamebots, I do not think you will be any great loss to the community. M231 point
-
Excel - load values from specific columns into array
AnonymousX reacted to kylomas for a topic
val75, Try the following... #include <Array.au3> #include <Excel.au3> #include <MsgBoxConstants.au3> OnAutoItExitRegister ( "_fini" ) local $st = timerinit() Local $oE = _Excel_Open() If @error Then Exit MsgBox($MB_SYSTEMMODAL,'Open Failed', @error & @lf & @extended) ; get columns and populate array Local $sWorkbook = @ScriptDir & "\Exceltest.xls" Local $oWB = _Excel_BookOpen($oE, $sWorkbook, Default, Default, True) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Error", "Error opening '" & $sWorkbook & "'." & @CRLF & "@error = " & @error & ", @extended = " & @extended) Local $aResult = _Excel_RangeRead($oWB, Default, $oWB.ActiveSheet.Usedrange.Columns("A:Z"), 2) local $aFinal[UBound($aResult)][3] for $1 = 0 to UBound($aResult) - 1 $aFinal[$1][0] = $aResult[$1][0] $aFinal[$1][1] = $aResult[$1][1] $aFinal[$1][2] = $aResult[$1][25] next ConsoleWrite('Time to get spreadsheet and populate final array = ' & timerdiff($st)/1000 & @CRLF) _arraydisplay($aFinal,'Final',default,default,default,'A|B|Z') func _fini() _Excel_Close($oE) endfunc The spread sheet is 6000 rows and runs as follows >"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Users\ADMIN010\Documents\help - Excel.au3" /UserParams +>16:07:38 Starting AutoIt3Wrapper v.14.801.2025.0 SciTE v.3.4.4.0 Keyboard:00000409 OS:WIN_7/Service Pack 1 CPU:X64 OS:X64 Environment(Language:0409) +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Users\ADMIN010\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\ADMIN010\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.13.19) from:C:\Program Files (x86)\AutoIt3 input:C:\Users\ADMIN010\Documents\help - Excel.au3 +>16:07:38 AU3Check ended.rc:0 >Running:(3.3.12.0):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\ADMIN010\Documents\help - Excel.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop Time to get spreadsheet and populate final array = 1.05814865721724 +>16:07:43 AutoIt3.exe ended.rc:0 +>16:07:43 AutoIt3Wrapper Finished. >Exit code: 0 Time: 5.86 kylomas1 point