Jump to content

Erro in my fuction


Recommended Posts

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

Link to comment
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

Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
 Share

  • Recently Browsing   0 members

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