Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/22/2019 in all areas

  1. use the _WD_ElementAction function like this: $sValue = _WD_ElementAction($sSession, $sElement, 'attribute', 'src') p.s. ... and remove @src from the xPath: "//img[@alt='NiceGirl']"
    3 points
  2. Trong

    Image Search UDF

    Version 2021.8.30.2

    10,235 downloads

    Use MouseClick() need: #RequireAdmin Dll is already integrated in UDF ! ; #INDEX# =============================================================== ; Title .........: ImageSearch ; AutoIt Version : 3.x ; Language ......: English ; Description ...: Check image Appears or Not and Return the position of an image on the desktop ; Author(s) .....: Dao Van Trong - TRONG.LIVE ; ======================================================================= ; #CURRENT# ============================================================= ; _ImageSearch ; _ImageSearch_Area ; _ImageSearch_Wait ; _ImageSearch_WaitArea ; ======================================================================== ;========================================================================= ; ; Author:...........: AutoIT VietNam : Dao Van Trong - TRONG.LIVE ; Description:......: Check image Appears or Not ; Find and return the position of an image on the desktop ; Syntax:........... _ImageSearch_Area, _ImageSearch ; Parameter(s):..... $_ImagePath: The image to locate on the desktop ; May be a list of image by delimited by "|" ; i.e: $_ImagePath = "image1.bmp|image2.bmp|image3.bmp" ; $P_x1 $P_y1: Position of 1st point ; $P_x2 $P_y2: Position of 2nd point - Default is last botton right of desktop ; $_Tolerance: 0 for no tolerance (0-255). Needed when colors of image differ from desktop. e.g GIF ; $_CenterPos: boolen. True will return $array[1] x $array[2] is center of image found. ; False will return top-left position ; Return Value(s):.. Return an array has 3 item ; On Success: $array[0] 1 ; On Failure: $array[0] 0 ; DLL not found or other error: $array[0] -1 ; $array[1] x $array[2]: position of image what found on desktop ; ; Note:............. Use _ImageSearch to search the entire desktop ; _ImageSearch_Area to specify a desktop region to search ; $_ImagePath with more item need more time appear on screen before function can detect. ; Decrease sleep time in the loop to detect faster. But less performance. I.e CPULoad increased ; ;======================================================================== EG 1: ;~ Opt("MustDeclareVars", 1) ;~ #AutoIt3Wrapper_UseX64=y ;~ #AutoIt3Wrapper_Change2CUI=y #RequireAdmin #include "_ImageSearch_UDF.au3" HotKeySet("{Esc}", "_Exit") ; Press ESC for exit Func _Exit() Exit 0 EndFunc ;==>_Exit Global Const $Ask_On_Found = 0 Global Const $Mouse_Move_On_Found = 1 Global Const $Mouse_Click_On_Found = 0 Global Const $iSleep_Time=500 Global $sCount = 0, $_Image_1 = @ScriptDir & "\example.bmp" ; First, use this function to create a file bmp, maybe a desktop icon for example') MsgBox(64 + 262144, 'ImageSearch', 'At first, create a file bmp,' & @CRLF & 'photos that will search on the screen!') _ImageSearch_Create_BMP($_Image_1) ConsoleWrite("! Search for images: " & $_Image_1 & @CRLF & '! Searching on the screen ...' & @CRLF) While 1 ToolTip('(Press ESC for EXIT) Searching ...', 1, 1) Sleep($iSleep_Time) $sCount += 1 Local $return = _ImageSearch($_Image_1) If $return[0] = 1 Then ConsoleWrite('- [' & $sCount & '] Image found:' & " X=" & $return[1] & " Y=" & $return[2] & @CRLF) If $Mouse_Move_On_Found Then MouseMove($return[1], $return[2]) Sleep($iSleep_Time) EndIf If $Mouse_Click_On_Found Then MouseClick("left", $return[1], $return[2]) ToolTip('(Press ESC for EXIT) - [' & $sCount & "] Image found:" & " X=" & $return[1] & " Y=" & $return[2], 1, 1) If $Ask_On_Found Then Local $ask = MsgBox(6 + 262144, 'Success [' & $sCount & ']', 'Image found:' & " X=" & $return[1] & " Y=" & $return[2]) If $ask = 2 Or $ask = 3 Or $ask = 5 Or $ask = 7 Then Exit ;No, Abort, Cancel, and Ignore If $ask = 10 Then _ImageSearch_Create_BMP($_Image_1) ; Continue ;Try Again EndIf EndIf Sleep(200) WEnd Video demo: [+] When any problem or error occurs, please make sure that:- Downloaded and used the latest version.- Set screen Screen Scale and layout = 100%- Installed display driver.- Tried turning off the antivirus- Full installation: Microsoft Visual C++ Redistributable 2005->2022 [+] You can download the AIO version of the Visual C++ Redistributable here: -> https://www.mediafire.com/file/0ak8dcj9mdn7nyq/VisualCppRedist_AIO_2005-2022_x86_x64_%5Btrong.live%5D.zip/file -> FOR Windows XP: https://www.mediafire.com/file/5m5lnr1kfg73tc9/VisualCppRedist_AIO_2005-2019_x86_XP_%5Btrong.live%5D.zip/file <!> Password for Extract: trong.live [+] The last full version of SCITE4AutoIT supports windows XP: https://www.autoitscript.com/autoit3/scite/download/archive/v19.1127.1402.0-SciTE4AutoIt3.exe
    1 point
  3. Beta version 0.6.0.0 of the UDF has been released.
    1 point
  4. @trangtrau Answered in the other thread. Please don't cross-post.
    1 point
  5. @trangtrau The short answer is $_WD_ERROR_MSGBOX = False However, you shouldn't be getting this error box on a return value of Success. I'll have to take another look at this, but I thought this issue was recently fixed. Please make sure that you are running the latest version of the UDF (currently 0.1.0.20)
    1 point
  6. I found indeed an issue when the SCITE_USER_HOME didn't previously existed. The installer will set SCITE_USER_HOME, but that isn't present in it's own process as yet, so when it shells sciteconfig, it will be unknown and the sciteconfig assumes it is a portable version thus creating the includes.txt in the same directory as the SciTE.exe program. I have implemented a fix for this so the installer will provide the proper SCITE_USER_HOME directory via the commandline it shells the sciteconfig with. This beta installer is available in case you would like to test it. Jos
    1 point
  7. _WD_Attach is the function you seek. It handles locating and then switching to the designated tab. There are examples of using it in wd_demo. 😉
    1 point
  8. Suggestion (untested) GUICtrlSetState($hCombo, $GUI_Disable) For $i = 2 To $aXLSX[0][0] $sXLSX &= $aXLSX[$i][0] & "|" ;ConsoleWrite("$sXLSX: " & $sXLSX & @CRLF) Next GUICtrlSetData($hCombo, "|" & $sXLSX, "") GUICtrlSetState($hCombo, $GUI_Enable) Edit If the above fails you might try _GUICtrlComboBox_BeginUpdate
    1 point
  9. Going down to check, thanks.
    1 point
  10. @DannyJ You're welcome! Always better than who didn't bother to post a single line of script, so, happy to have helped
    1 point
  11. @DannyJ One of many ways to do it: #include <ComboConstants.au3> #include <GuiComboBox.au3> #include <File.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $arrComboBoxes[3] #Region ### START Koda GUI section ### Form= Global $frmComboBoxes = GUICreate("ComboBoxes", 250, 128, -1, -1) GUISetOnEvent($GUI_EVENT_CLOSE, "ExitApplication") $arrComboBoxes[0] = GUICtrlCreateCombo("", 20, 19, 209, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL)) GUICtrlSetFont(-1, 10, 400, 0, "Arial") $arrComboBoxes[1] = GUICtrlCreateCombo("", 20, 51, 209, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL)) GUICtrlSetFont(-1, 10, 400, 0, "Arial") $arrComboBoxes[2] = GUICtrlCreateCombo("", 20, 83, 209, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL)) GUICtrlSetFont(-1, 10, 400, 0, "Arial") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Global $strFileName = @ScriptDir & "\ComboBoxes.csv", _ $arrFileContent _FileReadToArray($strFileName, $arrFileContent, $FRTA_COUNT, ";") If @error Then ConsoleWrite("_FileReadToArray ERR: " & @error & @CRLF) Else ; Fill the first ComboBox with the array elements of the "first level" For $i = 1 To $arrFileContent[0][0] Step 1 GUICtrlSetData($arrComboBoxes[0], $arrFileContent[$i][0] & ($i < $arrFileContent[$i][0] ? "|" : "")) Next ; Set the current selection to the first enrty of the ComboBox _GUICtrlComboBox_SetCurSel($arrComboBoxes[0], 0) EndIf While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $arrComboBoxes[0] FillCombo($arrComboBoxes[0], 0) Case $arrComboBoxes[1] FillCombo($arrComboBoxes[1], 1) EndSwitch WEnd Func FillCombo($idCombo, $intComboBoxLevel) Local $strComboData = "", _ $arrIndexes, _ $arrEntries[0] $strComboData = GUICtrlRead($idCombo) $arrIndexes = _ArrayFindAll($arrFileContent, $strComboData, 0, 0, 0, 0, $intComboBoxLevel) If IsArray($arrIndexes) Then ; Blank all the other ComboBoxes which are on the next level(s) For $i = UBound($arrComboBoxes) - 1 To $intComboBoxLevel + 1 Step -1 GUICtrlSetData($arrComboBoxes[$i], "") Next ; Find all occurences of the ComboBox item selected For $i = 0 To UBound($arrIndexes) - 1 Step 1 _ArrayAdd($arrEntries, $arrFileContent[$arrIndexes[$i]][$intComboBoxLevel + 1]) Next ; Make all entries found unique $arrEntries = _ArrayUnique($arrEntries, 0, 0, 0, $ARRAYUNIQUE_NOCOUNT) ; Fill the ComboBox For $i = 0 To UBound($arrEntries) - 1 Step 1 GUICtrlSetData($arrComboBoxes[$intComboBoxLevel + 1], $arrEntries[$i] & "|") Next _GUICtrlComboBox_SetCurSel($arrComboBoxes[$intComboBoxLevel + 1], 0) EndIf EndFunc Func ExitApplication() Exit EndFunc
    1 point
  12. Muzaiyan

    Progressbar New Styles

    Salam, Hello, Hi Today i am showing you some new styles of progress bar i don't know if anyone posted a thing like this on thins forum _GUICtrlCreateProgress This UDF allows you to create new style progress bar Colors, Values can be changed by using native functions of autoit i created this script years ago while i was not on this forum now i think it should be shared on this forum check this out if anyone is interested any help is greatly appreciated NEW $PBSC_LINE_LEFT_TO_TIGHT changed to $PBSC_LINE_LEFT_TO_RIGHT New Style Progressbar.rar old New Style Progressbar.rar
    1 point
  13. Jos

    Press a key and get message?

    Help on what as you haven't described what your problem is? Guess the program ends right away as you have no loop in there? Jos
    0 points
  14. Thanks Dan ! but how to close one of several tabs? I can't believe I don't know how to close the tab.
    0 points
×
×
  • Create New...