SBrix Posted June 11, 2014 Posted June 11, 2014 Hi guys I was wondering, if there was a function that allowed me to search for two seperate images in one code? My code looks like this: $search = _imagesearch('1pixel.bmp', 0, $x, $y, 0) So is there a function that allows me to do this (Not a real code, but I think you get the point): $search = _imagesearch('1pixel.bmp + 2pixel.bmp', 0, $x, $y, 0)
junkew Posted June 11, 2014 Posted June 11, 2014 why would you want that? It could be something like below (not tested) Example() Func Example() ; Sample scriptusing @NumParams macro _MySearch("1pixel.bmp", "2pixel.bmp") EndFunc ;==>Example Func _MySearch($v1 = 0, $v2 = 0, $v3 = 0, $v4 = 0, $v5 = 0, $v6 = 0, $v7 = 0, $v8 = 0, $v9 = 0, _ $v10 = 0, $v11 = 0, $v12 = 0, $v13 = 0, $v14 = 0, $v15 = 0, $v16 = 0, $v17 = 0, $v18 = 0, $v19 = 0) #forceref $v1, $v2, $v3, $v4, $v5, $v6, $v7, $v8, $v9, $v10, $v11, $v12, $v13, $v14, $v15, $v16, $v17, $v18, $v19 Local $search = true For $i = 1 To @NumParams $search =_imagesearch(Eval("v" & $i), 0, $x, $y, 0) if $search=false then return 0 Next EndFunc FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
l3ill Posted June 11, 2014 Posted June 11, 2014 (edited) Hi, if you mean what I think you mean, you would need to set up your search function (_imagesearch) in a loop. Even if you are only going to call it twice... Edit: I have been told I oversimplify things but here is a crude example: $j = 2 ; How many times we want to loop through this function) For $i = 1 To $j ; your loop calling your function twice _imagesearch() ; you can set this part up to add "1" to your bmp name each time ( $i & 'pixel.bmp' ) $i + 1 Next Func _imagesearch() ; The only thing this funtion does is call a MsgBox for testing purposes MsgBox(0, "img srch", "Found bmp number: " & $i) EndFunc ;==>_imagesearch Edited June 11, 2014 by l3ill My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example
SBrix Posted June 12, 2014 Author Posted June 12, 2014 I figured a way around the problem. Thanks for the help
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