Leaderboard
Popular Content
Showing content with the highest reputation on 05/11/2021 in all areas
-
$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByCSSSelector, "div:nth-of-type(3)") Maybe ?2 points
-
Incremental search in owner and custom drawn ListViews
pixelsearch reacted to LarsJ for a topic
In these 3 scripts, the listviews are created with the LVS_OWNERDATA style, making them true virtual listviews where no item/subitem texts are stored in the listview structures. There is simply no information to calculate the column width at an HDN_DIVIDERDBLCLICK notification. In this script without the LVS_OWNERDATA style, an owner drawn listview will store information about item/subitem texts in the listview structures so that it's possible to calculate the column width at an HDN_DIVIDERDBLCLICK notification.1 point -
If you read this page Function Chr (autoitscript.com) and play around with the Example, I'm sure you will find your solution. Here is a Debug Example (Function Chr) of my own that maybe better to understand running it in sciTE to break down what is happening in the console output. #include <MsgBoxConstants.au3> $debug = True Local $sText = "" For $i = 65 To 90 $sText = $sText & Chr($i) ; Or $sText &= Chr($i) can be used as well. If ($debug) Then ConsoleWrite("$i-" & $i & @CRLF) ConsoleWrite("$sText-" & $sText & @CRLF) ConsoleWrite("Chr($i)-" & Chr($i) & @CRLF) ConsoleWrite(@CRLF) ;; break line EndIf Next MsgBox($MB_SYSTEMMODAL, "Uppercase alphabet", $sText) ; Display the characters between 65 to 90.1 point
-
First you need to assign it to a string. Second split the string. StringSplit - AutoIt Wiki (autoitscript.com) Third. create a counter Keyword For...To...Step...Next (autoitscript.com) Then you want to assign the counter to ASCIIcode CHR Function Chr (autoitscript.com)1 point
-
Binary as InputBox to decimal and hex?
argumentum reacted to major_lee for a topic
This is cool, cause I'm learning a lot, all the different ways it can be done. I've never even considered using COM objects. Local $sBasedOn="argumentum", $iIter=1000000, $t=TimerInit() Local $sResult, $sbyteOriginal="10101010", $dec Local $o = ObjCreate("Scripting.Dictionary") $o.Add("0000", "0") $o.Add("0001", "1") $o.Add("0010", "2") $o.Add("0011", "3") $o.Add("0100", "4") $o.Add("0101", "5") $o.Add("0110", "6") $o.Add("0111", "7") $o.Add("1000", "8") $o.Add("1001", "9") $o.Add("1010", "A") $o.Add("1011", "B") $o.Add("1100", "C") $o.Add("1101", "D") $o.Add("1110", "E") $o.Add("1111", "F") For $n=1 To $iIter $sResult = "" $sbyte = $sbyteOriginal Do $sResult &= $o.Item(StringLeft($sbyte, 4)) $sbyte = StringTrimLeft($sbyte, 4) Until $sbyte = "" $sOut = $sResult &" "& Dec($sResult) Next $t=TimerDiff($t) ConsoleWrite("Based on code from: "& $sBasedOn & @CRLF& " Check: "& $sOut &" "& @CRLF &" "& $iIter &" Iterations in "& $t/1000 &" Seconds" &@CRLF&@CRLF)1 point -
Ah, i guess I understand now: this is the published history.html in Beta: ======================= Start Updates Available in Beta ==================== 14-4-2021 *** Updated Au3Stripper v21.316.1639.0.0 (Jos) - v21.316.1639.1 Fixed: Skip merging Directive lines ending with continuation character (9/04/2021) *** Updated AutoIt3Wrapper v21.316.1639.0.0 (Jos) - v21.316.1639.2 Added: SciTE console message from Watcher when AutoIt3Wrapper was terminated. (14/04/2021) *** Updated Tidy v21.316.1639.0.0 (Jos) - v21.316.1639.2 Fixed: hardcrash for one line input script (30/03/2021) - v21.316.1639.3 Fixed: hardcrash when option properconstants=1 is enabled (30/03/2021) - v21.316.1639.4 Fixed: hardcrash on a long inputline without spaces. (8/04/2021) - v21.316.1639.5 Fixed: Directive line ending with Underscore: space was added (9/04/2021) ======================= End Updates Available in Beta ==================== Which means that there are beta versions for the mentioned programs. So for example: the available Beta version of Tidy is v21.316.1639.5 and for au3stripper is v21.316.1639.1 All clear? Jos1 point
-
Binary as InputBox to decimal and hex?
major_lee reacted to argumentum for a topic
I wanna play too: Tester() Func Tester() Local $t, $sResult, $sbyteOriginal="10101010" Local $o = ObjCreate("Scripting.Dictionary") $o.Add("0000", "0") $o.Add("0001", "1") $o.Add("0010", "2") $o.Add("0011", "3") $o.Add("0100", "4") $o.Add("0101", "5") $o.Add("0110", "6") $o.Add("0111", "7") $o.Add("1000", "8") $o.Add("1001", "9") $o.Add("1010", "A") $o.Add("1011", "B") $o.Add("1100", "C") $o.Add("1101", "D") $o.Add("1110", "E") $o.Add("1111", "F") $t = TimerInit() For $n = 1 To 1000 ; >>> 9.7685 - $sResult: AA $sResult = "" $sbyte = $sbyteOriginal Do $sResult &= $o.Item(StringLeft($sbyte, 4)) $sbyte = StringTrimLeft($sbyte, 4) Until $sbyte = "" Next ConsoleWrite(">>> " &TimerDiff($t)& " - $sResult: " & $sResult & @CRLF) EndFunc And, I'd win 1st price for slowest original idea Edit: since I don't wanna lose to myself, here is a yet slower ones:1 point -
1 point
-
Binary as InputBox to decimal and hex?
Gianni reacted to JockoDundee for a topic
Free your mind from conceptual limitations, and all sorts of solutions will appear1 point -
Strange behaviour using GUICtrlCreateIcon
FrancescoDiMuro reacted to Nine for a topic
@Jemboy I don't know why for some ppl it is such an ugly style to check for errors. Because in any languages, you must always try to create bullet proof applications. All good programmers adopt this best practice.1 point -
Need regex help please
JockoDundee reacted to Nine for a topic
Couldn't that pattern be streamlined ? And be more robust in case another letter (ex Z:) be part of a field ? Local $teststring [] = ["O: 121212 N: nikink-vm2, nikink-vm, xstf1111a9lt986 D: Stuff and details and things ON 1234", _ "M: ABCDEFABCDEG, 12acac12acac O: 123 D: Stuff and details and things ON 1234 N: nikink-vm2, nikink-vm, xstf1111a9lt986", _ "N: nikink-vm2, nikink-vm, xstf1111a9lt986 D: Stuff and details and things ON 1234 M: ABCDEFABCDEG, 12acac12acac ", _ ""] For $i = 0 To UBound($teststring) - 1 ConsoleWrite ("N = " & getvalues($teststring[$i], "N") & @CRLF) ConsoleWrite ("D = " & getvalues($teststring[$i], "D") & @CRLF) ConsoleWrite ("M = " & getvalues($teststring[$i], "M") & @CRLF) ConsoleWrite ("O = " & getvalues($teststring[$i], "O") & @CRLF) ConsoleWrite ("===================================" & @CRLF) Next Func getvalues($string, $letter) Local $pattern = $letter & ":\s(.*?)([NDMO]:|$)" Local $matches = StringRegExp($string, $pattern, 1) If not IsArray($matches) Then Return "" Return $matches[0] EndFunc1 point -
Need regex help please
JockoDundee reacted to mikell for a topic
This needs an error checking $teststring3 = "N: nikink-vm2, nikink-vm, xstf1111a9lt986 D: Stuff and details and things ON 1234 M: ABCDEFABCDEG, 12acac12acac " ; $teststring3 = "" Func getvalues($string, $letter) $pattern = "(?:" & $letter & ":\s*([A-Za-z0-9-,\s]*))([A-Z]:|$)" $matches = StringRegExp($string, $pattern,1) If not IsArray($matches) Then ConsoleWrite($pattern & " : " & "no match" & @CRLF) Return "no match" EndIf ConsoleWrite($pattern & " : " & $matches[0] & @CRLF) Return $matches[0] EndFunc ConsoleWrite(@CRLF & $teststring3 & @CRLF) getvalues($teststring3, "N") getvalues($teststring3, "M") getvalues($teststring3, "O") getvalues($teststring3, "D")1 point -
Why AutoIt, and not another language like C# or Python?
major_lee reacted to matwachich for a topic
Because when you distribute an AutoIt program, you clients/customers/users wont need to download some 100MB shitty redistributables... And, knowing pretty well AutoIt and others languages (C and GoLang), I can tell you that AutoIt is strong enough to make pretty anything for Windows.1 point -
Getting Filtertext from Header / Listview
pixelsearch reacted to LarsJ for a topic
Here you are: #include <Constants.au3> #include <GUIConstants.au3> #include <WindowsConstants.au3> #include <GUIListView.au3> #include <WinAPI.au3> $gui = GUICreate("listview filter", 400, 250, -1, -1) $listview = GUICtrlCreateListView("col0|col1|col2", 10, 10, 380, 230) GUICtrlSendMsg(-1, 0x101E, 0, 125) GUICtrlSendMsg(-1, 0x101E, 1, 125) GUICtrlSendMsg(-1, 0x101E, 2, 125) GUICtrlCreateListViewItem("blue|green|blue", $listview) GUICtrlCreateListViewItem("red|blue|green", $listview) GUICtrlCreateListViewItem("green|red|red", $listview) GUICtrlCreateListViewItem("blue|green|blue", $listview) GUICtrlCreateListViewItem("red|blue|green", $listview) GUICtrlCreateListViewItem("green|red|red", $listview) GUICtrlCreateListViewItem("blue|green|blue", $listview) GUICtrlCreateListViewItem("red|blue|green", $listview) GUICtrlCreateListViewItem("green|red|red", $listview) GUICtrlCreateListViewItem("blue|green|blue", $listview) GUICtrlCreateListViewItem("red|blue|green", $listview) GUICtrlCreateListViewItem("green|red|red", $listview) GUISetState() ;Use of lock/unlock and begin/end update is just to cause repainting so the filterbar is fully visible GUISetState(@SW_LOCK, $gui) _GUICtrlListView_BeginUpdate($listview) ;Add the filter bar to the header control $header = _GUICtrlListView_GetHeader($listview) $styles = _WinAPI_GetWindowLong($header, $GWL_STYLE) _WinAPI_SetWindowLong($header, $GWL_STYLE, BitOR($styles, $HDS_FILTERBAR)) ;Use of lock/unlock and begin/end update is just to cause repainting so the filterbar is fully visible _GUICtrlListView_EndUpdate($listview) GUISetState(@SW_UNLOCK, $gui) _GUICtrlHeader_EditFilter($header, 0) Send("Filter 1") ;Register WM_NOTIFY to handle $HDN_FILTERBTNCLICK messages GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") ;Loop GUI until exit Do $msg = GUIGetMsg() Until $msg = $GUI_EVENT_CLOSE Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) Local $hWndFrom, $iIDFrom, $iCode Local $tNMHDR, $tNMHEADER, $tNMHDFILTERBTNCLICK, $tHDTEXTFILTER, $tNMHDDISPINFO Local $iHeaderItem, $tItem Local $HDFT_ISSTRING = 0x0 Local $HDFT_ISNUMBER = 0x1 $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $header Switch $iCode Case $HDN_FILTERBTNCLICK ; Notifies the header control's parent window when the filter button is clicked or in response to an $HDM_SETITEM message $tNMHDFILTERBTNCLICK = DllStructCreate($tagNMHDFILTERBTNCLICK, $ilParam) $column = DllStructGetData($tNMHDFILTERBTNCLICK, "Item") $tText = DllStructCreate( "wchar[64]" ) $pText = DllStructGetPtr( $tText ) $tHDTEXTFILTER = DllStructCreate( $tagHDTEXTFILTER ) $pHDTEXTFILTER = DllStructGetPtr( $tHDTEXTFILTER ) DllStructSetData( $tHDTEXTFILTER, "Text", $pText ) DllStructSetData( $tHDTEXTFILTER, "TextMax", 64 ) $tHDITEM = DllStructCreate( $tagHDITEM ) DllStructSetData( $tHDITEM, "Mask", $HDI_FILTER ) DllStructSetData( $tHDITEM, "Type", 0 ) DllStructSetData( $tHDITEM, "pFilter", $pHDTEXTFILTER ) $pHDITEM = DllStructGetPtr( $tHDITEM ) _SendMessage( $header, $HDM_GETITEMW, $column, $pHDITEM ) $sText = DllStructGetData( $tText, 1 ) MsgBox(0, "Msg", "Filter button click for column " & $column & @CRLF & _ "Text: " & $sText) ;Return True ; An $HDN_FILTERCHANGE notification will be sent to the header control's parent window ; This notification gives the parent window an opportunity to synchronize its user interface elements Return False ; If you do not want the notification sent Case $HDN_FILTERCHANGE ; Notifies the header control's parent window that the attributes of a header control filter are being changed or edited ;$tNMHEADER = DllStructCreate($tagNMHEADER, $ilParam) ; no return value EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY Nice filters. I've never used filters before. It seems as if you have to do everything manually. If you type a filter text you have to manually update the rows in the listview to reflect the filter.1 point