Subject: MooCode

From: [email-masked] (C. Regis Wilson)
Date: Mon, 8 Jun 1992 20:47:26 -0700

I put some moo code I had fixed up on the ftp site.
The code is free, and you can do whatever you please
with it.  Most is self explanatory, except the
"scheduler.moo"

Scheduler is a generic process scheduler which queues
events which should run infrequently (every hour, day,
etc.)  It only uses one process, and if there are no
tasks, it uses none.  The call is made through the
entry point "schedule".  The parameters are as follows:

number of seconds from now to execute
object number which has the verb you will run
verb name, as a string
arguments, as a list

For example, to schedule an announce in the player's
room in two hours, call thusly:

$scheduler:schedule(7200,player.location,"announce_all" 
,{player.name," farts."});

(please excuse my choice of example....:)

Things which need to be done in a cron tab like manner,
for instance, ever hour, every day, should schedule  
themselves,
run and re-schudule themselves, if necessary,  
recursively.

When you look at the scheduler, it will tell you the
jobs queued, etc.  Typing "reset scheduler", when in  
the
same room as it, will reset the box, if things get  
screwed.
Send me a note if you have problems, or get bugs.

Thanks,

---

---------
T. Pascal, King of Pascal          | "He travels  
fastest who travels alone,
1600 Campus Road, Box 829          | but not when the  
frost drops below zero
Los Angeles, CA 90041              | fifty degrees or  
more."
                                   |         -Old  
eskimo saying
...!gate.oxy.edu!t_pascal  
t_pascal@{cub.math,jaguar.math,bobcat,tiger}.oxy.edu