Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/23/2014 in all areas

  1. A globally unique identifier (GUID) is a unique reference number used as an identifier in computer software. The chance of 2 GUIDs being generated is highly unlikely, though not impossible. Source: https://en.wikipedia.org/wiki/Globally_unique_identifier #include <Array.au3> #include <StringConstants.au3> #include <WinAPICom.au3> Example() Func Example() Local $aArray[1000] For $i = 0 To UBound($aArray) - 1 $aArray[$i] = _WinAPI_CreateGUID() Next Local $hTimer = TimerInit() Local $bReturn = _ArrayUniqueFast($aArray, True) ; The standard _ArrayUnqiue() is very slow when using large arrays. ConsoleWrite('Time: ' & TimerDiff($hTimer) & @CRLF) ConsoleWrite('Return: ' & $bReturn & @CRLF) _ArrayDisplay($aArray) ; The last index should be 9999. This shows that _WinAPI_CreateGUID is unique. EndFunc ;==>Example Func _ArrayUniqueFast(ByRef $aArray, $bIsCaseSensitive = False) Local Const $AUF_DELIM = ChrW(160), $AUF_LENGTH = 2, $AUF_LOCAL = 1 Local $sOutput = '', $sString = '' For $i = 0 To UBound($aArray) - 1 $sString = StringTrimLeft(StringToBinary($bIsCaseSensitive ? $aArray[$i] : StringLower($aArray[$i])), $AUF_LENGTH) If Not IsDeclared($sString) Then Assign($sString, 0, $AUF_LOCAL) $sOutput &= $aArray[$i] & $AUF_DELIM EndIf Next $sOutput = StringTrimRight($sOutput, StringLen($AUF_DELIM)) $aArray = StringSplit($sOutput, $AUF_DELIM, BitOR($STR_ENTIRESPLIT, $STR_NOCOUNT)) If @error Then Local $aTemp[0] $aArray = $aTemp EndIf Return UBound($aArray) > 0 EndFunc ;==>_ArrayUniqueFast
    1 point
  2. After years of wanting a replacement for 'Media Player' as a background player (and suffering the last time with it picking the same 'random' songs over and over...) - I decided to make something in AutoIt as a 'relaxing' project. Within about an hour I had a nice working start and was playing music, thanks to _SoundPlay, FileOperations.au3 and gui tools. I now play truly random songs from my folder and NEVER repeat until the list has been gone through completely (should have done this LONG ago!) However, I'm getting the occasional song that comes up with no sound. I've checked the file, works fine in MP as well as re-running it in my program (as the only selected song). Code is simple - needs a lot of work to be 'releasable' (including some code to reload the files and/or {more likely} a database... - hey, it is 0.0.0.1!), but it suits my purpose well, for now (I've got about 300 hours of songs, so a bit of time before worrying about that). But, these 'silent' songs are driving me crazy! Any ideas welcome!
    1 point
  3. '?do=embed' frameborder='0' data-embedContent>>
    1 point
  4. guinness

    _GetControlID()

    Fixed on an old bug where Default would be converted to -1 instead of 0 when casting as a double (using Number()). I have now fixed this in my code above.
    1 point
  5. BuckMaster

    Form Builder beta

    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 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 + F - Find Ctrl + F3 - Find Next Shift + F3 - Find Previous (doesn’t work yet) Ctrl + B - Replace 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 - Help File Lookup 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 F4 - Switch Modes 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 greatful, 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 dont 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 statment, only for faster locating, and i dont care.
    1 point
  6. FireFox

    Help with code

    You will lose less time to search a little bit by yourself than replying to say "It doesn't work."
    1 point
  7. kylomas

    Bat convert Au3

    i2i8, A couple things: Your topic is about as non-descriptive as is possible. I last used BAT processing under MSDOS 5.0. It's changed quite a bit. I gather that you are trying to clear the event logs. A title like " Clearing Event Log Batch File Conversion" would have been better. Post what you've tried during this "long time". There are several eventlog functions that can easily do what you want. kylomas
    1 point
  8. You are running an AutoIt script and trying to get hardware level performance? Irony at its best.
    1 point
  9. _ArrayUniqueFast() is now case-sensitive. This is thanks to an idea czardas gave here in which they mentioned about converting to hex.
    1 point
×
×
  • Create New...