Leaderboard
Popular Content
Showing content with the highest reputation on 01/29/2015 in all areas
-
After looking at this article about AutoIt on wikipedia, I thought the second code example (find average) could be replaced with one more suitable for wider readership. I came up with this plan which I hope will encourage your support. The challenge is to write a new example for the page. You must submit the code to an arbiter who will remove any reference to you, the author, to ensure impartial judgement. The arbiter will reveal the winner to everyone after the winner has been selected. The new example should... 1. comply to standard coding practices 2. be easy to follow 3. do something useful 4. be of interest to a wide audience 5. comply with the rules of the forum 6. not be longer than approximately 50 lines of code 7. convey the ease of use of AutoIt to beginners Names will be removed from submissions by an independant arbiter before being judged. MVPs will vote for the code they like best. Since MVPs are on the judging committee, MVPs are not allowed to submit an entry themselves. Team efforts can also be submitted. All submissions go to the arbiter(s). The deadline for submissions will be 10th February 2015. The arbiter is jaberwacky. All submissions should be sent to the arbiter. May the best code win!2 points
-
LAST VERSION - 1.0 25-Jan-15 This is my way to use the API ReadDirectoryChangesW in AutoIt. The problem is that to use this function will not work fully without creating thread. To solve this problem, I wrote the simple DLL that provides work with threads. As a result, the AutoIt script only receives and processes the appropriate data from thread. To evaluate all features of the library, please see the full example with GUI for monitoring directories. For more information, see description for each function within the library. The following are the main features of the RDC UDF library. Creating multiple threads (unlimited) for monitoring different directories.Support for hot (unsafe) unplugging of removable devices such as USB flash drive, etc.Support for network drives.Support for 32- and 64-bit processes (RDC.dll and RDC_x64.dll).Easy to use functions from the library.Full examples, including GUI. Available functions RDC UDF Library v1.0 (x86 and x64) Previous downloads: 17 RDC.zip Examples Simple (Notification mode) Advanced GUI1 point
-
MessagePack UDF
MagicSpark reacted to Ward for a topic
Introduction "MessagePack is an efficient binary serialization format. It lets you exchange data among multiple languages like JSON. But it's faster and smaller." (by http://msgpack.org/). There are already so many languages support MessagePack format, here comes AutoIt version. The backend coder is Charlie Gunyon's cmp. It supported MessagePack proposal v5. This UDF only have two public functions: MsgPack_Pack() and MsgPack_Unpack(). It just like Json_Enocde() and Json_Decode() in my ?do=embed' frameborder='0' data-embedContent>>JSON UDF. The Map type will be decoded into "Windows Scripting Dictionary Object" retuned from ObjCreate("Scripting.Dictionary"). So I suggest using Json.au3 to deal with the Map/Object data type. The main difference is MessagePack support Binary format, but Json not. For example (?do=embed' frameborder='0' data-embedContent>>Json.au3 is required to run this example): Local $Obj1 Json_Put($Obj1, ".binary", Binary("0x00")) Json_Put($Obj1, ".string", "abc") Json_Put($Obj1, ".int", Random(0, 1000, 1)) Json_Put($Obj1, ".float", Random()) Json_Put($Obj1, ".bool", True) Json_Put($Obj1, ".null", Null) Local $Binary = MsgPack_Pack($Obj1) Local $Obj2 = MsgPack_Unpack($Binary) ConsoleWrite("Test2 $Obj1.binary is " & VarGetType(Json_Get($Obj2, ".binary")) & @LF) ; "Binary" In my opinion, for human readable data storing or exchanging, of course choose Json. Otherwise, especially to exchange data on the internet, MessagePack may be a better choice. MsgPack.zip1 point -
I see no reason why you couln't use autoit. Add the same if statement around every step, and consolewrite the results...you need to see exactly where your script is failing.1 point
-
Thanks, I sure feel a lot better letting it run in the background with your confirmation. I'm glad I could achieve such result by myself Great community !1 point
-
pcjunki, The default template is in "C:WindowsShellNewTemplate.au3" - just adjust it as you wish. M231 point
-
Wikipedia New Example Challenge
czardas reacted to JLogan3o13 for a topic
This is an Example Challenge - if you would like to do it differently, submit your version rather than proposing people change theirs.1 point -
Something like this then... But all this seems really hazardous $sText = FileRead("descrizione-short.html") Local $res = StringRegExp($sText, '(?is)<div class="mostro" abp="\d+">\s*(.*?)</strong> \h*</div>', 3) ; descrizione breve _ArrayDisplay($res) For $i = 0 to UBound($res)-1 $str = StringRegExpReplace($res[$i], '<strong.*?>', "") $str = StringRegExpReplace($str, '</strong> ', @crlf) Msgbox(0,"", $str) Next1 point
-
It's one way I can show my wife how much I can spend on e-books and stay in budget, yet she can't get mad, so it's pretty relevant for me. alt="wink.png"> Keep up the good work.1 point
-
UPDATED - see first post. (v1.8) Added an option to store and view up to the last five Query results. Both the 'Settings.ini' and 'Catalog.ini' files can be viewed via a button on the SETTINGS window. The SAVE LIST button, can now save a comma delimited csv file of current list state, or using either CTRL or SHIFT keys, view the 'Catalog.ini' or last saved file. 'Price History' and 'View price results' menu items have swapped positions, with 'Query Results' menu item added. NOTES - I have not been able to fully test the new last five Query results process. I did a real world test just a while ago, and it worked fine for the first of five, save and retrieve. Couldn't be bothered setting up elaborate testing to see if it cycles all five slots correctly, so just decided to make it real world. It should be ok, unless I had an illogical moment somewhere ... in which case, we'll soon find out, and I will have to be bothered ... not a script-breaker though ... just a handy feature. EDIT Only reports for a Query, that contain a result, are saved for retrieval.1 point
-
Graphic Gui display problem
JakeJohnson74 reacted to Melba23 for a topic
JakeKenmode, Why not use my GUIFrame UDF and let it do all the work for you? #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include "GUIFrame.au3" $hGUI = GUICreate("Test", 660, 320, 192, 125, BitOr($WS_SIZEBOX, $WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_CAPTION, $WS_SYSMENU)) GUISetState() $iIndex = _GUIFrame_Create($hGUI, 0, 200) _GUIFrame_Switch($iIndex, 1) $ListView1 = GUICtrlCreateListView("col1|col2|col3",0, 10, 200, 300, -1,$WS_EX_CLIENTEDGE) _GUIFrame_Switch($iIndex, 2) $ListView2 = GUICtrlCreateListView("col1|col2|col3", 0, 10, 450, 300, -1, $WS_EX_CLIENTEDGE) _GUIFrame_ResizeSet(0) _GUIFrame_ResizeReg() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd That seems to work quite nicely. M231 point -
So lets wait until another one hopefully will test on Win8.1.1 point
-
A simple script for get differences between 2 "Text" files. The different parts are highlighted and a double click on a line of listviews located to the bottom of the Gui permit to access to the line in the Text. Its defects : Using _ArraySearch, it's a bit slow and hungry on cpu usage. Previous downloads : 69 source and executable are available in the Download Section Hope it can help !1 point
-
Can you please show us the rest of your AutoIt script? At least the part where you start PowerPoint and open the presentation.1 point
-
its HotKeySet("^!u", "_Login") ;CTRL + ALT + U not HotKeySet("^!u", _Login()) ;CTRL + ALT + U for second question Failure: $IDTIMEOUT (-1) if the message box timed out. so it shud return -1 if timeouted so "If $MsBox = -1 Then MsgBox(16,'','something something something dark side')" should work1 point
-
maybe its semplified but yout preformance isnt good, another way around #include <Array.au3> $loops = 1000 $str = "The mad mad mad mad the mad cat on mad day in mad dog ate mad mad mad the mad cat on mad day in mad landThe mad mad mad mad the mad cat on mad day in mad dog ate mad mad mad the mad cat on mad day in mad landThe mad mad mad mad the mad cat on mad day in mad dog ate mad mad mad the mad cat on mad day in mad landThe mad mad mad mad the mad cat on mad day in mad dog ate mad mad mad the mad cat on mad day in mad land" $in = TimerInit() For $x = 1 To $loops $Array = _StringsInStr1($str, "mad");John Next $time = TimerDiff($in) ConsoleWrite($time & " John" & @CRLF) _ArrayDisplay($Array, $time) $in = TimerInit() For $x = 1 To $loops $Array = _StringsInStr2($str, "mad");bogQ Next $time = TimerDiff($in) ConsoleWrite($time & " bogQ" & @CRLF) _ArrayDisplay($Array, $time) $in = TimerInit() For $x = 1 To $loops $Array = _StringsInStr3($str, "mad");Chimp Next $time = TimerDiff($in) ConsoleWrite($time & " Chimp" & @CRLF) _ArrayDisplay($Array, $time) Func _StringsInStr1($SearchIn, $SearchFor) Local $Size = 10 Local $aPos[$Size], $Found = 0, $Index = 0 Do $Found = StringInStr($SearchIn, $SearchFor, 0, 1, $Found + 1) If $Found Then If $Index = $Size Then $Size += $Size ReDim $aPos[$Size] EndIf $aPos[$Index] = $Found $Index += 1 EndIf Until $Found = 0 Or @error If $Index = 0 Then Return SetError(1, 0, 0) EndIf ReDim $aPos[$Index] Return $aPos EndFunc ;==>_StringsInStr1 Func _StringsInStr2($SearchIn, $SearchFor) Local $aArray = StringSplit($SearchIn, $SearchFor, 1) If @error Then Return SetError(1, 0, 0) Local $sLen = StringLen($SearchFor) ReDim $aArray[$aArray[0]];remove last unneeded split $aArray[0] -= 1;Correct the number of returned values $aArray[1] = StringLen($aArray[1]) + 1;Calculate only first element with +1 coz other elements are calculated upon this element For $x = 2 To $aArray[0] $aArray[$x] = StringLen($aArray[$x]) + $aArray[$x - 1] + $sLen Next Return $aArray EndFunc ;==>_StringsInStr2 Func _StringsInStr3($SearchIn, $SearchFor) StringReplace($SearchIn, $SearchFor, $SearchFor) $iOccurrences = @extended If Not $iOccurrences Then Return SetError(1, 0, "") Local $aPos[$iOccurrences] For $i = 1 To $iOccurrences $aPos[$i - 1] = StringInStr($SearchIn, $SearchFor, 0, $i) Next Return $aPos EndFunc ;==>_StringsInStr3 edit: small count of ellements correction1 point