Errores varios al compilar (detallados)

Pregunta Sin Miedo no te cortes cualquier cosa para empezar - Autoit se comienza facilmente.Para Ordenes o Comandos sueltos. Ver nota como preguntar.
Responder
diego
Mensajes: 28
Registrado: 24 Jul 2013, 01:26

Errores varios al compilar (detallados)

Mensaje por diego »

Hola este es mi bot para capturar movimientos en pantalla, pero tengo problemas al compilar y hacerlo funcionar.

Func get_moves($num)

Local $moves[$num]

For $i = 0 to ($num-1)

Local $left = 0, $right = 0, $up = 0, $down = 0

While 1
PixelSearch($start_x+64-12, $start_y+32, $start_x+64-12, $start_y+32, 0x282806, 20 , 1)
If Not(@error) Then
; left or right
$left = PixelSearch($start_x+26, $start_y+23, $start_x+26, $start_y+23, 0xE0D75E, 40, 1, $wiz_han)
If @error Then
Dim $right[2] = (0, 0)
EndIf
ExitLoop
EndIf
PixelSearch($start_x+32, $start_y+64-12, $start_x+32, $start_y+64-12, 0x282806, 20, 1, $wiz_han)
If Not(@error) Then
; up or down
$up = PixelSearch($start_x+26, $start_y+23, $start_x+26, $start_y+23, 0xFFED27, 40, 1, $wiz_han)
If @error Then
Dim $down(2) = (0, 0)
EndIf
ExitLoop
EndIf
WEnd
If IsArray($left) Then
$moves($i) = "left"
ElseIf IsArray($right) Then
$moves($i) = "right"
ElseIf IsArray($up) Then
$moves($i) = "up"
ElseIf IsArray($down) Then
$moves($i) = "down"
EndIf
ConsoleWrite($moves($i)) & @CRLF)
Sleep(350)
Next
Return $moves
EndFunc

Cuando presiono CTRL+F5 me sale:

error: get_moves(): undefined function.

warning: $wiz_han: possibly used before declaration.
$left = PixelSearch($start_x+26, $start_y+23, $start_x+26, $start_y+23, 0xE0D75E, 40, 1, $wiz_han)

error: syntax error
Dim $right[2] = (
~~~~~~~~~~~~~~~~~~~^
error: unbalanced paranthesis expression.
Dim $right[2] = (0,


A ver si me pueden orientar, estaba pensando en sacar esos DIM de ahi, pero no se como hacer entonces para tomar los movimientos de arriba y abajo por separado.
Avatar de Usuario
Dany
Profesional del Autoit
Mensajes: 651
Registrado: 28 Mar 2012, 22:49

Re: Errores varios al compilar (detallados)

Mensaje por Dany »

Primero deberías aprender como funciona AutoIt.

No tienes la funcion get_moves()

Esto Dim $right[2] = (0, 0) no es asi es Dim $right[2] = [0, 0]




Saludos :smt027
  • ............................................Imagen
    ......................................Imagen
Responder