Help - Search - Members - Calendar
Full Version: New to macro and I need help
AC Tools Everything Macro > AC Tool Macros > Macro Development
Felnix
This is my script:

CONSTANTS
run_time = 0
coordinatex = 0
coordinatey = 0
END CONSTANTS

Procedure createCoordinate
If $run_time = 1
setconst $coordinatex = 123
setconst $coordinatey = 456
else if $run_time = 2
setconst $coordinatex = 111
setconst $coordinatey = 222
else if $run_time = 3
setconst $coordinatex = 333
setconst $coordinatey = 444
end if
End

Procedure Run
compute $run_time = $run_time + 1
call createCoordinate
MousePos $coordinatex, $coordinatey
delay 1000
LeftClick
delay 1000
Keys m
delay 1000
Keys e
delay 1000
Keys {ESC}
Delay 5000
Keys m
delay 1000
Keys c
delay 1000
Keys {ESC}
End

MousePos 899, 493
LeftClick
Keys h
delay 1000
Loop 3
call Run
End


This is the Output:
*Don't care about other action, just focus on Mousepos

Mousepos 899, 493
Mousepos 333, 444
Mousepos 111, 222
Mousepos 111, 222

*If I set more loops, other output will be all Mousepos 111, 222 until loops end.

What is the problem, can anyone help me to fix it? sad.gif Thanks
Ipa
ACTool does not support combined "else if".
Essentially the parser ignores everything after the keyword "else".

CODE
Procedure createCoordinate
  If $run_time = 1
    setconst $coordinatex = 123
    setconst $coordinatey = 456
  Else
    If $run_time = 2
      setconst $coordinatex = 111
      setconst $coordinatey = 222
    Else
      If $run_time = 3
        setconst $coordinatex = 333
        setconst $coordinatey = 444
      End
    End
  End
End
Felnix
Nice. Its works! Thanks alot... rolleyes.gif rolleyes.gif
Now I can continue my script development.
Felnix
well anyone have any idea how to trace the color on screen?
DaMOB
QUOTE(Felnix @ Aug 28 2009, 11:29 PM) *
well anyone have any idea how to trace the color on screen?

What do you mean by trace?
Felnix
I mean how to detect the color on current a pixel.
DaMOB
QUOTE(Felnix @ Aug 29 2009, 03:11 PM) *
I mean how to detect the color on current a pixel.

The absolutely best way is LoadRGB as I am no advocate of the IsColor commands.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.