|
bcglassman Newbie
Joined: 13 Mar 2007 Posts: 5
|
Posted: Tue Mar 13, 2007 7:35 pm
forall syntax question |
ok ... here's another easy question that I am struggling with ... I would like to pass an alias and list of values in one line and have the alias iterate through my list:
#ALIAS cf {cast spell} %1
list="values passed at command line"
#FORALL @list {cf %i}
between each casting of the spell I need to pause until I recover my equilibrium (a great movie btw).
something like this
foreach %1
do something
wait for specific condition
next %1
I can't find all the syntax I need in the help files ...
signed with love,
an idiot! |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Tue Mar 13, 2007 7:48 pm |
Firstly, your alias should probably look like this:
#alias cf {cast spell %1}
to ensure that the %1 is properly added.
Secondly, #forall probably isn't the right way to do this. The easiest way would be just to use #wait:
#forall @list {cf %i;#wait 2000}
but #wait can cause problems. A better way would probably be something like this:
#var Equilibrium 1
#trig {You have recovered equilibrium} {#var Equilibrium 1}
#trig {@Equilibrium=1} {cf %pop(@list);#var Equilibrium 0} "" {exp} |
|
|
|
bcglassman Newbie
Joined: 13 Mar 2007 Posts: 5
|
Posted: Tue Mar 13, 2007 8:14 pm |
Fang Xianfu wrote: |
#var Equilibrium 1
#trig {You have recovered equilibrium} {#var Equilibrium 1}
#trig {@Equilibrium=1} {cf %pop(@list);#var Equilibrium 0} "" {exp} |
perfect ... I used
#alias cf {abjure cosmicfire %1}
#var Equilibrium 1
#trig {You have recovered equilibrium} {#var Equilibrium 1}
#trig {@Equilibrium=1} {
cf %pop( @list)
#var Equilibrium 0
} "" {exp}
and it iterates beautifully ... THANK YOU |
|
|
|
|
|