Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
rajasetan
Beginner


Joined: 14 Sep 2006
Posts: 11
Location: Jakarta, Indonesia

PostPosted: 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!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net