rajasetan Beginner
Joined: 14 Sep 2006 Posts: 11 Location: Jakarta, Indonesia
|
Posted: Fri Sep 15, 2006 12:10 pm
ALIAS with FORALL and WAIT and stringlists |
Hi,
I need help in improving and refining this little script,
Code: |
#ALIAS ent_get {#T+ horse_list trigger;#T+ dog_list trigger;#T+ ent_listend;ENTOURAGE}
#TRIGGER "horse_list" {^~"horse(%d)~"} {#ADDITEM horse %1} "" {disable}
#TRIGGER "dog_list" {^~"dog(%d)~"} {#ADDITEM dog %1} "" {disable}
#TRIGGER "ent_listend" {^Number of entourage:} {#T- horse_list;#T- dog_list;#T- ent_listend} "" {disable}
#ALIAS horse_move {#FORALL @horse {order %i move %1;#WAIT 100}}
#ALIAS dog_move {#FORALL @dog {order %i move %1;#WAIT 100}}
#ALIAS ents_move {horse_move %1;dog_move %1}
#VAR horse {}
#VAR dog {}
|
What the script suppose to do is:
- Get the list of my entourage when I do "ent_get" (the actual command sent to the Mud will be "entourage")
- Store the list in "horse" and "dog" variables
- Orders my ents to move a direction when I issue "ents_move <dir>"
- Orders a single type of ents to move when I issue "horse_move <dir>" or "dog_move <dir>"
How to make it so that if I issue an
"ents <type> move <dir>" (ex. "order horse move north")
it wil make all the horses in my entourage to go north,
and if I issue an
"ents all move <dir>"
it will make all my ents (not just horses) to move in that direction.
And yes, it is possible to have more than a single horse/dog/(any type of ent) in my ents list.
Help is appreciated. Thanks in advance! |
|