Leaderboard
Popular Content
Showing content with the highest reputation on 10/24/2012 in all areas
-
Software Installer
bundyal reacted to abberration for a topic
Software Installer Version: 2.0 It's been been a long year, but I finally got some time to rework this project. I re-wrote everything from scratch because the old version was getting too complicated with so many options and sub-menus. This new version is much easier to use and I have been testing for a few days and it seems very stable. For those who are new to this software, it helps you install software silently/unattended. This new version tries to determine the silent switch automatically. You can also re-organize the order in which the software installs by dragging & dropping them in the listview. It now supports creating profiles and checks for missing software (and automatically unchecks them, so it does not attempt to install non-existent software). One feature I included was because I have seen several people on Youtube talk about disliking bright screens at night. So, now you can choose from a few color theme (half of them are dark). I dabbled a bit more into GDI+ to draw a few things and show my logo with a transparent background (hint: I'm not good at GDI+). Under the Help menu, you will find a User Guide, which goes through most of it's features. I included a new icon if you want to use when you compile the script (in the Assets > Misc folder). If you have questions, comments or suggestions, all are welcome. Hope you enjoy! Here it is in action: Software_Installer_2.0.zip1 point -
Predict Text UDF Working It sub classes the edit control and matches the current word through the Database & sets selection in accordance. Functions Predicts Text from an User-Defined Database. Sets the Predicted Text when Enter is pressed. * Pressing Backspace deletes the current selection. Support Editing, Overwriting, Updating, Deleting the List. Has the Feature to add New words the user types in the control, to the List. Supports Sensitive and In-Sensitive Prediction. Supports Auto-completion and Auto-Suggestion. Edit and Input controls supported >Support RichEdit Controls. Automatically limit the New Words. Supports Phrase (Post-Space) Prediction Future Updates ​Support Auto-suggestion. [Coming soon]Done Note That if you set a Password Char for the Edit Box the Prediction will automatically get Unregistered. * Enter is supported Only in Edit Controls. For Input Control the user can use GuiSetAccelerators [Thanks to M23].Check Example 3 ; #CURRENT# ===================================================================================================================== ;_RegisterPrediction ;_UpdatePredictList ;_UnRegisterPrediction ;_RegisterListingSpaceWords ;_RegisterListingNewWords ;_GetSelectedText ;_GetListCount ;_GetCurrentWord ;_GetCaretOffset ; SetSuggestion_Dimensions ; =============================================================================================================================== ; #INTERNAL_USE_ONLY# =========================================================================================================== ;_New_WndProc ; AddToArray ; MakeArray ;_Edit_SubClass ;_AutoExit ;_PredictText ;_GetSpaceText ;_SetSelection ;_CtrlSetStyle ;_CtrlGetStyle ;_RemoveBit ; GetLineHeight ; Suggest_Show ; Suggest_PopuplateItems ; Suggest_SetPos ; =============================================================================================================================== Screen Shots Example 1 - Multiple Edits and Basic Functionality Example 2 - Adding New Words Example 3 - Password Char & Input Controls Example 4 - Supports Post-Space Prediction Example 5 - AutoSuggestion Please Notify for any other Updates and Bugs. ChangeLog V1.0 -First Release V1.1 -Now Supports New Words added by Pressing Enter -Supports Input Controls for Enter Key [Thanks to M23] V1.2 -Now Supports Prediction after Space -New Words are now Automatically Limited V1.3 -Converted to Iterative -Now is more faster V1.4 -Rewritten the UDF with Regular expressions. -Added support for Auto-Suggestion -Bug for incorrect insertion when inbetween typing is now cleared V1.5 -Fixed the bug for which MouseMove wasn't detected. V1.6 -Fixed: Scroll Bar unaccessible. -Fixed: Suggestion doesn't hide when space is typed in non-space text suggestion. V1.7 -Changed: Searching is now done with regular expressions. Lot of speed is increased. PredictText V1.7 v1.7 PredictText(UDF).7z Previous Downloads: 890 Regards Phoenix XL1 point
-
Great idea, but there is two thing that disturb me. 1st, we must always include your UDF and a big external UDF that add about 300ko of code in compilation to only have the source code of the script. 2nd, we can not easily retrieve external include or other resources used in script. Why not doing it simple and add something like this on the top of the script : If StringInStr($CmdLineRaw, '/SaveSource') Then DirCreate("Sources") FileInstall("MyScript.au3", "./Sources/MyScript.au3", 1) FileInstall("MyScript.ico", "./Sources/MyScript.ico", 1) FileInstall("File_1.au3", "./Sources/File_1.au3", 1) FileInstall("File_2.dll", "./Sources/File_2.dll", 1) FileInstall("_External_Include.au3", "./Sources/_External_Include.au3", 1) EndIfWhen you write a code, generally you take time to add comments, or functions presentation or other things that make your script easier to read or understand later. Thus, you can usre a snip like this and change the filenames when you write your code. With this, you can easily restore all your work : external includes, resources and what you want to retrieve. I have noticed that even if you FileInstall a same file several times, the size of the compiled script doesn't increase. Then why to go without this kind of thing. ^^ It's not more complex than adding a function to do it, it's just one habits to take and a security for those how have problem with project backup ...1 point
-
You have a 2-dimensional array, so you have to reference the elements differently. UBound($oPcName) returns 2 because the array is 2-dimensional. (Not the row count, as you were expecting) UBound($oPcName,1) also returns 2 because you have two lines in the CSV file. Try this: For $i = 0 To UBound($oPcName,1) -1 Run(@ComSpec & " /k netdom renamecomputer " & $oPcName[$i][0] & " /NewName:" & $nPcName & " /Force") Next Edit: Missed the -11 point
-
Hello everyone, i had an excel file with 450 rows and 9 columns, and using _ExcelReadSheetToArray() takes about 30 seconds to read to array, which i found very time consuming! So i rewrote the code and now i can read to array the same file in less than 1 second. So i decided to share here! The new code: #include <Excel.au3> ; #FUNCTION# ==================================================================================================================== ; Name...........: _ExcelReadSheetToArrayEx ; Description ...: Create a 2D array from the rows/columns of the active worksheet. ; Syntax.........: _ExcelReadSheetToArray($oExcel[, $iStartRow = 1[, $iStartColumn = 1[, $iRowCnt = 0[, $iColCnt = 0]]]]) ; Parameters ....: $oExcel - Excel object opened by a preceding call to _ExcelBookOpen() or _ExcelBookNew() ; $iStartRow - Row number to start reading, defaults to 1 (first row) ; $iStartColumn - Column number to start reading, defaults to 1 (first column) ; $iRowCnt - Count of rows to read, defaults to 0 (all) ; $iColCnt - Count of columns to read, defaults to 0 (all) ; Return values .: Success - Returns a 2D array with the specified cell contents by [$row][$col] ; Failure - Returns 0 and sets @error on errors: ; |@error=1 - Specified object does not exist ; |@error=2 - Start parameter out of range ; |@extended=0 - Row out of range ; |@extended=1 - Column out of range ; |@error=3 - Count parameter out of range ; |@extended=0 - Row count out of range ; |@extended=1 - Column count out of range ; Author ........: SEO; Rewrited by Golfinhu. ; Modified.......: litlmike (added Column shift parameter to Start Array Column on 0) and PsaltyDS 01/04/08 - 2D version _ExcelReadSheetToArray() ; Remarks .......: Returned array has row count in [0][0] and column count in [0][1]. ; Except for the counts above, row 0 and col 0 of the returned array are empty, as actual ; cell data starts at [1][1] to match R1C1 numbers. ; By default the entire sheet is returned. ; If the sheet is empty [0][0] and [0][1] both = 0. ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _ExcelReadSheetToArrayEx($oExcel, $iStartRow = 1, $iStartColumn = 1, $iRowCnt = 0, $iColCnt = 0) Local $avRET[1][2] = [[0, 0]] ; 2D return array ; Test inputs If Not IsObj($oExcel) Then Return SetError(1, 0, 0) If $iStartRow < 1 Then Return SetError(2, 0, 0) If $iStartColumn < 1 Then Return SetError(2, 1, 0) If $iRowCnt < 0 Then Return SetError(3, 0, 0) If $iColCnt < 0 Then Return SetError(3, 1, 0); Get size of current sheet as R1C1 string ; Note: $xlCellTypeLastCell and $x1R1C1 are constants declared in ExcelCOM_UDF.au3 Local $sLastCell = $oExcel.Application.Selection.SpecialCells($xlCellTypeLastCell).Address(True, True, $xlR1C1) ; Extract integer last row and col $sLastCell = StringRegExp($sLastCell, "(d+)", 3) Local $iLastRow = $sLastCell[0] Local $iLastColumn = $sLastCell[1]; Return 0's if the sheet is blank If $sLastCell = "R1C1" And $oExcel.Activesheet.Cells($iLastRow, $iLastColumn).Value = "" Then Return $avRET ; Check input range is in bounds If $iStartRow > $iLastRow Then Return SetError(2, 0, 0) If $iStartColumn > $iLastColumn Then Return SetError(2, 1, 0) If $iStartRow + $iRowCnt - 1 > $iLastRow Then Return SetError(3, 0, 0) If $iStartColumn + $iColCnt - 1 > $iLastColumn Then Return SetError(3, 1, 0); Check for defaulted counts If $iRowCnt = 0 Then $iRowCnt = Number($iLastRow) If $iColCnt = 0 Then $iColCnt = Number($iLastColumn) ;Read data Local $aArray = $oExcel.ActiveSheet.Range($oExcel.Cells($iStartRow, $iStartColumn), $oExcel.Cells($iRowCnt, $iColCnt)).Value Dim $avRET[UBound($aArray, 2) + 1][UBound($aArray)] = [[UBound($aArray, 2), UBound($aArray)]] ;Declare Array again and set row and col count For $i = 0 To UBound($aArray, 1) - 1 For $j = 0 To UBound($aArray, 2) - 1 $avRET[$j + 1][$i] = $aArray[$i][$j] Next Next Return $avRET EndFunc ;==>_ExcelReadSheetToArrayEx the modification is very simple, but gave a huge difference in time!1 point
-
^^ this is not entirely true. Things are not black and white like that. When you DllOpen some module then AuoIt keeps track of all opened modules and iterates through a set of handles every time you pass dll handle. Same thing is done on lower level by the system with included reference count when you pass the string. Obviously AutoIt can do it slower than system does it depending on, for example the number of opened handles. It can also do it faster if ref count for the module drops to 0. So no, it's not black and white.1 point
-
I get really annoyed by ungrateful people like yourself venting these stupid opinions and not being able to keep it to themselves.Didn't it dawn to you you could NOT use this and use your own setup? Jos1 point
-
Please always post a complete reproducer script. It wastes a lot of time if a user only posts a code snippet and after a few questions tells us that the real script does something completely different. Anyway, our advice is still valid.1 point
-
As long as you have the Run statement inside the loop Notepad.exe will be started over and over again. Put the Run statement outside the loop at the top of your script.1 point
-
If you don't want to open notepad every time through the loop, and just want to interact with one instance of it, then move the Run command to before the While statement.1 point
-
Help Split String
rikimaru110011 reacted to water for a topic
Use StringSplit. To remove redundant spaces use StringStripWS.1 point -
Hopefully we'll have a function (or a @extended code from FileOpen()) that does this in the next beta. Soon. FWIW the AutoIt internal procedure is: Read first 64KB of file While chars If char = valid UTF8 sequence Then Skip sequence (1,2,3 or 4 bytes) Else Return NOT_UTF8 WEnd Also, at the end if NO chars read were >127 then also return NOT_UTF8 because we can't tell if it's really UTF8 or standard ANSI.1 point