Sign in to follow this  
Followers 0
renanzin

Erro in my fuction

7 posts in this topic

Global $Paused

HotKeySet("{F7}", "fFindColor")

While 1

Sleep (100)

Wend

Local $Color = 0X19EE66

Dim $X[10] = [10,60,110,160,210,160,110,60,10,60]

Dim $Y[10] = [20,30,40,50,60,50,40,30,20,10]

For $i = 1 to 9

if fFindColor($Color,$X[$i],$Y[$i]) then

exitloop

endif

Next

Func UnFocus()

WinActivate("Classname=Shell_TrayWnd")

EndFunc ;==>Unfocus

Func fFindColor($pColor, $pX, $pY, $pSize=12)

Dim $ColorPos

Unfocus()

$ColorPos = PixelSearch($pX-$pSize,$pY-$pSize,$pX+$pSize,$pY+$pSize,$pColor)

if not @error Then

SoundPlay(@WindowsDir & "\media\tada.wav",1)

Return True

Else

Return False

EndIf

Exit 0

EndFunc

press F7 = error (25) : ==> Variable used without being declared.:

but i tihnk all ok Oo

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

It might mean $Color, it seems like you haven't defined this function.

Might be built-in though.

Worth a try anyway

Edited by nf67

Share this post


Link to post
Share on other sites

you have the "HOTKEYSET()" calling a function that needs 3 minimum parameters. it can not work like that

HotKeySet("{F7}", "ShowMe")

While 1
    Sleep(100)
WEnd

; ----------------------- Functions ---------------------------

Func ShowMe()
    Local $Color = 0X19EE66
    Local $X[10] = [10, 60, 110, 160, 210, 160, 110, 60, 10, 60]
    Local $Y[10] = [20, 30, 40, 50, 60, 50, 40, 30, 20, 10]

    For $i = 1 To 9
        If fFindColor($Color, $X[$i], $Y[$i]) Then
            ExitLoop
        EndIf
    Next
EndFunc   ;==>ShowMe

Func UnFocus()
    WinActivate("Classname=Shell_TrayWnd")
EndFunc   ;==>UnFocus

Func fFindColor($pColor, $pX, $pY, $pSize = 12)
    UnFocus()
    $ColorPos = PixelSearch($pX - $pSize, $pY - $pSize, $pX + $pSize, $pY + $pSize, $pColor)
    
    If Not @error Then
        SoundPlay(@WindowsDir & "\media\tada.wav", 1)
        Return True
    Else
        Return False
    EndIf
EndFunc   ;==>fFindColor

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

dun give me a sound bro

i need find that color HEX = 19EE66 and give me a sound x.x

Edited by renanzin

Share this post


Link to post
Share on other sites

anyone help me x.x ?

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

não entendeu ainda ? tem que ter 3 parametros, no seu ta puxando só 2 ^^

Edited by Paro

Share this post


Link to post
Share on other sites

não entendeu ainda ? tem que ter 3 parametros, no seu ta puxando só 2 ^^

..and your problem is what? We don't need bully type noobs here .

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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