Leaderboard
Popular Content
Showing content with the highest reputation on 04/28/2015 in all areas
-
That's fine @MikahS. That notification system of @username is pretty awesome.3 points
-
The forum is currently being upgraded - this post details the status. Content may look badly formatted at the moment. This is normal until the background rebuild tasks have finished. There is no need to re-edit your old posts or signatures to fix them, this should happen automatically. Please resist the urge to do so The post rebuild is estimated at 9 hours - it's not a quick task. Current Status: Forum upgraded - 100%AutoIt code boxes rebuilt - 100%Double-spaced paragraphs fixed up (as best I can) - 100%Forum to Wiki Access - 100%Signatures rebuilt - 100%Posts rebuilt (emoticons, bbcode, attachments, images, quotes) - 100%Legacy BBCode fixed in signaturescolor - 100%color=rgb() - 100%url - 100%img - 100%size - 100%Search engine online - 100%1 point
-
Form Builder beta
mLipok reacted to BuckMaster for a topic
Update v1.0.6 Major script overhaul, I literally started over from scratch only adding parts of code from the old script that were solid. I don’t have a help file made as of now so I am going to explain all of the functionality in this post - Form Builder is no longer bi-directional, you now toggle between script mode and GUI mode using a button in the top right or F4 - The script no longer recompiles on every change but instead inserts changes into the script - Form Builder no longer cares about Event mode or GuiGetMsg mode - No more .gui files, you now edit .au3 scripts directly - Script edit is now a SciLexer control, includes syntax highlighting, folding, call tips, keywords, and inline error annotations. - Script output console is now at the bottom in script mode - Main GUI menu redone, most functions from SciTe have been added along with their hotkeys - All restrictions to editing the script have been removed - GDI+ and Graphic editors removed - Cleanup of script, stability greatly increased - Hotkeys no longer use _IsPressed they now use GUIAccelerator keys (with exception to a few) - Multiple scripts can be open - Form Builder buffers the open scripts and adds an asterisk * to scripts that have been modified - Rich Edit, GUIScrollbars, Dummy, and Updown are disabled for now until I can add them - GUI Menu controls cannot be created as of now but will be rendered in the editor - Undo and Redo actions in script mode and GUI mode added, the GUI undo and redo buffer is cleared switching between modes - The Undo and Redo buffers do not have a limit but are cleared when switching between modes or scripts - Undo and Redo actions do not work for controls that have no control handle - The Treeview now works as a Go to function for controls and functions in script mode - Form Builder now tries to preserve as much of the original content as possible, it will save whitespace in-between parameters and comments on controls - Treeview context menu reworked, much more responsive - Unicode support added File -> Encoding -> UTF-8 - Language support added, I added a couple of language files and used Google translate just so I could size my GUI's for different languages, I do not support what those language files say - Selecting a GUI in the Treeview in GUI mode will allow you to change the GUI's Handle, Position, Background Color, State, Cursor, Font, Font Size and Font Attributes - Auto Declare is no longer hiding in the settings, it is now on the top right and is a toggle between Off, Global and Local - Help File Lookup added (Ctrl + H), allows you to search selected text in the help file, Any variable will be searched and the first result will be displayed, any string will be searched as a keyword in the index - Added current script line, column, and selection length in the bottom left - Standard undeclared style constants are checked before script execution and the script will prompt if an undefined style constant is found - You can now toggle script whitespace, EOL characters, line numbers, margins and output in the View menu - View -> Toggle All Folds works as it does in SciTe, only base level folds are changed and the first fold found determines whether to expand or contract - Form Builder Settings redone - Bugs with submitting data and control selection have been fixed - Fixed problems with frequently called repetitive functions causing issues with large scripts - Fixed bugs with B, I, U and S font attribute buttons getting stuck and called when enter was pressed Update v1.0.7 - Help File Look-up hotkey changed to Ctrl+B - Replace hotkey changed to Ctrl+H - Changes to $SCN_MODIFIED so only text events are notified - Bookmarks added, Ctrl+M to add or delete a Bookmark from the current line - Edit -> Bookmarks -> Set Bookmark changes the currently selected Bookmark - Edit -> Clear Current Bookmarks deletes only the currently selected Bookmark - Allows you to change foreground and background colors of Bookmarks - Added F2 hotkey for Next Bookmark - Added Shift+F2 hotkey for Previous Bookmark - Fixed a bug that made it so script annotation did not show up for some people - Script errors and warnings now add a Bookmark on each line - Ctrl+E hotkey added to clear all Bookmarks and Annotations - Minor GUI tweaks - Fixed a bug with the GUI Style undo action - Undo and Redo actions for GUI windows will now update the window properties if the GUI is selected - F4 Hotkey no longer switches modes, switching modes is now F10 - F4 is to toggle next error or warning message, works like it does in SciTe, bookmarks the line and highlights the error in the console - Shift+F4 Hotkey added to toggle previous error or warning message - Shift+F5 Hotkey added to clear script output - Ctrl+F5 Hotkey added as SyntaxCheck Prod - Form Builder now performs a SyntaxCheck before entering GUI Mode and prompts on Error or Warning - Language Select Menu Added Settings -> Lanugage - Icons added to main menu - Languages added to all new menu items and msgbox's - Language Files updated for new data - Language Support added for Arabic, Chinese, Dutch, French, German, Hebrew, Japanese, Swedish, Thai, and Vietnamese [ Google Translate ] - Fixed bug with updating a language that made it look like ANSI and UTF-8 were both selected - Added redo button next to undo button - Font attribute buttons Bold, Italic, Underline and Strike-Out changed to labels Update v1.0.8 - Somehow a main function got deleted causing the script to crash on some changes - Fixed some issues with updating Languages Hotkeys Ctrl + N - New Blank Script Ctrl + G - New GUI Script Ctrl + O - Open Script Ctrl + Shift + S - Save As Ctrl + S - Save Esc - Close Open Script Alt + F4 - Exit Ctrl + Z - Undo Ctrl + Y - Redo Ctrl + X - Cut Ctrl + C - Copy Ctrl + V - Paste Ctrl + A - Select All Ctrl + W - Clear inline script annotation Ctrl + E - Clear inline script annotation and bookmarks Ctrl + F - Find Ctrl + F3 - Find Next Shift + F3 - Find Previous (doesn’t work yet) Ctrl + B - Help File Lookup F5 - Go Alt + F5 - Beta Run F7 - Build Ctrl + F7 - Compile F11 - Full screen F8 - Toggle Show/Hide Script Output Ctrl + I - Open Include Ctrl + H - Replace F1 - AutoIt Help File Ctrl + D - Duplicate Control Delete - Delete Control Ctrl + Shift + 8 - Toggle Show/Hide Script Whitespace Ctrl + Shift + 9 - Toggle Show/Hide Script EOL characters Ctrl - GUI Mode multicontrol selection F10 - Switch Modes F4 - Next Message Shift+F4 - Previous Message Shift+F5 - Clear Output Ctrl+M - Add Bookmark F2 - Next Bookmark Shift+F2 - Previous Bookmark Basic GUI Mode How To Create a Control - click a control on the left - click in the GUI you wish to add the control Left Click: Click and drag to auto resize the control Right Click: Creates the control at a standard size Select a Control - click inside the control or select it in the treeview Change a controls Data - First select the control - modify the controls data on the right, press enter to submit changes state, cursor, font and resizing update when you change the data - when modifying the data parameter the script recognizes if there is a variable in the data and will add quotes accordingly ex. data parameter = $data, End result in script: GUICtrlCreateButton($data, 50, 50, 100, 20) ex. data parameter = data, End result in script: GUICtrlCreateButton("data", 50, 50, 100, 20) ex. data parameter = "data"&$data, End result in script: GUICtrlCreateButton("data"&$data, 50, 50, 100, 20) Applying an Image to a control - select a control - control styles must be applied to some controls before adding an image - click the ... button next to the Image input in the Control Properties area in the bottom right - select the image you want to display, allows jpg, bmp, gif, ico and dll files - selecting a dll will open another prompt to choose which resource to display Control Grouping - multiple controls must be selected - press the group controls button - control grouping allows you to resize and move multiple controls at the same time, as of now groups are deleted when leaving GUI mode I only have a couple odds and ends to finish up before everything should be complete, I need to add Undo and Redo actions for copying and duplicating controls and a couple other minor things, eventually I want to try to add all of the UDF controls as well. If people are willing to translate the language file I would be very grateful, the ones I have right now are from Google translate, I only used them for testing and have no idea what they say. I want to thank Kip, Prog@ndy, Isi360 and all of the other contributors on this forum, without you guys i don't think i could have written this script. Please post any comments, problems or suggestions, BuckMaster * I only used one "magic number" on my main close case statement, only for faster locating, and i don't care. Form Builder Source.zip Form Builder.zip1 point -
Ah sorry, i misunderstood.. I thought you wanted to keep at least one file. So it's over complicated to do it with the same method, especially if you want to have a comprehensible code. A good way should be to use _FileListToArray first, then create a 2D array containing the file names and file size. Next, _ArraySort the array by file size, and finally, make a loop in the whole array and FileDelete each file having the same size. Here is an example of what could be done with my previous method, but it will me more complicated to understand than my first code (sorry all, it's a jumble) Local $sPath = "D:\tmp" Local $hSearch = FileFindFirstFile($sPath & "\*.*") If $hSearch = -1 Then Exit Local $sSizes While 1 $sFile = FileFindNextFile($hSearch) If @error Then ExitLoop If @extended Then ContinueLoop $iSize = FileGetSize($sPath & "\" & $sFile) $aDouble = StringRegExp($sSizes, ";([^,]*)," & $iSize & ";", 1) If IsArray($aDouble) Then If $aDouble[0] <> "" Then $sSizes = StringReplace($sSizes, ";" & $aDouble[0] & ",", ";,") ; => FileDelete the first file ConsoleWrite("FileDelete('" & $sPath & "\" & $aDouble[0] & "')" & @CRLF) EndIf ; => FileDelete the next file ConsoleWrite("FileDelete('" & $sPath & "\" & $sFile & "')" & @CRLF) Else $sSizes &= $sFile & "," & $iSize & ";" EndIf WEnd FileClose($hSearch)1 point
-
In your case, FileGetSize($aFileList[1]) returns 0 because only the filenames are returned in your _FileListToArray call. You have to work with the full name to use FileGetSize, either by using True in the $bReturnPath parameter of _FileListToArray, or use something like FileGetSize("D:\Musik - Kopie\" & $aFileList[1])1 point
-
Please, post your code. We cannot help you if we don't see what you do...1 point
-
$aFileList[1] is supposed to be the first file. But I see in your code that the $aFileList is not declared as a global variable. Try to declare it before calling the function : Global $aFileList1 point
-
$sSizes is nothing until it is set to some concatenate size values (in the Else step) At the beginning, the variable is empty, but each uniq size is added to it, with a ";" as separator. For each file size, I search in this variable if the value <size>; exists. In fact, my code is wrong. To work, $sSizes should be set to ";" at the beginning and the search must operate with ;<filesize>; I edit my code now...1 point
-
The error refers to the included File.au3, which has no problem. The problem is the way you call the _FileListToArray. Did you try to remove the comma ?1 point
-
Remove that trailing comma after "*" and you will see the error disappear.1 point
-
You have a bad syntax here : $aFileList = _FileListToArray("D:\Musik - Kopie","*",) < The comma is the problem You can try with this kind of code : Local $sPath = "D:\Musik - Kopie" Local $hSearch = FileFindFirstFile($sPath & "\*.*") If $hSearch = -1 Then Exit Local $sSizes = ";" While 1 $sFile = FileFindNextFile($hSearch) If @error Then ExitLoop If @extended Then ContinueLoop $iSize = FileGetSize($sPath & "\" & $sFile) If StringInStr($sSizes, ";" & $iSize & ";") Then FileDelete($sPath & "\" & $sFile) Else $sSizes &= $iSize & ";" EndIf WEnd FileClose($hSearch)1 point
-
Because you never call your functions.... Add Example() and/or Example1() in your code1 point
-
Have a look at: FileGetSizein the helpfile. Edit: to slow1 point
-
1 point
-
Wouldn't the fact that the file wasn't decrypted tell you that the password was wrong, regardless of whether there's a 1kb file sitting there or not? You're over thinking the issue, but the function should definitely delete the file if the password is wrong. Which by the way also indicates that the password is wrong, because there's no file there.1 point
-
The ability of detecting a wrong password would mean a totally useless encryption scheme!1 point
-
I have a lot going on at the moment, but I had a couple of gui requests so I made a video tutorial on one of them. Standard Menus: Whole playlist link here. I am planning on doing another one very soon, maybe even tonight if everything aligns well.1 point
-
[Solved] Excel - Search Tool
zxtnt09 reacted to JLogan3o13 for a topic
I think there is a language barrier. Correct me if I am wrong, but you're asking if you can search inside the file without actually opening it?1 point -
Out of memory error 270MB csv sorting arrays and modifying data
souldjer777 reacted to UEZ for a topic
This is my first idea: #include <Array.au3> #include <File.au3> #include <WinAPIProc.au3> #include <WinAPIMisc.au3> #cs create test data $s = ",4/26/15 6:40:07 AM,ZZ123123,10.0.0.1,U-def R:rulename,deny create,C:\Users\username\AppData\Roaming\value.exe,,_,10.0.0.1,C:\Users\username\AppData\Local\Temp\A6F5.tmp,'File' access,Notice,SOL,My Site\Workstation\SITENAME Workstation\,109" & @CRLF Global $sTestCSV For $i = 1 To 725600 $sTestCSV &= $s Next $hFile = FileOpen(@ScriptDir & "\Test.csv", 2) FileWrite($hFile, $sTestCSV) FileClose($hFile) #ce Global $sFile = @ScriptDir & "\Test.csv" ConsoleWrite("Peak working set size: " & _WinAPI_StrFormatByteSize(_WinAPI_GetProcessMemoryInfo()[1]) & @CRLF) Global $fEnd, $fTimer = TimerInit() Global $aResult = TextSplit2D($sFile) $fEnd = TimerDiff($fTimer) ConsoleWrite("Test file loaded and converted to a 2D array in " & Round($fEnd / 1000, 2) & " seconds." & @CRLF) ConsoleWrite("Peak working set size: " & _WinAPI_StrFormatByteSize(_WinAPI_GetProcessMemoryInfo()[1]) & @CRLF) ;~ _ArrayDisplay($aResult) Func TextSplit2D($sFile, $sDelim = ",") Local $aFile = FileReadToArray($sFile) Local $iWidth = 8, $iHeight = UBound($aFile) Local $aResult[$iHeight][$iWidth], $aTemp, $i, $j For $i = 0 To UBound($aFile) - 1 $aTemp = StringSplit($aFile[$i], ",", 2) For $j = 1 To 6 $aResult[$i][$j - 1] = $aTemp[$j] Next $aResult[$i][6] = $aTemp[10] $aResult[$i][7] = $aTemp[14] Next Return $aResult EndFuncResult: Peak working set size: 10,4 MB Test file loaded and converted to a 2D array in 23.28 seconds. Peak working set size: 1,14 GB The result is an array.1 point -
[Solved] Excel - Search Tool
zxtnt09 reacted to JLogan3o13 for a topic
Take a look at the excel functions in the help file. You could do something like this to return all instances of 'abc': #include <Array.au3> #include <Excel.au3> Local $oAppl = _Excel_Open() Local $oWorkbook = _Excel_BookOpen($oAppl, @ScriptDir & "\Test.xlsx") Local $aResult = _Excel_RangeFind($oWorkbook, "abc") _ArrayDisplay($aResult) _Excel_BookClose($oWorkbook) _Excel_Close($oAppl)1 point -
How to exitloop without exiting the whole script.
232showtime reacted to JohnOne for a topic
You could add a timeout param to your messagebox. EDIT: But it would probably be better to use a ToolTip instead of MsgBox.1 point -
How to exitloop without exiting the whole script.
232showtime reacted to JohnOne for a topic
Not as your code stands, your loop is the only thing keeping the script alive, you exit it and that is the end of your script. Unless there is more.1 point -
How to exitloop without exiting the whole script.
232showtime reacted to JohnOne for a topic
While 1 If _IsInternetConnected() = 0 Then MsgBox(0, "Alert!!!", "F566 Disconnected!!!") EndIf WEnd Func _IsInternetConnected() Local $aReturn = DllCall('connect.dll', 'long', 'IsInternetConnected') If @error Then Return SetError(1, 0, False) EndIf Return $aReturn[0] = 0 EndFunc ;==>_IsInternetConnected1 point -
Look for examples in the help file for WinExists and any functions that are named similar i.e. ProcessExists(), WinActive(), WinClose(), WinTitleMatchMode (Option), WinWait(), WinWaitActive(), WinWaitClose(), WinWaitNotActive()1 point
-
Modularity: Local outside any function: modularity
jvanegmond reacted to willichan for a topic
When I want to encapsulate UDF/include scope variables, I create an initialization function in the UDF that returns an array containing all of the UDF relevant variables. Then the first required variable in every function is a ByRef variable that expects that array. Kind of a poor-mans OO when a real OO might be overkill. Might seem klunky to some, but it has worked well, and eliminated the need for any of my UDFs to need Globals at all. Works nice for GUI functions as well. I set array element [0] to the GUI itself, then relevant variables follow.1 point -
load script into memory / avoid handle
tweakster2010 reacted to Bert for a topic
batch? that is so DOS....1 point -
Same problem here. Problem is your Windows keyboard layout. If you change the keyboard layout to US it works fine, at least for me, at least in the cygwin CLASS:mintty window (default Cygwin terminal), even with characters like "¡²³" (which I just had to copypaste into the browser, btw, because these problems exist everywhere ). There are the _WinAPI_[Get|Set]KeyboardLayout() functions, but with my keyboard layout "US-International" I can't get it to run stable. Sometimes it works and sometimes it doesn't. No idea, but maybe it can get you started. /edit: seems to often not work on the first try after manually setting my keyboard layout back to US/International (which apparently doesn't have a nice code ), but works if I repeat the script. Good luck and good night, I'm giving up now ;) #include <APILocaleConstants.au3> #include <WinAPILocale.au3> #include <WinAPISys.au3> $hWnd1 = WinGetHandle("") _WinAPI_SetKeyboardLayout($hWnd1, 0x0409) ; start or activate terminal Send("abc ¡²³")1 point
-
There has been a problem with the conversion of posts that contain backslashes outside of code blocks and they have been stripped out. So this: C:\Program Files\Something Will have become this: C:Program FilesSomething However anything that was using the [ code] or [ autoit] code boxes will be ok (i.e. the really important stuff) because they were processed differently during the upgrade. ; This will have been ok $var = "C:\Program Files\Something"There is no easy way to fix this aside from doing a full rollback to Saturday morning, and as the code boxes are intact I'm not going to do that. I'm going to write some scripts to look for commonly used paths that are used to fix them up, such as: C:\Program Files C:\Windows C:\Windows\System32 C:\Program Files\AutoIt C:\Program Files\AutoIt\Include1 point
-
What about Send("{RALT DOWN}0{RALT UP}") ?1 point
-
Okay I've totally re-thought the way I am approaching this and realised that I was overcomplicating things. Instead I am now using standard method .Find to find a match on the page, highlight a match and scroll the document view to the match location. Now - just have to figure out a way to highlight multiple results! Here's the code which can do single item searching/highlighting and scrolling to said item: GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") Func WM_COMMAND($hWnd, $msg, $wParam, $lParam) Local $iCode = BitShift($wParam, 16) Local $nIDFrom = BitAND($wParam, 0xFFFF) Switch $hWnd Case $hGUI_child Switch $nIDFrom Case $qsInput Switch $iCode Case $EN_CHANGE _IESearchText($oIE, GUICtrlRead($qsInput)) EndSwitch EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc Func _IESearchText($oIE, $sFindText) $oRange = $oIE.document.body.createTextRange() If $oRange.FindText($sFindText) Then $oRange.Select() $oIE.scrollIntoView() Else $oIE.document.execCommand("Unselect") EndIf EndFunc1 point
-
too bad It seems I am destined to ask questions nobody knows the answer for :-]1 point