Jump to content

Recommended Posts

Posted

English:

  Reveal hidden contents

German:

  Reveal hidden contents

^ spoiler

Posted

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 ^_^

 

#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

 

Posted (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 by pluto41
  • 2 weeks later...
Posted
  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

Posted (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 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.

Posted
  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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...