All Activity

This stream auto-updates   

  1. Past hour
  2. This is true. Thanks for the tip
  3. Today
  4. 1) Would a style of coding where everything of the GUI is in an array make sense ? 2) Can creating controls with Execute() bring trouble down the road ? This is the basic idea: Global $g_Gui[10][10] = [[0]] #include <MsgBoxConstants.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Global $eGui = GUICtrlArray('GUICreate',"Form1", 305, 269, 50, 50, BitOR($GUI_SS_DEFAULT_GUI,$WS_MAXIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_TABSTOP), BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE)) Global $eInputForGofigure = GUICtrlArray("GUICtrlCreateInput","Input1", 32, 32, 121, 21,-1, -1, $GUI_DOCKLEFT+$GUI_DOCKTOP+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) Global $eEditForGofigure = GUICtrlArray('GUICtrlCreateEdit',"Edit1"&@CRLF&"=P", 32, 72, 185, 89,-1, -1, $GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM) Global $eBttnShowArray = GUICtrlArray("GUICtrlCreateButton","Show Gui array", 176, 24, 100, 25,-1, -1, $GUI_DOCKLEFT+$GUI_DOCKTOP+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) Global $eLabelForGofigure = GUICtrlArray("GUICtrlCreateLabel","Label1", 40, 180, 180, 17,-1, -1, $GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM+$GUI_DOCKHEIGHT) GUISetState(@SW_SHOW) Func GUICtrlArray($sCtrl, $sText, $iLeft, $iTop , $iWidth = default , $iHeight = default , $iStyle = -1, $iExStyle = -1, $iResize = 0) $g_Gui[0][0] += 1 Local $i = $g_Gui[0][0] $g_Gui[$i][1] = $sCtrl $g_Gui[$i][2] = $sText $g_Gui[$i][3] = $iTop $g_Gui[$i][4] = $iWidth $g_Gui[$i][5] = $iHeight $g_Gui[$i][6] = $iStyle $g_Gui[$i][7] = $iExStyle $g_Gui[$i][8] = $iResize $g_Gui[$i][9] = "anything thing else ?" Switch $sCtrl Case "GUICreate" $g_Gui[$i][0] = Execute($sCtrl & "('" & $sText & "'," & $iLeft & "," & $iTop & "," & $iWidth & "," & $iHeight & "," & $iStyle & "," & $iExStyle & "," & $iResize & ")") Case Else $g_Gui[$i][0] = Execute($sCtrl & "('" & $sText & "'," & $iLeft & "," & $iTop & "," & $iWidth & "," & $iHeight & "," & $iStyle& "," & $iExStyle & ")") If $iResize Then GUICtrlSetResizing($g_Gui[$i][0], $iResize) EndSwitch Return $i EndFunc While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete() Exit Case $g_Gui[$eBttnShowArray][0] _ArrayDisplay($g_Gui, "$g_Gui") EndSwitch WEnd 3) Do you have an idea to make this "mode of coding" more functional ? 4) Is this a waste of time ( for 1 or more reasons ) ? As always, anything you post will be used against you is welcomed
  5. My cherry mx buttons are fine. I don’t use their custom software I just use the Microsoft built in drivers. Lol
  6. See, thats why I have a modular script running on startup through the autoit compiler. Far less resource intensive than multiple compiled exe's, and crazy easy to modify.
  7. Yesterday
  8. @AdminC the Examples forum very, very clearly states: Please pay attention to where you're posting in the future.
  9. You're not sending data, you're setting it. Rather than "{ENTER}" try @CRLF
  10. @Light0 how about posting your code so we can see what you're trying to accomplish, rather than having us guess
  11. @OP You will see the difference between strings using an editor with 'composite fonts'. The first string contains a combining dot above(Ux0307). The second string has a latin small letter z with dot above(Ux017C). If you go for a solution dealing with a file have a look here: Have fun !
  12. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("shutdown by AU3Builder", 300, 133, 192, 124) $Progress1 = GUICtrlCreateProgress(16, 24, 209, 25) $Label1 = GUICtrlCreateLabel("", 112, 112, 21, 17) $Button1 = GUICtrlCreateButton(" Start Countdown", 64, 64, 105, 33) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 Countdown(20,20) EndSwitch WEnd Func Countdown($progressbar,$label) $I = 0 Do Sleep(1000) $I = $I + 1 $label = $label - 1 GUICtrlSetData($Progress1,$I/$progressbar*100) GUICtrlSetData($Label1,$label) Until $i = $progressbar EndFunc Here you are
  13. Hi guys! So I´ve been playing around with AutoIt again after a couple of years of absence. I'm trying to make ImageSearch work in my favor and got a test script going that looks like this: #include <ImageSearch2015.au3> Local $findImage[8], $resultPosition, $tolerance, $transparency, $waitSecs, $x, $y $findImage[0] = 7 $findImage[1] = "C:\Users\Micke\Desktop\AutoIt Script\ImageSearch2015\HK.png" $findImage[2] = "C:\Users\Micke\Desktop\AutoIt Script\ImageSearch2015\K4.png" $findImage[3] = "C:\Users\Micke\Desktop\AutoIt Script\ImageSearch2015\K5.png" $findImage[4] = "C:\Users\Micke\Desktop\AutoIt Script\ImageSearch2015\R8.png" $findImage[5] = "C:\Users\Micke\Desktop\AutoIt Script\ImageSearch2015\S7.png" $findImage[6] = "C:\Users\Micke\Desktop\AutoIt Script\ImageSearch2015\S8.png" $findImage[7] = "C:\Users\Micke\Desktop\AutoIt Script\ImageSearch2015\SJ.png" $x=0 $y=0 $waitSecs = 1 $findImage = _WaitForImagesSearch($findImage, $waitSecs, $resultPosition, $x, $y, $tolerance, $transparency = 0) ConsoleWrite($findImage & @CRLF) It works but kind of slow(2.5 s) and the area I want to search for those .png's is much smaller than my desktop, so my question is how would I go about setting that smaller area up in my script?
  14. I believe the issue you are running into is that $oIE always points to the first tab and not at any of the subsequent tabs. So each call to _IELoadWait is checking the first tab, instead of the most recent one. You will have to get an object reference to the desired tab before you can check it's status with _IELoadWait.
  15. Hello how can I send a {Enter} into the edit window ($cmd)? I tried it first with: GUICtrlSetData($cmd, "Line 1" + "{ENTER}") but it doesn´t work. Can someone help me please? #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GUIConstants.au3> $Admin = GUICreate("Admin", 234, 168, 192, 229, $GUI_SS_DEFAULT_GUI, BitOR($WS_EX_OVERLAPPEDWINDOW,$WS_EX_TRANSPARENT,$WS_EX_WINDOWEDGE)) GUISetBkColor(0xB4B4B4) $exit = GUICtrlCreateButton("Close", 160, 136, 65, 25) $cmd = GUICtrlCreateEdit("",0, 0, 225, 137, $ES_AUTOVSCROLL + $WS_VSCROLL) GUICtrlSetData(-1, "") GUICtrlSetFont(-1, 10, 400, 0, "Candara") GUICtrlSetBkColor(-1, 0xE3E3E3) $cmd_clear = GUICtrlCreateButton("Clear", 9, 136, 65, 25) GUISetState(@SW_SHOW) HotKeySet("{f1}", CMD_1) HotKeySet("{f2}", CMD_2) While 1 $msg = GUIGetMsg(1) Switch $msg[0] Case $GUI_EVENT_CLOSE Exit Case $exit GUIDelete($Admin) Exit EndSwitch WEnd Func CMD_1(); GUICtrlSetData($cmd, "Line 1" & "{ENTER}") GUICtrlSetData($cmd, "Line 2" & "{ENTER}") EndFunc Func CMD_2(); GUICtrlSetData($cmd, "Line 3" & "{ENTER}") GUICtrlSetData($cmd, "Line 4" & "{ENTER}") EndFunc
  16. @mikell So is she okay? $string = _oHTTPGet("https://www.autoitscript.com/site/post-sitemap.xml") $string = StringRegExpReplace($string, '(?s)[\n\r\t\v]', '') $string = StringStripWS($string, 7) $aData = _StringBetween($string, '<loc>','</loc>') For $j = 0 To UBound($aData) - 1 If IsArray($aData) Then ConsoleWrite("Line : " & @ScriptLineNumber & " : " & $aData[$j] & @CRLF) $string2 = _oHTTPGet($aData[$j]) $string2 = StringRegExpReplace($string2, '(?s)[\n\r\t\v]', '') $string2 = StringStripWS($string2, 7) $aPostData = _StringBetween($string2, '</head>','<footer') For $s = 0 To UBound($aPostData) - 1 If IsArray($aPostData) Then $StringBetw2 = _StringBetween($aPostData[$s], '<div class="entry-content','<!-- .entry-content -->') For $i = 0 To UBound($StringBetw2) - 1 If IsArray($StringBetw2) Then $StringBetw2 = StringRegExpReplace($StringBetw2[$i], "(?is)(<script[^>]+javascript.*?/script>)", "") $StringBetw2 = StringRegExpReplace($StringBetw2, '(?s)<.*?>', "" & @CRLF) $StringBetw2 = StringRegExpReplace($StringBetw2, '( )+', "") ConsoleWrite("Line : " & @ScriptLineNumber & " : " & $StringBetw2 & @CRLF) EndIf Next Else ConsoleWrite("Line : " & @ScriptLineNumber & " : " & " Problem " & @CRLF) EndIf Next EndIf Next
  17. May I add... it could be a great idea to swap these For $s = 0 To UBound($aPostData) - 1 If IsArray($aPostData) Then because running a For/Next loop through an array works - generally - much better if the concerned array is really an array
  18. i need to update the progress bar any sec I mean I want to link the progress bar to specific seconds
  19. @Jos you have such a wisdom in you you're very wise thanks again
  20. So I made a script and I'd like to convert the MouseClick's to ControlClick's, I've kinda figured out how to do it, as my script now half-works after the conversion, but troubleshooting it is quite hard without seeing it in action for myself. Is there a way (even outside of Autoit itself) that would enable me to see where the ControlClick'ing is happening to verify my code?
  21. You spent lots of time on bling. Good day
  22. ...algebra, what is "algebra" ????? =P
  23. nice, combining some of those seems like a sporting next task, prior to nesting all that shit on one line for fun.
  24. I am cleaning up html tags for me when you disable When enabled And should I use this? #include <Array.au3> #include <String.au3> $string = _oHTTPGet("https://www.autoitscript.com/site/post-sitemap.xml") $string = StringRegExpReplace($string, '(?s)[\n\r\t\v]', '') $string = StringStripWS($string, 7) $aData = _StringBetween($string, '<loc>','</loc>') For $j = 0 To UBound($aData) - 1 If IsArray($aData) Then ConsoleWrite("Line : " & @ScriptLineNumber & " : " & $aData[$j] & @CRLF) $string2 = _oHTTPGet($aData[$j]) $string2 = StringRegExpReplace($string2, '(?s)[\n\r\t\v]', '') $string2 = StringStripWS($string2, 7) $aPostData = _StringBetween($string2, '</head>','<footer') For $s = 0 To UBound($aPostData) - 1 If IsArray($aPostData) Then $StringBetw2 = _ArrayToString(_StringBetween($aPostData[$s], '<div class="entry-content','<!-- .entry-content -->'));My question is exactly for this line $StringBetw2 = StringRegExpReplace($StringBetw2, "(?is)(<script[^>]+javascript.*?/script>)", "") $StringBetw2 = StringRegExpReplace($StringBetw2, '(?s)<.*?>', "" & @CRLF) $StringBetw2 = StringRegExpReplace($StringBetw2, '(&nbsp;)+', "") ConsoleWrite("Line : " & @ScriptLineNumber & " : " & $StringBetw2 & @CRLF) Else ConsoleWrite("Line : " & @ScriptLineNumber & " : " & " Problem " & @CRLF) EndIf Next EndIf Next Func _oHTTPGet($aUrL) Local $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("GET", $aUrL, False) $oHTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0") $oHTTP.Send() If @error Then ConsoleWrite("Line : " & @ScriptLineNumber & " Not Connect " & @CRLF) $oHTTP = 0 Return SetError(1) EndIf If $oHTTP.Status = 200 Then Local $sReceived = $oHTTP.ResponseText $oHTTP = Null Return $sReceived EndIf $oHTTP = Null Return -1 EndFunc
  25. hi, i cant make this work, the _OpenKeyboard() func return me 0x0000000000000114 so i think he is getting the keyboard handle well, so the error must be in the _KeyboardSetLed() func, any ideas?, thanks.
  26. Mikell is right, but it's also easy enough to stringify that array, and stringbetween iterates its own damn self, so isnt this the same thing (save for whatever cleaning you were doing for the GET)? For $s = 0 To UBound($aPostData) - 1 If IsArray($aPostData) Then $StringBetw2 = _ArrayToString(_StringBetween($aPostData[$s], '<div class="entry-content">','<span class="synved-social-container'));My question is exactly for this line ;~ $StringBetw2 = StringRegExpReplace($StringBetw2, "(?is)(<script[^>]+javascript.*?/script>)", "") ;~ $StringBetw2 = StringRegExpReplace($StringBetw2, '(?s)<.*?>', "" & @CRLF) ;~ $StringBetw2 = StringRegExpReplace($StringBetw2, '(&nbsp;)+', "") ConsoleWrite("Line : " & @ScriptLineNumber & " : " & $StringBetw2 & @CRLF) Else ConsoleWrite("Line : " & @ScriptLineNumber & " : " & " Problem " & @CRLF) EndIf Next EndIf Next
  27. Right now, as far as I see, in Win10, the controls for Win32 are needlessly "uglyfied" So incorporation of other abilities would be welcomed. Then again, AutoIt was meant to be an automation utility and not a programming language but we all use it as a programming language. Very far from the initial intention. Then again, since we are here, might as well, working on expanding it would be cool. Then again, without a restructure of the AutoIt language ( that would likely be incompatible to v3 ) to make incorporating other technologies, would make no sense and therefore making it v4. Then again, we, the scripting kids, would like to do what real programmers do, from the coding language we already know, and one thing is true: writing in AutoIt is so efficient !, it makes it beautiful. ( I just wanted to have this say, well knowing that is very unlikely to change anything, but is my way to pray to the gods of the AutoIt realm )
  28. I understand thank you @mikell Do you see a problem in my other codes? $string = _oHTTPGet("https://www.autoitscript.com/site/post-sitemap.xml") $string = StringRegExpReplace($string, '(?s)[\n\r\t\v]', '') $string = StringStripWS($string, 7) $aData = _StringBetween($string, '<loc>','</loc>') For $j = 0 To UBound($aData) - 1 If IsArray($aData) Then ConsoleWrite("Line : " & @ScriptLineNumber & " : " & $aData[$j] & @CRLF) $string2 = _oHTTPGet($aData[$j]) $string2 = StringRegExpReplace($string2, '(?s)[\n\r\t\v]', '') $string2 = StringStripWS($string2, 7) $aPostData = _StringBetween($string2, '</head>','<footer') For $s = 0 To UBound($aPostData) - 1 If IsArray($aPostData) Then $StringBetw2 = _StringBetween($aPostData[$s], '<div class="entry-content','<!-- .entry-content -->') For $i = 0 To UBound($StringBetw2) - 1 $StringBetw2 = StringRegExpReplace($StringBetw2[$i], "(?is)(<script[^>]+javascript.*?/script>)", "") $StringBetw2 = StringRegExpReplace($StringBetw2, '(?s)<.*?>', "" & @CRLF) $StringBetw2 = StringRegExpReplace($StringBetw2, '( )+', "") ConsoleWrite("Line : " & @ScriptLineNumber & " : " & $StringBetw2 & @CRLF) Next Else ConsoleWrite("Line : " & @ScriptLineNumber & " : " & " Problem " & @CRLF) EndIf Next EndIf Next
  1. Load more activity