privatemonkey Posted September 6, 2016 Posted September 6, 2016 English: Reveal hidden contents Hello dear IT member i have a few question beecause i cant seem to get it working: so i wrote a code with imagesearch and its searching perfect if its one by one but im trying to put the code together into 1 so its searching for all the pictures i hope you can help me expandcollapse popupcode #1 #include <ImageSearch2015.au3> HotKeySet("{-}", "Terminate") While 1 $x1=0 $y1=0 $picture = "C:\Users\Daniel\Desktop\ImageSearch2015\u.png" Do $result = _ImageSearch($picture,1,$x1,$y1,0,0) ;_ImageSearch($findImage, $resultPosition, ByRef $x, ByRef $y, $tolerance, $transparency = 0) ConsoleWrite($result) until $result =1 ; if $result=1 Then Send("{U down}") ; Holds the A key down Send("{U up}") ; Releases the A key Else MsgBox(0,"MSG","End") EndIf WEnd Func Terminate() Exit 0 EndFunc ------------------------------------------------------------ Code #2 #include <ImageSearch2015.au3> HotKeySet("{-}", "Terminate") While 1 $x1=0 $y1=0 $picture = "C:\Users\Daniel\Desktop\ImageSearch2015\H.png" Do $result = _ImageSearch($picture,1,$x1,$y1,0,0) ;_ImageSearch($findImage, $resultPosition, ByRef $x, ByRef $y, $tolerance, $transparency = 0) ConsoleWrite($result) until $result =1 ; if $result=1 Then Send("{H down}") ; Holds the A key down Send("{H up}") ; Releases the A key Else MsgBox(0,"MSG","End") EndIf WEnd Func Terminate() Exit 0 EndFunc ----------------------------------------- code #3 #include <ImageSearch2015.au3> HotKeySet("{-}", "Terminate") While 1 $x1=0 $y1=0 $picture = "C:\Users\Daniel\Desktop\ImageSearch2015\z.png" Do $result = _ImageSearch($picture,1,$x1,$y1,0,0) ;_ImageSearch($findImage, $resultPosition, ByRef $x, ByRef $y, $tolerance, $transparency = 0) ConsoleWrite($result) until $result =1 ; if $result=1 Then Send("{Z down}") ; Holds the A key down Send("{Z up}") ; Releases the A key Else MsgBox(0,"MSG","End") EndIf WEnd Func Terminate() Exit 0 EndFunc ---------------- code #4 #include <ImageSearch2015.au3> HotKeySet("{-}", "Terminate") While 1 $x1=0 $y1=0 $picture = "C:\Users\Daniel\Desktop\ImageSearch2015\J.png" Do $result = _ImageSearch($picture,1,$x1,$y1,0,0) ;_ImageSearch($findImage, $resultPosition, ByRef $x, ByRef $y, $tolerance, $transparency = 0) ConsoleWrite($result) until $result =1 ; if $result=1 Then Send("{J down}") ; Holds the A key down Send("{J up}") ; Releases the A key Else MsgBox(0,"MSG","End") EndIf WEnd Func Terminate() Exit 0 EndFunc ------------------ Ok so this are my 4 codes (4 files) and i want to put it togehter to 1 piece so its searching for all those 4 codes / pictures in 1 code / at a time hope you can help me out! greetings privatemonkey:) German: Reveal hidden contents Hallo liebe Auto IT member Ich habe ein paar Fragen.also ich habe einen Code geschrieben mit imagesearch und es sucht perfekt wenn es ein einzelner code ist (nur eine file) aber da man nicht 4 files aufeinmal laufen lassen kann muss ich die 4 codes/files zu einer hinzufügen und ich kriege das nicht hin ich hoffe ihr könnt mir helfen ,dass er dann nach 4 Bildern sucht und jeweils den input zu dem passenden bild macht... Hoffe ihr könnt mir helfen expandcollapse popupcode #1 #include <ImageSearch2015.au3> HotKeySet("{-}", "Terminate") While 1 $x1=0 $y1=0 $picture = "C:\Users\Daniel\Desktop\ImageSearch2015\u.png" Do $result = _ImageSearch($picture,1,$x1,$y1,0,0) ;_ImageSearch($findImage, $resultPosition, ByRef $x, ByRef $y, $tolerance, $transparency = 0) ConsoleWrite($result) until $result =1 ; if $result=1 Then Send("{U down}") ; Holds the A key down Send("{U up}") ; Releases the A key Else MsgBox(0,"MSG","End") EndIf WEnd Func Terminate() Exit 0 EndFunc ------------------------------------------------------------ Code #2 #include <ImageSearch2015.au3> HotKeySet("{-}", "Terminate") While 1 $x1=0 $y1=0 $picture = "C:\Users\Daniel\Desktop\ImageSearch2015\H.png" Do $result = _ImageSearch($picture,1,$x1,$y1,0,0) ;_ImageSearch($findImage, $resultPosition, ByRef $x, ByRef $y, $tolerance, $transparency = 0) ConsoleWrite($result) until $result =1 ; if $result=1 Then Send("{H down}") ; Holds the A key down Send("{H up}") ; Releases the A key Else MsgBox(0,"MSG","End") EndIf WEnd Func Terminate() Exit 0 EndFunc ----------------------------------------- code #3 #include <ImageSearch2015.au3> HotKeySet("{-}", "Terminate") While 1 $x1=0 $y1=0 $picture = "C:\Users\Daniel\Desktop\ImageSearch2015\z.png" Do $result = _ImageSearch($picture,1,$x1,$y1,0,0) ;_ImageSearch($findImage, $resultPosition, ByRef $x, ByRef $y, $tolerance, $transparency = 0) ConsoleWrite($result) until $result =1 ; if $result=1 Then Send("{Z down}") ; Holds the A key down Send("{Z up}") ; Releases the A key Else MsgBox(0,"MSG","End") EndIf WEnd Func Terminate() Exit 0 EndFunc ---------------- code #4 #include <ImageSearch2015.au3> HotKeySet("{-}", "Terminate") While 1 $x1=0 $y1=0 $picture = "C:\Users\Daniel\Desktop\ImageSearch2015\J.png" Do $result = _ImageSearch($picture,1,$x1,$y1,0,0) ;_ImageSearch($findImage, $resultPosition, ByRef $x, ByRef $y, $tolerance, $transparency = 0) ConsoleWrite($result) until $result =1 ; if $result=1 Then Send("{J down}") ; Holds the A key down Send("{J up}") ; Releases the A key Else MsgBox(0,"MSG","End") EndIf WEnd Func Terminate() Exit 0 EndFunc ------------------ So das war der code bzw die 4 codes/files ich hoffe ihr könnt mir damit helfen MfG privatemonkey ^ spoiler
privatemonkey Posted September 6, 2016 Author Posted September 6, 2016 and yea BTW if i make it intro one code it will only use the first "picture" but not the other 3 please help...
privatemonkey Posted September 6, 2016 Author Posted September 6, 2016 This is how it lookks like if i put it into one code But that doesnt work it only reacts to the first picture "u.png" not to the others hope you can help me expandcollapse popup#include <ImageSearch2015.au3> HotKeySet("{-}", "Terminate") While 1 $x1 = 1 $y1 = 1 $picture = "C:\Users\Daniel\Desktop\ImageSearch2015\u.png" Do $result = _ImageSearch($picture,1,$x1,$y1,0,0) ;_ImageSearch($findImage, $resultPosition, ByRef $x, ByRef $y, $tolerance, $transparency = 0) ConsoleWrite($result) until $result =1 ; if $result = 1 Then Send("{U down}") ; Holds the A key down Send("{U up}") ; Releases the A key ElseIf $picture = "C:\Users\Daniel\Desktop\ImageSearch2015\H.png" Then Do $result = _ImageSearch($picture,1,$x1,$y1,0,0) ;_ImageSearch($findImage, $resultPosition, ByRef $x, ByRef $y, $tolerance, $transparency = 0) ConsoleWrite($result) until $result =1 ; if $result=1 Then Send("{H down}") ; Holds the A key down Send("{H up}") ; Releases the A key ElseIf $picture = "C:\Users\Daniel\Desktop\ImageSearch2015\z.png" Then Do $result = _ImageSearch($picture,1,$x1,$y1,0,0) ;_ImageSearch($findImage, $resultPosition, ByRef $x, ByRef $y, $tolerance, $transparency = 0) ConsoleWrite($result) until $result =1 ; if $result=1 Then Send("{Z down}") ; Holds the A key down Send("{Z up}") ; Releases the A key ElseIf $picture = "C:\Users\Daniel\Desktop\ImageSearch2015\J.png" Then Do $result = _ImageSearch($picture,1,$x1,$y1,0,0) ;_ImageSearch($findImage, $resultPosition, ByRef $x, ByRef $y, $tolerance, $transparency = 0) ConsoleWrite($result) until $result =1 ; if $result=1 Then Send("{J down}") ; Holds the A key down Send("{J up}") ; Releases the A key EndIf EndIf EndIf EndIf WEnd Func Terminate() Exit 0 EndFunc
pluto41 Posted September 6, 2016 Posted September 6, 2016 (edited) Local $Picture = "A" ; Test Value A,B,C Do If $Picture = "A" Then ; First find. WhichPictureISelected ( ) $Picture = "B" ; gets us further to 'B' ElseIf $Picture = "B" Then WhichPictureISelected ( ) $Picture = "stop" ElseIf $Picture = "C" Then WhichPictureISelected ( ) ; ... ; ... EndIf Until $Picture = "stop" Func WhichPictureISelected ( ) MsgBox ( 0, "Found", "picture = " & $Picture ) EndFunc First problem i see is that in your code the value $picture is set to u.png but where does the variable $picture get changed another value? See my example code. It can Find A, B but will never find C for obvious reasons. Edited September 6, 2016 by pluto41
privatemonkey Posted September 17, 2016 Author Posted September 17, 2016 On 9/6/2016 at 4:25 PM, pluto41 said: Local $Picture = "A" ; Test Value A,B,C Do If $Picture = "A" Then ; First find. WhichPictureISelected ( ) $Picture = "B" ; gets us further to 'B' ElseIf $Picture = "B" Then WhichPictureISelected ( ) $Picture = "stop" ElseIf $Picture = "C" Then WhichPictureISelected ( ) ; ... ; ... EndIf Until $Picture = "stop" Func WhichPictureISelected ( ) MsgBox ( 0, "Found", "picture = " & $Picture ) EndFunc First problem i see is that in your code the value $picture is set to u.png but where does the variable $picture get changed another value? See my example code. It can Find A, B but will never find C for obvious reasons. Expand hey sorry for the late answer but where did the until $result = 1 go im confused in this code :3 can you explain me further please? or help me fixing the code together ,thanks :3 greetings Monkey
Sori Posted September 17, 2016 Posted September 17, 2016 (edited) What about something like this, instead? #include <ImageSearch2015.au3> HotKeySet("{-}", "Terminate") While 1 While _ImageSearch("C:\USers\Daniel\Desktop\ImageSearch2015\u.png" = 1 Send("{U down}") Send("{U up}") WEnd While _ImageSearch("C:\USers\Daniel\Desktop\ImageSearch2015\H.png" = 1 Send("{H down}") Send("{H up}") WEnd While _ImageSearch("C:\USers\Daniel\Desktop\ImageSearch2015\z.png" = 1 Send("{Z down}") Send("{Z up}") WEnd While _ImageSearch("C:\USers\Daniel\Desktop\ImageSearch2015\J.png" = 1 Send("{J down}") Send("{J up}") WEnd WEnd Func Terminate() Exit 0 EndFunc ;==>Terminate Edited September 17, 2016 by Sori If you need help with your stuff, feel free to get me on my Skype. I often get bored and enjoy helping with projects.
privatemonkey Posted September 17, 2016 Author Posted September 17, 2016 On 9/17/2016 at 8:13 PM, Sori said: What about something like this, instead? #include <ImageSearch2015.au3> HotKeySet("{-}", "Terminate") While 1 While _ImageSearch("C:\USers\Daniel\Desktop\ImageSearch2015\u.png" = 1 Send("{U down}") Send("{U up}") WEnd While _ImageSearch("C:\USers\Daniel\Desktop\ImageSearch2015\H.png" = 1 Send("{H down}") Send("{H up}") WEnd While _ImageSearch("C:\USers\Daniel\Desktop\ImageSearch2015\z.png" = 1 Send("{Z down}") Send("{Z up}") WEnd While _ImageSearch("C:\USers\Daniel\Desktop\ImageSearch2015\J.png" = 1 Send("{J down}") Send("{J up}") WEnd WEnd Func Terminate() Exit 0 EndFunc ;==>Terminate Expand dunno i'd need to try that 'll reply after i tried
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