Re: Recursive Aliases, was [CIRCLE] [NEWBIE] Global alias

From: Peter Ajamian (peter@pajamian.dhs.org)
Date: 02/09/00


Patrick Dughi wrote:
>
> >
> > I also changed it so that an alias can call another alias (but the same
> > alias still cannot be called recuresively).  this allows players to
> > create multiple-command aliases without the limitation of the
> > command-line length.
> >
>
>         Actually, I _had_ aliases which had the ability to call other
> aliases.  I put in a check which would limit the end length of commands,
> so even recursive aliases would eventually peter out.  However, this gave
> rise to a slew of problems, and I eventually disabled some of the
> functionality.
>
>         I did want to put it back in though, and was wondering if anyone
> had done it in this fashion;
>
>         Instead of allowing an arbitrary # of commands to be executed at
> once, to allow _x_ # of commands a second (say 5 a second, dequeued every
> .2 seconds obviously).  In this way, you could have a character's command
> saved, and each time it generates another command, it simply
> delays for .2 seconds.  Of course, if the user provides any input, it
> would overwrite the last 'command', and break out of recursive loops.
> That way you could have recursive aliases, and basically, allow it.
>
>         Any thoughts?

Well, to further explain what I did, my aliases system will now execute
up to 10 commands per game loop, any more than 10 it pushes back onto
the input buffer to continue executing next time around (this way
players can't abuse it in such a way which locks up the system).  This
greatly improves the speed and efficiency at which aliases run.  Players
who are fighting however, only run aliases at a rate of one command per
game loop.  Right now it is set so that any given alias has to exit
before it can be called again however, at some time in the future I may
set up looping and conditional statements as well as variables and a few
other things which will hopefully end up turning the alias system into
full fledged scripting system, at that time I will probably allow alases
to be recursed with a limit on the number of recursions allowed (to
prevent a runaway alias).

Anyways, I hope that helps to give you a few ideas and good luck:)

Regards, Peter


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/10/01 PDT