Leaderboard
Popular Content
Showing content with the highest reputation on 05/16/2014 in all areas
-
Chrome UDF
Velislav reacted to seangriffin for a topic
Chrome support for AutoIT is here! This UDF includes a Chrome Extension (http://developer.chrome.com/extensions/getstarted.html) and Native Messaging Host (http://developer.chrome.com/extensions/messaging.html#native-messaging-host) that integrate with a new Chrome UDF (Chrome.au3) to provide automation support for the Chrome browser. Several steps are required to install the Chrome Extension and Native Messaging Host prior to using the UDF. Please read the INSTALLATION section below. REQUIREMENTS: Windows XP 32-bit, Windows 7 32-bit or Windows 7 64-bit AutoIt3 3.2 or higher Chrome v29 or later (earlier versions are untested) AutoIT for Google Chrome (Chrome extension - see below) AutoIT Chrome Native Messaging Host (see below) INSTALLATION: STEP 1: Install the AutoIT extension into Chrome. Open the following link and download the file named AutoIT for Google Chrome.crx: https://docs.google.com/file/d/0B_6JmwNIIZ06enotRTVFNVdKOXM/edit?usp=sharing Note - you may be prompted to login with a Google account as this file is hosted on Google Drive. In your Chrome browser click on the Chrome menu, then select Tools -> Extensions. Drag the AutoIT for Google Chrome.crx file that you downloaded above, from Windows Explorer, into this page in Chrome. You should now see AutoIT for Google Chrome listed in the Extensions page in Chrome. Ensure that the Enabled checkbox next to AutoIT for Google Chrome is checked. Also make sure the Allow access to file URLs box is checked (very important to make EXAMPLE 2 work below)!! STEP 2: Install the AutoIT Chrome Native Messaging Host. Open the following link and download the file named autoit_chrome_native_messaging_host_install.exe: https://docs.google.com/file/d/0B_6JmwNIIZ06eDgxaVJPNUNxa28/edit?usp=sharing Note - you may be prompted to login with a Google account as this file is hosted on Google Drive. Run this file (autoit_chrome_native_messaging_host_install.exe). An installation window will display. Click the Install button. The window will display "Completed" and you can click the Close button. STEP 3: Install the Chrome UDF into AutoIT. Scroll to the DOWNLOAD section below, and save the Chrome.au3 file into your AutoIT Include folder (C:Program FilesAutoIt3Include). Please close your Chrome browser once you've completed these steps. LIST OF FUNCTIONS: EXAMPLE #1: This following example starts up Chrome and navigates to the URL http://www.december.com/html/demo/form.html. It then automatically completes the HTML form in this page (a series of text, radio, and checkbox input elements and select elements) and clicks the Send this survey button. The script waits for the next page to load, and retrieves the various elements from the page to the AutoIT console. chrome_example.au3 EXAMPLE #2: The following is an example of the automation of an offline HTML page (file URL). First, download the file named chrome_udf_example_2.html to your C: folder: https://docs.google.com/file/d/0B_6JmwNIIZ06SWduMjZGTVViNlU/edit?usp=sharing Then run the following AutoIT script: chrome_example_2.au3 Note that you must have checked the Allow access to file URLs box in the Chrome extension to make this work! DOWNLOAD: Latest Version - v0.5 (29/09/13) Chrome.au31 point -
Pastebin UDF
fede97 reacted to mrflibblehat for a topic
Hi All, Please see code attached for my first UDF Attempt, I needed some functions for pastebin so decided to clean them up a bit and share with you guys. You need to add your Pastebin Developer Key to the top of the UDF for functionality. Hope someone finds these useful. You will need the WinHttp.au3 UDF to make this work. https://code.google.com/p/autoit-winhttp/downloads/list #Include-Once #include <WinHttp.au3> ; #INDEX# ========================================================================================= ; Title .........: Pastebin UDF ; AutoIt Version : 3.3.8++ ; Language ..... : English ; Description ...: Functions for use with Pastebin.com API ; Author(s) .....: mrflibblehat (danielcarroll@gmail.com) ; ================================================================================================= ; #GLOBALS# ===================================================================================== Global Const $vPasteBin = "pastebin.com" ;~ PasteBin Website Global Const $vAPIDevKey = "" ;~ Obtain The Developer Key From Pastebin Global $vOpen = 0, $vConnect = 0 ; =============================================================================================== ; #CURRENT# ======================================================================================= ;_PB_Open ;_PB_Close ;_CreatePaste ;_DeletePaste ;_CreateAPIUserKey ;_ListUserPastes ;_ListTrendingPastes ;_UserDetails ;_GetRawPaste ; ================================================================================================= ; #FUNCTION# ==================================================================================================================== ; Name...........: _PB_Open ; Description ...: Create Session and Connection Handle ; Syntax.........: _PB_Open ; Return values .: Failure - Returns 0 and Sets @Error: ; |@error = 1 - Error Opening WinHTTP Handle ; |@error = 2 - Error Opening WinHTTPConnect Handle ; Author ........: mrflibblehat (danielcarroll@gmail.com) ; =============================================================================================================================== Func _PB_Open() $vOpen = _WinHttpOpen() if (@error) then Return SetError(1, 0, "Error Opening WinHTTP Handle") $vConnect = _WinHttpConnect($vOpen, $vPasteBin) if (@error) then Return SetError(2, 0, "Error Opening WinHTTPConnect Handle") EndFunc ; #FUNCTION# ==================================================================================================================== ; Name...........: _PB_Close ; Description ...: Close Session and Connection Handle ; Syntax.........: _PB_Close ; Author ........: mrflibblehat (danielcarroll@gmail.com) ; =============================================================================================================================== Func _PB_Close() _WinHttpCloseHandle($vConnect) _WinHttpCloseHandle($vOpen) EndFunc ; #FUNCTION# ==================================================================================================================== ; Name...........: _CreatePaste ; Description ...: Creates a new paste and returns pastebin link ; Syntax.........: _CreatePaste($vPasteCode, $vPasteName[, $vPasteFormat = "text"[, $vPublicity = 1[, $vPasteExpireDate = "N" [, $vAPIUserKey = ""]]]] ) ; Parameters ....: $vPasteCode - Put Paste Code Here ; $vPasteName - Name of Your Paste ; $vPasteFormat - Set Syntax Highlighting Format (autoit, php, c, c++, vb, html etc) ; $vPublicity - Set The Publicity of Your Paste (0 = Public, 1 = Private, 2 = Unlisted) ; $vPasteExpireDate - Set The Paste Expiry Date (N = Never, 10M = 10 Minutes, 1D = 1 Day, 1W = 1 Week etc) ; $vAPIUserKey - To Paste as a User, Only if You Have Created an API User Key (See _CreateAPIUserKey) ; Return values .: Success - Returns Pastebin Paste Link ; Author ........: mrflibblehat (danielcarroll@gmail.com) ; =============================================================================================================================== Func _CreatePaste($vPasteCode, $vPasteName, $vPasteFormat = "text", $vPublicity = 1, $vPasteExpireDate = "N", $vAPIUserKey = "") Local $sData = ("api_option=paste&api_user_key=" & $vAPIUserKey & "&api_paste_private=" & $vPublicity & "&api_paste_name=" & $vPasteName & "&api_paste_expire_date= " & $vPasteExpireDate & "&api_paste_format=" & $vPasteFormat & "&api_dev_key=" & $vAPIDevKey & "&api_paste_code=" & $vPasteCode) Local $vRequest = _WinHttpSimpleRequest($vConnect, "POST", "/api/api_post.php", $WINHTTP_NO_REFERER, $sData, "Content-Type: application/x-www-form-urlencoded") if (@error) then Return SetError(3, 0, "Unable To Send Request") Return SetError(0, 0, $vRequest) EndFunc ; #FUNCTION# ==================================================================================================================== ; Name...........: _CreateAPIUserKey ; Description ...: Creates an API User Key ; Syntax.........: _CreateAPIUserKey($vUsername, $vPassword) ; Parameters ....: $vUsername - Pastebin Username ; $vPassword - Pastebin Password ; Return values .: Success - Returns Pastebin API User Key ; Author ........: mrflibblehat (danielcarroll@gmail.com) ; =============================================================================================================================== Func _CreateAPIUserKey($vUsername, $vPassword) Local $sData = ("api_dev_key=" & $vAPIDevKey & "&api_user_name=" & $vUsername & "&api_user_password=" & $vPassword) Local $vRequest = _WinHttpSimpleRequest($vConnect, "POST", "/api/api_post.php", $WINHTTP_NO_REFERER, $sData, "Content-Type: application/x-www-form-urlencoded") if (@error) then Return SetError(3, 0, "Unable To Send Request") Return SetError(0, 0, $vRequest) EndFunc ; #FUNCTION# ==================================================================================================================== ; Name...........: _ListUserPastes ; Description ...: List Pastes by Given API User Key ; Syntax.........: _CreateAPIUserKey($vAPIUserKey[, $vAPIResultsLimit = 50]) ; Parameters ....: $vAPIUserKey - Pastebin API User Key ; $vAPIResultsLimit - Limit Results Displayed ; Return values .: Success - Returns List of Pastebin Pastes ; Author ........: mrflibblehat (danielcarroll@gmail.com) ; =============================================================================================================================== Func _ListUserPastes($vAPIUserKey, $vAPIResultsLimit = 50) Local $sData = ("api_option=list&api_user_key=" & $vAPIUserKey &"&api_dev_key=" & $vAPIDevKey & "&api_results_limit=" & $vAPIResultsLimit) Local $vRequest = _WinHttpSimpleRequest($vConnect, "POST", "/api/api_post.php", $WINHTTP_NO_REFERER, $sData, "Content-Type: application/x-www-form-urlencoded") if (@error) then Return SetError(3, 0, "Unable To Send Request") Return SetError(0, 0, $vRequest) EndFunc ; #FUNCTION# ==================================================================================================================== ; Name...........: _ListTrendingPastes ; Description ...: Creates an API User Key ; Syntax.........: _ListTrendingPastes() ; Parameters ....: ; Return values .: Success - Returns a 0 based array showing top trends ; Author ........: mrflibblehat (danielcarroll@gmail.com) ; =============================================================================================================================== Func _ListTrendingPastes() Local $vDataArr[18][10] Local $sData = ("api_option=trends&api_dev_key=" & $vAPIDevKey) Local $vRequest = _WinHttpSimpleRequest($vConnect, "POST", "/api/api_post.php", $WINHTTP_NO_REFERER, $sData, "Content-Type: application/x-www-form-urlencoded") if (@error) then Return SetError(3, 0, "Unable To Send Request") $vPasteKey = StringRegExp($vRequest, "<paste_key>(.*?)</paste_key>", 3) $vPasteDate = StringRegExp($vRequest, "<paste_date>(.*?)</paste_date>", 3) $vPasteTitle = StringRegExp($vRequest, "<paste_title>(.*?)</paste_title>", 3) $vPasteSize = StringRegExp($vRequest, "<paste_size>(.*?)</paste_size>", 3) $vPasteExpiry = StringRegExp($vRequest, "<paste_expire_date>(.*?)</paste_expire_date>", 3) $vPastePrivate = StringRegExp($vRequest, "<paste_private>(.*?)</paste_private>", 3) $vPasteFormatL = StringRegExp($vRequest, "<paste_format_long>(.*?)</paste_format_long>", 3) $vPasteFormatS = StringRegExp($vRequest, "<paste_format_short>(.*?)</paste_format_short>", 3) $vPasteURL = StringRegExp($vRequest, "<paste_url>(.*?)</paste_url>", 3) $vPasteHits = StringRegExp($vRequest, "<paste_hits>(.*?)</paste_hits>", 3) For $i = 0 to 17 $vDataArr[$i][0] = $vPasteKey[$i] ;~ Paste Key $vDataArr[$i][1] = $vPasteDate[$i] ;~ Paste Date $vDataArr[$i][2] = $vPasteTitle[$i] ;~ Paste Title $vDataArr[$i][3] = $vPasteSize[$i] ;~ Paste Size (KB) $vDataArr[$i][4] = $vPasteExpiry[$i] ;~ Paste Expiry Time $vDataArr[$i][5] = $vPastePrivate[$i] ;~ Paste Publicity $vDataArr[$i][6] = $vPasteFormatL[$i] ;~ Paste Format Long $vDataArr[$i][7] = $vPasteFormatS[$i] ;~ Paste Formate Short $vDataArr[$i][8] = $vPasteURL[$i] ;~ Paste URL $vDataArr[$i][9] = $vPasteHits[$i] ;~ Paste Hits Next Return SetError(0, 0, $vDataArr) EndFunc ; #FUNCTION# ==================================================================================================================== ; Name...........: _DeletePaste ; Description ...: Delete a Given Users Paste ; Syntax.........: _DeletePaste($vAPIUserKey, $vPasteKey) ; Parameters ....: $vAPIUserKey - Pastebin API User Key ; $vPasteKey - Paste Key, Obtained From _ListUserPastes Function ; Return values .: Success - Deletes Paste Returns "Paste Removed" ; Author ........: mrflibblehat (danielcarroll@gmail.com) ; =============================================================================================================================== Func _DeletePaste($vAPIUserKey, $vPasteKey) Local $sData = ("api_option=delete&api_user_key=" & $vAPIUserKey & "&api_dev_key=" & $vAPIDevKey & "&api_paste_key=" & $vPasteKey) Local $vRequest = _WinHttpSimpleRequest($vConnect, "POST", "/api/api_post.php", $WINHTTP_NO_REFERER, $sData, "Content-Type: application/x-www-form-urlencoded") if (@error) then Return SetError(3, 0, "Unable To Send Request") Return SetError(0, 0, $vRequest) EndFunc ; #FUNCTION# ==================================================================================================================== ; Name...........: _UserDetails ; Description ...: Delete a Given Users Paste ; Syntax.........: _UserDetails($vAPIUserKey) ; Parameters ....: $vAPIUserKey - Pastebin API User Key ; Return values .: Success - Returns User Details ; Author ........: mrflibblehat (danielcarroll@gmail.com) ; =============================================================================================================================== Func _UserDetails($vAPIUserKey) Local $sData = ("api_option=userdetails&api_user_key=" & $vAPIUserKey & "&api_dev_key=" & $vAPIDevKey) Local $vRequest = _WinHttpSimpleRequest($vConnect, "POST", "/api/api_post.php", $WINHTTP_NO_REFERER, $sData, "Content-Type: application/x-www-form-urlencoded") if (@error) then Return SetError(3, 0, "Unable To Send Request") Return SetError(0, 0, $vRequest) EndFunc ; #FUNCTION# ==================================================================================================================== ; Name...........: _GetRawPaste ; Description ...: Delete a Given Users Paste ; Syntax.........: _GetRawPaste($vPasteUrl) ; Parameters ....: $vPasteUrl - Pastebin URL ; Return values .: Success - Returns Paste ; Author ........: mrflibblehat (danielcarroll@gmail.com) ; =============================================================================================================================== Func _GetRawPaste($vPasteUrl) $vPasteKey = StringRegExp($vPasteUrl, "pastebin.com/(\H+)", 3) if (@error) then Return SetError(3, 0, "Unable To Read URL") Local $vRequest = _WinHttpSimpleRequest($vConnect, "GET", "/raw.php?i=" & $vPasteKey[0]) if (@error) then Return SetError(3, 0, "Unable To Connect To URL") Return SetError(0, 0, $vRequest) EndFunc Example #Include <Pastebin.au3> #include <Array.au3> _PB_Open() ;~ Create A New Paste And Return URL To Console $vPaste = _CreatePaste("This is a test paste", "Title of Test Paste") ConsoleWrite("Created Paste: " & $vPaste & @CRLF) ;~ Get Trending Pastes And Show in _ArrayDisplay $vTrends = _ListTrendingPastes() _ArrayDisplay($vTrends) ;~ Print Paste To Console $RawPaste = _GetRawPaste("http://pastebin.com/8sTHzAD7") ConsoleWrite("Raw Paste: " & $RawPaste) _PB_Close()1 point -
This is for my C# fans out there who enjoy OOP. I have created a really rough draft (I mean it's super basic) of the Stopwatch Class in .NET, because I had the idea whilst travelling home and just thought it's neat to show a different paradigm to that of procedural programming. Enjoy. #include <WinAPISys.au3> Global Const $STOPWATCH_GUID = '804835D8-0DF4-11E4-A11F-29560707A45E', $STOPWATCH_TICKSPERMILLISECOND = 10000, $STOPWATCH_TICKSPERSECOND = $STOPWATCH_TICKSPERMILLISECOND * 1000 Global Enum $STOPWATCH_TIMER, $STOPWATCH_RUNNING, $STOPWATCH_ELAPSED, $STOPWATCH_ISHIGHRESOLUTION, $STOPWATCH_FREQUENCY, $STOPWATCH_TICKFREQUENCY, $STOPWATCH_ID, $STOPWATCH_MAX #Region Example Example() Func Example() Local $hStopWatch = Stopwatch() ConsoleWrite('IsRunning: ' & Stopwatch_IsRunning($hStopWatch) & @CRLF) ; Display running status. ConsoleWrite('Started' & @CRLF) Stopwatch_Start($hStopWatch) ; Start the stopwatch. ConsoleWrite('IsRunning: ' & Stopwatch_IsRunning($hStopWatch) & @CRLF) ; Display running status. Sleep(1000) ; Wait for 1 second. Stopwatch_Stop($hStopWatch) ; Stop the stopwatch. ConsoleWrite('Elapsed ms Time: ' & Stopwatch_ElapsedMilliseconds($hStopWatch) & @CRLF) ConsoleWrite('Stopped.' & @CRLF) ConsoleWrite('Waiting for 3 seconds whilst the stopwatch is stopped.' & @CRLF) Sleep(3000) ; Wait for 3 seconds. ConsoleWrite('Started' & @CRLF) Stopwatch_Start($hStopWatch) ; Start the stopwatch again. ConsoleWrite('Waiting for 2 seconds whilst the stopwatch is running' & @CRLF) Sleep(2000) ; Wait for 2 seconds. For $i = 1 To 10 ; The number of milliseconds is shown even when the stopwatch is running. ConsoleWrite('Elapsed ms Time: ' & Stopwatch_ElapsedMilliseconds($hStopWatch) & @CRLF) Sleep(250) Next Stopwatch_Stop($hStopWatch) ; Stop the stopwatch. ConsoleWrite('Elapsed ms Time: ' & Stopwatch_ElapsedMilliseconds($hStopWatch) & @CRLF) ; This should be about 5 seconds or so. ConsoleWrite('Stopped' & @CRLF) ConsoleWrite('IsRunning: ' & Stopwatch_IsRunning($hStopWatch) & @CRLF) ; Display running status. EndFunc ;==>Example #EndRegion Example ; Stopwatch Class: http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch(v=vs.110).aspx Func Stopwatch() Local $aStopwatch[$STOPWATCH_MAX] $aStopwatch[$STOPWATCH_ID] = $STOPWATCH_GUID Stopwatch_Reset($aStopwatch) $aStopwatch[$STOPWATCH_FREQUENCY] = _WinAPI_QueryPerformanceFrequency() If $aStopwatch[$STOPWATCH_FREQUENCY] > 0 Then $aStopwatch[$STOPWATCH_ISHIGHRESOLUTION] = True $aStopwatch[$STOPWATCH_TICKFREQUENCY] = $STOPWATCH_TICKSPERSECOND $aStopwatch[$STOPWATCH_TICKFREQUENCY] /= $aStopwatch[$STOPWATCH_FREQUENCY] Else $aStopwatch[$STOPWATCH_ISHIGHRESOLUTION] = False $aStopwatch[$STOPWATCH_FREQUENCY] = $STOPWATCH_TICKSPERSECOND $aStopwatch[$STOPWATCH_TICKFREQUENCY] = 1 EndIf Return $aStopwatch EndFunc ;==>Stopwatch Func Stopwatch_ElapsedMilliseconds(ByRef $aStopwatch) Return (__Stopwatch_IsStopwatch($aStopwatch) ? __Stopwatch_GetElapsedDateTimeTicks($aStopwatch) / $STOPWATCH_TICKSPERMILLISECOND : 0) EndFunc ;==>Stopwatch_ElapsedMilliseconds Func Stopwatch_ElapsedTicks(ByRef $aStopwatch) Return (__Stopwatch_IsStopwatch($aStopwatch) ? __Stopwatch_GetElapsedDateTimeTicks($aStopwatch) : 0) EndFunc ;==>Stopwatch_ElapsedTicks Func Stopwatch_IsRunning(ByRef $aStopwatch) Return (__Stopwatch_IsStopwatch($aStopwatch) ? $aStopwatch[$STOPWATCH_RUNNING] : Null) EndFunc ;==>Stopwatch_IsRunning Func Stopwatch_Reset(ByRef $aStopwatch) If __Stopwatch_IsStopwatch($aStopwatch) Then $aStopwatch[$STOPWATCH_ELAPSED] = 0 $aStopwatch[$STOPWATCH_RUNNING] = False $aStopwatch[$STOPWATCH_TIMER] = 0 EndIf Return True EndFunc ;==>Stopwatch_Reset Func Stopwatch_Restart(ByRef $aStopwatch) If __Stopwatch_IsStopwatch($aStopwatch) Then Stopwatch_Reset($aStopwatch) Stopwatch_Start($aStopwatch) EndIf Return True EndFunc ;==>Stopwatch_Restart Func Stopwatch_Start(ByRef $aStopwatch) If __Stopwatch_IsStopwatch($aStopwatch) And Not $aStopwatch[$STOPWATCH_RUNNING] Then $aStopwatch[$STOPWATCH_RUNNING] = True $aStopwatch[$STOPWATCH_TIMER] = __Stopwatch_GetTimestamp($aStopwatch) EndIf Return True EndFunc ;==>Stopwatch_Start Func Stopwatch_StartNew() Local $aStopwatch = Stopwatch() Stopwatch_Start($aStopwatch) Return $aStopwatch EndFunc ;==>Stopwatch_StartNew Func Stopwatch_Stop(ByRef $aStopwatch) If __Stopwatch_IsStopwatch($aStopwatch) And $aStopwatch[$STOPWATCH_RUNNING] Then $aStopwatch[$STOPWATCH_ELAPSED] = __Stopwatch_GetRawElapsedTicks($aStopwatch) $aStopwatch[$STOPWATCH_RUNNING] = False EndIf Return True EndFunc ;==>Stopwatch_Stop Func __Stopwatch_GetElapsedDateTimeTicks(ByRef $aStopwatch) Return (__Stopwatch_GetRawElapsedTicks($aStopwatch) * ($aStopwatch[$STOPWATCH_ISHIGHRESOLUTION] ? $aStopwatch[$STOPWATCH_TICKFREQUENCY] : $STOPWATCH_TICKSPERMILLISECOND)) EndFunc ;==>__Stopwatch_GetElapsedDateTimeTicks Func __Stopwatch_GetRawElapsedTicks(ByRef $aStopwatch) Local $iElapsedTime = $aStopwatch[$STOPWATCH_ELAPSED] If $aStopwatch[$STOPWATCH_RUNNING] Then If $aStopwatch[$STOPWATCH_ISHIGHRESOLUTION] Then Local $iTimeStamp = __Stopwatch_GetTimestamp($aStopwatch) $iTimeStamp = $iTimeStamp - $aStopwatch[$STOPWATCH_TIMER] $iElapsedTime += $iTimeStamp Else $iElapsedTime += TimerDiff($aStopwatch[$STOPWATCH_TIMER]) EndIf EndIf Return $iElapsedTime EndFunc ;==>__Stopwatch_GetRawElapsedTicks Func __Stopwatch_GetTimestamp(ByRef $aStopwatch) Return ($aStopwatch[$STOPWATCH_ISHIGHRESOLUTION] ? _WinAPI_QueryPerformanceCounter() : TimerInit()) EndFunc ;==>__Stopwatch_GetTimestamp Func __Stopwatch_IsStopwatch(ByRef $aStopwatch) ; Internal function only. Return (UBound($aStopwatch) = $STOPWATCH_MAX And $aStopwatch[$STOPWATCH_ID] = $STOPWATCH_GUID) EndFunc ;==>__Stopwatch_IsStopwatch1 point
-
[Resolved] Quiz with randomization
czardas reacted to DicatoroftheUSA for a topic
http://www.urbandictionary.com/define.php?term=dicator Just kidding, it was a misspelling, because when I set it, it had a character limitation. I randomly deleted a character out of laziness.1 point -
Now, ask yourself the question whether you want the keyword "test" to be found in the string "testing". And so, do not use StringInStr... #Include <Array.au3> Local $aKeywords = FileReadToArray("file1.txt") Local $sContent = FileRead("file2.txt") Local $aResult[ UBound($aKeywords) ][2] For $i = 0 To UBound($aResult) - 1 $aResult[$i][0] = $aKeywords[$i] $aResult[$i][1] = StringRegExp($sContent, "\b" & $aResult[$i][0] & "\b") ? "found" : "not found" Next _ArrayDisplay($aResult)1 point
-
Search in Text the report
usera reacted to JLogan3o13 for a topic
I agree with J1, didn't realize you had been here so long, usera. You should know by now to put some effort in before you post. As I worked this up anyway, this is how I would do it as opposed to Damein's method. $aFile1 = FileReadToArray(@DesktopDir & "\FILE1.txt") $aFile2 = FileReadToArray(@DesktopDir & "\FILE2.txt") For $keyword In $aFile1 For $line In $aFile2 If StringInStr($line, $keyword) Then MsgBox(0, "", $keyword & " found!") Next Next1 point -
This should get you started. I advise you to read the help file a bit more, pretty basic stuff. #include <Array.au3> Local $KeyWordArray[6] $KeyWordArray[1] = "Test" $KeyWordArray[2] = "Test2" $KeyWordArray[3] = "Test3" $KeyWordArray[4] = "Test4" $KeyWordArray[5] = "Test5" $File = FileOpen("x") $FileRead = FileRead($File) For $i = 1 To 5 If StringInStr($FileRead, $KeyWordArray[$i]) Then MsgBox(0, "Found", "Found the keyword" & @CRLF & $KeyWordArray[$i]) EndIf Next1 point
-
Erm ... this is one of the best well documented UDFs I know that isn't part of AutoIt. My new saying is "lack of code, lack of trying!"1 point
-
GetTimes() returns 0 so do not use GUICtrlSetData to add the return value of 0 to the combo. Updated code #include <GuiComboBox.au3> #include <GUIConstantsEx.au3> #include <Date.au3> Global $CurrentTime, $i, $AMPM If @HOUR > 12 Then $AMPM = "PM" ElseIf @HOUR = 0 Then $AMPM = "AM" Else $AMPM = "AM" EndIf GUICreate("ComboTest", 200, 40) Global $hCombo = GUICtrlCreateCombo("New install time:", 10, 10, 180, 25) ; function returns value of 0 GetTimes() GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd Func GetTimes() Local $CurrentHour = StringTrimRight(_NowTime(), 9) _GUICtrlComboBox_BeginUpdate($hCombo) For $i = $CurrentHour To 11 _GUICtrlComboBox_InsertString($hCombo, $i & ":00 " & $AMPM, -1) _GUICtrlComboBox_InsertString($hCombo, $i & ":30 " & $AMPM, -1) Next _GUICtrlComboBox_EndUpdate($hCombo) EndFunc ;==>GetTimes1 point
-
HexControl UDF - A side by side HEX/String GUI control
mesale0077 reacted to GtaSpider for a topic
Hey, Just needed for some projects a side by side control, on the left the binary data on the rigth the string. Nothing more to say here, take a look for yourself. HexControl UDF is licensed under a Creative Commons Attribution 4.0 International License. http://creativecommons.org/licenses/by/4.0/ Greetz, Spider Hex Control.zip1 point