Leaderboard
Popular Content
Showing content with the highest reputation on 02/02/2018 in all areas
-
AutoIt v3.3.14.3 has been released. Thanks to everyone involved, both visible and behind the scenes. Download it here. Complete list of changes: History10 points
-
Using my signature: $oIE = _IECreate("Google.com") $oInput = _IEGetObjById($oIE,'lst-ib') _IEFormElementSetValue($oInput,"test") _IEAction($oInput,"blur") $sXpath = "//li[@class='sbsb_c gsfs')]//div[@class='sbqs_c']" $aReturnResults = BGe_IEGetDOMObjByXPathWithAttributes($oIE,$sXpath,5000) _ArrayDisplay($aReturnResults) For $i = 0 To UBound($aReturnResults)-1 ConsoleWrite($aReturnResults[$i].Innertext & @CRLF) Next output: speed test typing test iq test broadband speed test personality test myers briggs test theory test depression test pregnancy test driving test Although, if some are searches you have done in the past (they will have a 'remove' link next to them), you would need to do 2 calls... the second would be like this: $sXpath = "//li[@class='sbsb_c gsfs')]//span[@class='sbpqs_a']" If the first array is not ubound=10, then you can do the second search to get 'previous searches history' data.2 points
-
New version - 17 Jun 23 ======================= Added: Added 24hr unpadded H mask. New UDF in zip below. Changelog: Changelog.txt Here is my version of a UDF to transform date/time formats. It is entirely self-contained and although it defaults to English for the month/day names, you can set any other language very simply, even having different ones for the input and output. You need to provide a date/time string, a mask to tell the UDF what is in the string, and a second mask to format the output - the masks use the standard "yMdhmsT" characters. This is an example script showing some of the features: #include <Constants.au3> ; Only required for MsgBox constants #include "DTC.au3" Global $sIn_Date, $sOut_Date ; Basic format $sIn_Date = "13/08/02 18:30:15" $sOut_Date = _Date_Time_Convert($sIn_Date, "yy/MM/dd HH:mm:ss", "dddd, d MMMM yyyy at h:mm TT") MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) ; Note how day name is corrected $sIn_Date = "2013082 Sun 12:15:45 PM" $sOut_Date = _Date_Time_Convert($sIn_Date, "yyyyMMd ddd hh:mm:ss TT", "dddd, dd MMM yy") MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) ; Note use of $i19_20 parameter to change century $sIn_Date = "13/08/02 18:30:15" $sOut_Date = _Date_Time_Convert($sIn_Date, "yy/MM/dd HH:mm:ss", "dddd, d MMMM yyyy at h:mm TT", 10) MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) $sIn_Date = "18:30:15 13/08/02" $sOut_Date = _Date_Time_Convert($sIn_Date, "HH:mm:ss yy/MM/dd", "h:mm TT on ddd d MMM yyyy") MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) ; Just to show it works both ways $sIn_Date = "Friday, 2 August 2013 at 6:30 PM" $sOut_Date = _Date_Time_Convert($sIn_Date, "dddd, d MMMM yyyy at h:mm TT", "dd/MM/yy HH:mm") MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) $sIn_Date = $sOut_Date $sOut_Date = _Date_Time_Convert($sIn_Date, "dd/MM/yy HH:mm", "dddd, d MMMM yyyy at h:mm TT") MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) ; Note false returns for non-specified elements $sIn_Date = "6:15 P" $sOut_Date = _Date_Time_Convert($sIn_Date, "h:m T", "yy/MM/dd HH:mm:ss") MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) ; Note use of "x" in place of actual spacing/punctuation $sIn_Date = "Sun 12:15:45 PM" $sOut_Date = _Date_Time_Convert($sIn_Date, "dddxhhxmmxssxTT", "dddd HH:mm") MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) ; Output month/day strings changed to French _Date_Time_Convert_Set("smo", "jan,fév,mar,avr,mai,juin,juil,août,sept,oct,nov,déc") _Date_Time_Convert_Set("ldo", "dimanche,lundi,mardi,mercredi,jeudi,vendredi,samedi") _Date_Time_Convert_Set("SDO", 3) ; Each short name is first 3 chars of equivalent long name ; Note as only the short day names are required, they could have been set directly: ; _Date_Time_Convert_Set("sdo", "dim,lun,mar,mer,jeu,ven,sam") $sIn_Date = "20130716 Sun 12:15:45 PM" $sOut_Date = _Date_Time_Convert($sIn_Date, "yyyyMMd ddd hh:mm:ss TT", "ddd, d MMM yy") MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) ; Output month/day strings changed to German _Date_Time_Convert_Set("smo", "Jan.,Feb.,März,Apr.,Mai,Juni,Juli,Aug.,Sept.,Okt.,Nov.,Dez.") _Date_Time_Convert_Set("ldo", "Sonntag,Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag") $sIn_Date = "20130716 Sun 12:15:45 PM" $sOut_Date = _Date_Time_Convert($sIn_Date, "yyyyMMd ddd hh:mm:ss TT", "dddd, d MMM yy") MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) ; All strings reconverted to default English _Date_Time_Convert_Set() ; As shown here $sIn_Date = "20130716 Sun 12:15:45 PM" $sOut_Date = _Date_Time_Convert($sIn_Date, "yyyyMMd ddd hh:mm:ss TT", "ddd, d MMM yy") MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) And here is the UDF and example in zip format: DTC.zip As always, happy for any comments. M231 point
-
Looking at the code for __ArrayQuickSort1D() and __ArrayQuickSort2D(), I see, for example, StringCompare($vTmp, $vCur) : there is no casesense parameter, so comparison of string elements is always case-insensitive. I am thinking that _ArraySort() might have one more optional parameter: casesense. ArrayQuickSort1D() and __ArrayQuickSort2D() would also need this parameter. This change would, I think, take minimal effort, and would not break scripts. Does this make sense? Should there be a feature request in Trac ? I haven't figured out how __ArrayDualPivotSort() does comparisons.1 point
-
Creating a folder with Date and time and need to save a file in created directory
abdulrahmanok reacted to Babu16 for a topic
Yes, This code is working fine, thank you so much:-)1 point -
Creating a folder with Date and time and need to save a file in created directory
Babu16 reacted to abdulrahmanok for a topic
sure that's will not working because $sFilepath1 will return 1 maybe this will work: #include <ScreenCapture.au3> $sFilepath ="C:\projects" $sFilepath1 = DirCreate($sFilepath &@YEAR &@MON &@MDAY&"-"&@HOUR &@MIN &@SEC) ConsoleWrite($sFilepath1) ConsoleWrite(@CRLF&$sFilepath&@YEAR &@MON &@MDAY&"-"&@HOUR &@MIN &@SEC & "\Image01.jpg") _ScreenCapture_Capture($sFilepath &@YEAR &@MON &@MDAY&"-"&@HOUR &@MIN &@SEC & "\Image01.jpg") ShellExecute($sFilepath &@YEAR &@MON &@MDAY&"-"&@HOUR &@MIN &@SEC & "\Image01.jpg")1 point -
BDE database UDF structure
Earthshine reacted to lbsl for a topic
I have had a lot of fun using this one in the past to gain some similar C-learning idea: http://www.xbasic.org/ Doesn't cost you a dime either and even allows you to compile DLL's unlike Autoit. I even created a compiler for it to incorporate the runtime library into your executable.1 point -
LCD Countdown Timer
Earthshine reacted to Gattaca for a topic
I know this is a few years old but this might help someone else (as well as myself) what is the whole /pre_protected block for? I know its encrypted but how do you un-encrypt the text?1 point -
The fixes from post #1 are no longer needed if running AutoIt 3.3.14.3 or later1 point
-
More reliable, use the _guictrllistview_* functions. Look at the help file for (click this link): _GUICtrlListView_SetItemSelected This will also work if you ever want to run your script behind a desktop...such as when logged off. Sends will not work in those cases. Example: #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <MsgBoxConstants.au3> Example() Func Example() Local $idListview GUICreate("ListView Set Item Selected", 400, 300) $idListview = GUICtrlCreateListView("", 2, 2, 394, 268,$LVS_REPORT) GUISetState(@SW_SHOW) ; Add columns _GUICtrlListView_AddColumn($idListview, "Items", 100) ; Add items _GUICtrlListView_AddItem($idListview, "Item 1") _GUICtrlListView_AddItem($idListview, "Item 2") _GUICtrlListView_AddItem($idListview, "Item 3") ; Select item 2 _GUICtrlListView_SetItemSelected($idListview, 1) ; select the second item _GUICtrlListView_SetItemSelected($idListview, 2) ; select the third item MsgBox($MB_SYSTEMMODAL, "Information", "Item 2 Selected: " & _GUICtrlListView_GetItemSelected($idListview, 1)) ; Loop until the user exits. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example This is a VERY dumb example...you probably want to select specific files, yes? There are other _guictrllistview functions to get the text, you can loop through until you find it, and the select it. Edit...maybe that's a listbox...if that's the case, use this instead: _GUICtrlListBox_SetSel #include <GUIConstantsEx.au3> #include <GuiListBox.au3> #include <MsgBoxConstants.au3> Example() Func Example() Local $idListBox ; Create GUI GUICreate("List Box Set Sel", 400, 296) $idListBox = GUICtrlCreateList("", 2, 2, 396, 296, BitOR($LBS_STANDARD, $LBS_EXTENDEDSEL)) GUISetState(@SW_SHOW) ; Add strings _GUICtrlListBox_BeginUpdate($idListBox) For $iI = 1 To 9 _GUICtrlListBox_AddString($idListBox, StringFormat("%03d : Random string", Random(1, 100, 1))) Next _GUICtrlListBox_EndUpdate($idListBox) ; Select a few items _GUICtrlListBox_SetSel($idListBox, 3) _GUICtrlListBox_SetSel($idListBox, 4) _GUICtrlListBox_SetSel($idListBox, 5) ; Show the item selection state MsgBox($MB_SYSTEMMODAL, "Information", "Item 5 Selected: " & _GUICtrlListBox_GetSel($idListBox, 4)) ; Loop until the user exits. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example Use the spy tool to figure out what control type it is.1 point
-
Help scraping data from webpage
badcoder123 reacted to jdelaney for a topic
Perfect, so it's a table that has lots of data...use this one: _IETableWriteToArray Look at the helpfile, try to get it working, and then you can loop through the returned array, and grab your data. Helpfile example: ; Open a browser with the table example, get a reference to the first table ; on the page (index 0) and read its contents into a 2-D array #include <Array.au3> #include <IE.au3> Local $oIE = _IE_Example("table") Local $oTable = _IETableGetCollection($oIE, 0) Local $aTableData = _IETableWriteToArray($oTable) _ArrayDisplay($aTableData) _IEQuit($oIE) Example of looping through all the tables: #include <Array.au3> #include <IE.au3> $oIE = _IECreate("https://eggpool.net/index.php?miner=55713816bf48b85cc1b03db521c0142f99402925d05e726b476a67a4&action=miner&submit=Show") $oTables = _IETableGetCollection($oIE) For $oTable In $oTables $aTableData = _IETableWriteToArray($oTable) _ArrayDisplay($aTableData) Next1 point -
Good stuff...slight modification: #include <Array.au3> Local $aArray = ['Hello world','hello wo','heLlO wOrLd','HELLO WORLD','HelLo worlD','A'] _ArrayColInsert($aArray,1) For $i = 0 To UBound($aArray) -1 $aArray[$i][1] = $aArray[$i][0] For $j = 65 To 90 $aArray[$i][1] = StringReplace($aArray[$i][1], Chr($j), Chr($j) & $j, 0, 1) $aArray[$i][1] = StringReplace($aArray[$i][1], Chr($j +32), Chr($j +32) & $j -55, 0, 1) Next Next _ArraySort($aArray,0,0,0,1) _ArrayColDelete($aArray,1) _ArrayDisplay($aArray)1 point
-
Have a look at the following WinApi function would probably be faster than WMI1 point