Peter_isnotmyname Posted January 14, 2020 Posted January 14, 2020 Well well, I have this problem for a long long time and I tried to fix it on my own well it did not work. I know the Image search library is buggy but I don't want to learn a new Programming language. Anyway, let me describe my Problem: Image search works fine or at least it does it at the beginning after some time without any reason the function can't find the picture anymore there is no reason why. The example file worked at the beginning as well but now even the example file cant find images anymore. That's the first File of my larger project, which also worked at the beginning as all other files. expandcollapse popup#include "_ImageSearch.au3" #include "_ImageSearch_Debug.au3" #include <MsgBoxConstants.au3> #include <FileConstants.au3> ;For txt #include <WinAPIFiles.au3> Call ("Login") Call ("mobileview") FunC Login () $File = FileOpen(@ScriptDir & "\textdata\currentACC.txt") ;Um welchen ACC es sich gerade handelt $current_line = FileReadLine($File) ;Welche Zeile gelesen werden soll ShellExecute("chrome.exe", "https://www.instagram.com/accounts/login/?source=auth_switcher --new-window --start-fullscreen") FileClose (@ScriptDir & "\currentACC.txt") Sleep(5000) $picture= @ScriptDir & "\Pictures\email.bmp" $File = FileOpen(@ScriptDir & "\textdata\emails.txt") ;email von accc $FileRead = FileReadLine($File,$current_line) Local $return = _ImageSearch($picture, 40) if $return[0] = 1 Then MouseMove($return[1], $return[2]) MouseClick($MOUSE_CLICK_LEFT) Send($FileRead) Else MsgBox(48, 'Error X001', 'Could not find the username button') Exit EndIf FileClose (@ScriptDir & "\textdata\emails.txt") Sleep(1000) $File = FileOpen(@ScriptDir & "\textdata\passwords.txt") ;email von accc $FileRead = FileReadLine($File,$current_line) $picture= "Pictures\password.bmp" Local $return = _ImageSearch($picture) if $return[0] = 1 Then MouseMove($return[1], $return[2]) MouseClick($MOUSE_CLICK_LEFT) Send($FileRead) Else MsgBox(48, 'Error X002', 'Could not find the password button') Exit EndIf FileClose (@ScriptDir & "\textdata\passwords.txt") Sleep(3000) $picture= "Pictures\login.bmp" Local $return = _ImageSearch($picture) if $return[0] = 1 Then MouseMove($return[1], $return[2]) MouseClick($MOUSE_CLICK_LEFT) Send($FileRead) Else MsgBox(48, 'Error X003', 'Could not find the Login button') Exit EndIf EndFunc Func mobileview () Send("{CTRLDOWN} & {SHIFTDOWN} & {I}") Send("{CTRLUP} &{SHIFTUP} ") Sleep(2000); Send("{CTRLDOWN} & {SHIFTDOWN} & {M}") Send("{CTRLUP} &{SHIFTUP} ") Sleep(500) Send("{CTRLDOWN} & {R}") Send("{CTRLUP}") Sleep(5000) EndFunc HotKeySet("{Esc}", "_Exit") Func _Exit() Exit 0 EndFunc ;==>_Exit Output: >"D:\Programme\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "L:\Youtube\Automatic Instagram\Login.au3" --\\ ImageSearch //: DEBUG -- OSArch : X64 // AutoIT ver: 3.3.14.5 x86 -- WorkingDir : L:\Youtube\Automatic Instagram -- ScriptFullPath : L:\Youtube\Automatic Instagram\Login.au3 -- ImageSearchDLL : C:\Users\DERTME~1\AppData\Local\Temp\_ImageSearch.dll (14.5kb) ! Search not found! >Exit code: 0 Time: 25.09 I tried: - Run the script as x86 (I use Windows 7, 64 bit) - Use a different functions -> imagesearcharea etc. - Play with the Parameters (tolerance etc) - Use a different imagesearch version - Use a different Autoit version - Put the DLL files inside of the script folder + delete the x64, run the script, and the same with x86 - Run the script as Admin - Replace the Image with different formats and sizes (.jpg, png....) - Add time to the Function email.bmp
Nine Posted January 14, 2020 Posted January 14, 2020 (edited) You should consider using WebDriver instead of using ImageSearch. It would make your script way more efficient and far more robust. Take a look at it : ps. Since you are using Chrome, this is the tool you need. But you can do everything with IE UDF also. Just wanted to let you know that those are 2 extremely powerful solutions to fix your issues. Edited January 14, 2020 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Peter_isnotmyname Posted January 14, 2020 Author Posted January 14, 2020 Thanks for your answer I now stared with phyton and the chromedriver ^^´.
Moderators JLogan3o13 Posted January 14, 2020 Moderators Posted January 14, 2020 Moved to the appropriate forum. Moderation Team "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now