Sign in to follow this  
Followers 0
dist7act

Help pixel trigger f1 - 13

8 posts in this topic

i am trying to get it 2 press the f1 f2 and f3 keys when a specific pixel is and i keep getting errors

here is my sytaxprod thing

>"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /prod /AU3Check /in "C:\Program Files (x86)\AutoIt3\Include\Test 1.au3"

+>14:05:22 Starting AutoIt3Wrapper v.2.0.1.24 Environment(Language:0409 Keyboard:00000409 OS:WIN_VISTA/Service Pack 2 CPU:X64 OS:X64)

>Running AU3Check (1.54.19.0) from:C:\Program Files (x86)\AutoIt3

C:\Program Files (x86)\AutoIt3\Include\Test 1.au3(1,8) : ERROR: syntax error

Func _Y)

here is my code itself

Func _Y)
    $Y = PixelGetColor(758, 527)
        $Yd = 0
        Select
        Case $Y = 0xffea8a and $Yd = 0
                send("{F1 down}")
                               $Yd = 1
        Case $Y <> 0xffea8a and $Yd = 1
                send("{F1 up}")
        EndSwitch
endfunc

Func _P()
    $P = PixelGetColor(800, 527)
        $Pd = 0
        Select
        Case $P = 0xec95ff and $Pd = 0
                send("{F2 down}")
                                $Pd = 1
        Case $P <> 0xec95ff and $Pd = 1
                send("{F2 up}")
        EndSwitch
endfunc

Func _G
    $G = PixelGetColor(838, 531)
        $Gd = 0
        Select
        Case $G = 0xc8ff87 and $G = 0
                send("{F3 down}")
                                $Gd = 1
        Case $G <> 0xc8ff87 and $G  = 1
                send("{F3 up}")
        EndSwitch

endfunc

While 1

    _Y()
    _P()
    _G()

Wend

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

So why don't you just add the missing bracket? What's the question here?

im new to this be nice

i did that and then i ran sytaxprod again

Func _Y()
    $Y = PixelGetColor(758, 527)
    $Yd = 0
    Select
        Case $Y = 0xffea8a And $Yd = 0
            Send("{F1 down}")
            $Yd = 1
        Case $Y <> 0xffea8a And $Yd = 1
            Send("{F1 up}")
;### Tidy Error -> "endswitch" is closing previous "select" on line 4
    EndSwitch
EndFunc   ;==>_Y

Func _P()
    $P = PixelGetColor(800, 527)
    $Pd = 0
    Select
        Case $P = 0xec95ff And $Pd = 0
            Send("{F2 down}")
            $Pd = 1
        Case $P <> 0xec95ff And $Pd = 1
            Send("{F2 up}")
;### Tidy Error -> "endswitch" is closing previous "select" on line 17
    EndSwitch
EndFunc   ;==>_P

Func _G()
    $G = PixelGetColor(838, 531)
    $Gd = 0
    Select
        Case $G = 0xc8ff87 And $G = 0
            Send("{F3 down}")
            $Gd = 1
        Case $G <> 0xc8ff87 And $G = 1
            Send("{F3 up}")
;### Tidy Error -> "endswitch" is closing previous "select" on line 30
    EndSwitch

EndFunc   ;==>_G

While 1

    _Y()
    _P()
    _G()

WEnd
Edited by dist7act

Share this post


Link to post
Share on other sites

After every function you MUST have parentheses!

_Y) should be _Y()

_G should be _G()

ok i fixed it now it doesnt show any sytax errors but it will not excute the key when the color is where it should be

Func _Y()
    $Y = PixelGetColor(758, 527)
    $Yd = 0
    Select
        Case $Y = 0xffea8a And $Yd = 0
            Send("{F1 down}")
            $Yd = 1
        Case $Y <> 0xffea8a And $Yd = 1
            Send("{F1 up}")
    EndSelect
EndFunc   ;==>_Y

Func _P()
    $P = PixelGetColor(800, 527)
    $Pd = 0
    Select
        Case $P = 0xec95ff And $Pd = 0
            Send("{F2 down}")
            $Pd = 1
        Case $P <> 0xec95ff And $Pd = 1
            Send("{F2 up}")
    EndSelect
EndFunc   ;==>_P

Func _G()
    $G = PixelGetColor(838, 531)
    $Gd = 0
    Select
        Case $G = 0xc8ff87 And $G = 0
            Send("{F3 down}")
            $Gd = 1
        Case $G <> 0xc8ff87 And $G = 1
            Send("{F3 up}")
    EndSelect

EndFunc   ;==>_G

While 1

    _Y()
    _P()
    _G()

WEnd

Share this post


Link to post
Share on other sites

$G can't be both 0xc8ff87 and 0 at the same time!

can u fix the code and show me what you mean?

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0