Leaderboard
Popular Content
Showing content with the highest reputation on 07/06/2022 in all areas
-
True AutoIt multi-threading!
jaberwacky reacted to NHD for a topic
This is my experiment to achieve multi-threading in AutoIt 😅 Source code, usage and examples in this github repo: https://github.com/nomi-san/true-autoit-multi-threading1 point -
Hmmmyes. The main problem is the way you can get the source of the page. InetRead doesn't always work indeed, so you can use the way pixelsearch mentioned, or use curl, etc After that the regex must obviously be adapted to fit the search of the required data For example, using a txt file containing the source of the page1 link you provided, this code works for me ;https://www.lomcn.org/forum/members/list/?page=1 #Include <Array.au3> $txt = FileRead("site_page1.txt") ; source $list = "" $items = StringRegExp($txt, 'forum/members/(\w+\.\d+)', 3) $items = _ArrayUnique($items) For $k = 0 to UBound($items)-1 $list &= $items[$k] & @crlf Next Msgbox(0,"", $list) ;FileWrite("results.txt", $list) Edit @pixelsearch please try this ;https://www.lomcn.org/forum/members/list/?page=1 #Include <Array.au3> $out = _XP_Read("https://www.lomcn.org/forum/members/list/?page=1") ;ConsoleWrite($out & @crlf) $list = "" $items = StringRegExp($out, 'forum/members/(\w+\.\d+)', 3) $items = _ArrayUnique($items) For $k = 0 to UBound($items)-1 $list &= $items[$k] & @crlf Next Msgbox(0,"", $list) ;FileWrite("results.txt", $list) Func _XP_Read($url) Local $cmd = "curl -L -s -k -A 'Mozilla/4.0(compatible;MSIE7.0;WindowsNT5.1)' " & $url Local $iPID = Run($cmd, "", @SW_HIDE, 2) ;$STDOUT_CHILD ProcessWaitClose($iPID) Local $output = StdoutRead($iPID) Return $output EndFunc I love curl1 point
-
JorgeLuis, I am not sure you could be less clear if you tried. What type of ".exe" program - and why does it need to be in "a window AutoIt"? M231 point
-
GuiBuilderPlus [updated March 24, 2024]
Dan_555 reacted to kurtykurtyboy for a topic
Just a small update due to the issue reported by @trekker here. The latest updates can be found in the first post. FIXED: Color and Background values of 0x000000 were saved as -1 FIXED: Setting "Paste at mouse position" incorrect behavior when turned off FIXED: Error when saving GUI to file FIXED: Crash when loading GUI file and resizing control FIXED: Improved GUI file load times ADDED: "Save As..." menu item (File menu) ADDED: Change background color of checkbox and radio controls CHANGED: You can now draw "on top of" other controls (instead of switching to selection) CHANGED: GUI definition files now use json formatting to prepare for future features Are people actually interested in seeing these small updates or should I just wait until we are finally at version 1.0?1 point -
Hey, made an account just to thank you. Used your code so i could select a point in the screen to run a script in a loop for that point, everytime i started the scrip. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $Paused, $Runner HotKeySet("{F2}", "Terminate") Func Terminate() Exit 0 EndFunc ;==>Terminate #your code start Func InteractiveCoordinateSelect() Local $iOriginalGUIMode = Opt("GUIOnEventMode") Opt("GUIOnEventMode", 0) Local Const $hFullScreen = WinGetHandle("[TITLE:Program Manager;CLASS:Progman]") Local Const $aFullScreen = WinGetPos($hFullScreen) Local $hOverlay = GUICreate("", $aFullScreen[2], $aFullScreen[3], $aFullScreen[0], $aFullScreen[1], BitOR($WS_CLIPCHILDREN, $WS_POPUP), $WS_EX_TOPMOST) GUISetCursor(3 , $GUI_CURSOR_OVERRIDE, $hOverlay) WinSetTrans($hOverlay, "", 1) GUISetState(@SW_SHOW) Local $aCursorInfo While True If GUIGetMsg() = $GUI_EVENT_CLOSE Then $aCursorInfo = False ExitLoop EndIf $aCursorInfo = GUIGetCursorInfo($hOverlay) If $aCursorInfo[2] Then ReDim $aCursorInfo[2] ExitLoop EndIf WEnd GUIDelete($hOverlay) Opt("GUIOnEventMode", $iOriginalGUIMode) Return $aCursorInfo EndFunc #your code end Buy() Func Buy() local $aPosition = InteractiveCoordinateSelect() $x1 = $aPosition[0] & @CRLF $y1 = $aPosition[1] & @CRLF $Runner = Not $Runner While $Runner MouseClick("left", $x1, $y1, 3, 0) sleep (100) MouseClick("left", 698, 497, 5, 0) sleep(400) MouseClick("left", 505, 358, 5, 0) sleep(200) Send("{BACKSPACE}") sleep(50) Send("99") sleep(200) MouseClick("left", 488, 455, 5, 0) sleep(500) Mouseclick("left", 493, 375, 5, 0) sleep(50) WEnd EndFunc1 point
-
Hello everyone, Today I would like to introduce ImageRE.au3 UDF, this is a UDF about ImageSearch that I just finished writing. Sincere thanks to @Danyfirex for helping me in completing this UDF. This UDF is written based on the Image Recognition Library (ImageRecognition.dll), homepage: https://www.3delite.hu/Object Pascal Developer Resources/ImageRecognitionLibrary.html Image Recognition Library (IRL) is a component for use in Win32 and Win64 (2K/XP/Vista/7/8/10) software with a purpose to provide image recognition functionality, that is compare two pictures if they are the same or similar or find a smaller picture in a bigger picture with difference tolerance. License: IRL in shareware and commercial software? You can use this component in your free programs with a freeware license. If like it and use it for shareware or commercial software (or make money with it in any way) you have to buy a shareware or commercial license. Commercial license also allows the usage of the component inside a commercial company. Features: - Loading a picture from local disk - Loading a picture from HBitmap (by _ScreenCapture_Capture, _ScreenCapture_CaptureHwnd, IR_WinCapture...) - Loading a picture from memory - Exact, relative ARGB and AHSL with alpha channel support - ColorTolerance, PixelTolerance support - Pre-process images with 6 different resamplers - Multi-threaded processing - Multiple match support - OpenCL accelerated search - Rotate search support - Stretch search support - A fully multi-threaded loading queue functionality for batch loading of pictures - A fully multi-threaded search queue functionality for batch processing with support of parallel CPU-OpenCL processing a the same time - Full unicode support - Platforms: Win32 and Win64 About ImageRE UDF: Includes 8 main functions that I have summarized from IRL, ensuring all the features that IRL brings. Some example images: Download ImageRE.au3 UDF + Examples + IRL (Size 7Mb): https://1drv.ms/u/s!AhiIbjk1VKtOfEwStW1Sp0WGR3Q I'm not very good at English. So the UDF notes and examples are mostly translated using Google Translate. So there will be explanations that are very confusing or obscure. I hope you understand. 😔1 point
-
Getting started example step 3: WebView window First AutoIt implementation. Tested on Windows 10/7, 32/64 bit. Execute WebView2.au3: #AutoIt3Wrapper_Au3Check_Parameters=-d -w- 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #AutoIt3Wrapper_UseX64=y Opt( "MustDeclareVars", 1 ) #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <WinAPICom.au3> #include <WinAPI.au3> Global $hGui, $oCoreWebView2Environment, $oCoreWebView2Controller #include "..\Includes\WV2Interfaces.au3" WebView2() Func WebView2() $hGui = GUICreate( "WebView2 Sample", 1200, 900, -1, -1, $WS_OVERLAPPEDWINDOW ) _WinAPI_CoInitialize( $COINIT_APARTMENTTHREADED ) CoreWebView2CreateCoreWebView2EnvironmentCompletedHandlerCreate() ConsoleWrite( "$pCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler = " & $pCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler & @CRLF & @CRLF ) CoreWebView2CreateCoreWebView2ControllerCompletedHandlerCreate() ConsoleWrite( "$pCoreWebView2CreateCoreWebView2ControllerCompletedHandler = " & $pCoreWebView2CreateCoreWebView2ControllerCompletedHandler & @CRLF & @CRLF ) Local $hWebView2Loader = DllOpen( @AutoItX64 ? "WebView2Loader-x64.dll" : "WebView2Loader-x86.dll" ) Local $aRet = DllCall( $hWebView2Loader, "long", "CreateCoreWebView2EnvironmentWithOptions", "wstr", "", "wstr", "", _ "ptr", NULL, "ptr", $pCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler ) If @error Or $aRet[0] Then Return ConsoleWrite( "CreateCoreWebView2EnvironmentWithOptions ERR" & @CRLF ) ConsoleWrite( "CreateCoreWebView2EnvironmentWithOptions OK" & @CRLF & @CRLF ) GUISetState( @SW_SHOW ) While 1 Switch GUIGetMsg() Case $GUI_EVENT_MAXIMIZE, $GUI_EVENT_RESIZED Local $tRect = _WinAPI_GetClientRect( $hGui ) $oCoreWebView2Controller.put_Bounds( $tRect ) Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd CoreWebView2CreateCoreWebView2ControllerCompletedHandlerDelete() CoreWebView2CreateCoreWebView2EnvironmentCompletedHandlerDelete() DllClose( $hWebView2Loader ) EndFunc Func CoreWebView2CreateCoreWebView2EnvironmentCompletedHandler_Invoke( $pSelf, $long, $ptr ) ; Ret: long Par: long;ptr* ConsoleWrite( "CoreWebView2CreateCoreWebView2EnvironmentCompletedHandler_Invoke" & @CRLF ) $oCoreWebView2Environment = ObjCreateInterface( $ptr, $sIID_ICoreWebView2Environment, $dtag_ICoreWebView2Environment ) ConsoleWrite( "IsObj( $oCoreWebView2Environment ) = " & IsObj( $oCoreWebView2Environment ) & @CRLF & @CRLF ) $oCoreWebView2Environment.CreateCoreWebView2Controller( $hGui, $pCoreWebView2CreateCoreWebView2ControllerCompletedHandler ) Return 0 #forceref $pSelf, $long EndFunc Func CoreWebView2CreateCoreWebView2ControllerCompletedHandler_Invoke( $pSelf, $long, $ptr ) ; Ret: long Par: long;ptr* ConsoleWrite( "CoreWebView2CreateCoreWebView2ControllerCompletedHandler_Invoke" & @CRLF ) $oCoreWebView2Controller = ObjCreateInterface( $ptr, $sIID_ICoreWebView2Controller, $dtag_ICoreWebView2Controller ) ConsoleWrite( "IsObj( $oCoreWebView2Controller ) = " & IsObj( $oCoreWebView2Controller ) & @CRLF ) $oCoreWebView2Controller.AddRef() $oCoreWebView2Controller.get_CoreWebView2( $pCoreWebView2 ) $oCoreWebView2 = ObjCreateInterface( $pCoreWebView2, $sIID_ICoreWebView2, $dtag_ICoreWebView2 ) ConsoleWrite( "IsObj( $oCoreWebView2 ) = " & IsObj( $oCoreWebView2 ) & @CRLF & @CRLF ) Local $tRect = _WinAPI_GetClientRect( $hGui ) $oCoreWebView2Controller.put_Bounds( $tRect ) $oCoreWebView2.Navigate( "https://www.bing.com/" ) Return 0 #forceref $pSelf, $long EndFunc The code is translated to AutoIt from the C++ code in the Getting started example step 3 and from the AutoHotkey code in WebView2.ahk. A slightly updated example is included in WebView2-1.au3 in the 7z-file at bottom of this post.1 point
-
Using XP, the Inet* funcs don't work anymore on some (on most) https sites, so a third party tool is needed Try this #include <AutoItConstants.au3> Local $iPID = Run("curl -s -k https://soft98.ir/", "", @SW_HIDE, $STDOUT_CHILD) ProcessWaitClose($iPID) Local $output = StdoutRead($iPID) ConsoleWrite($output)1 point
-
Hi, Try adding HttpSetUserAgent HttpSetUserAgent("Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0") Local $iInetRet = InetGet("https://www.autoitscript.com/autoit3/pkgmgr/sqlite/SQLite.dll.au3", @TempDir & "\SQLite.dll.au3", 9) ConsoleWrite("!Error: " & @error & @CRLF) I also got error code 13 without it.1 point