@create $feature named Scheduler:ParkMOO Scheduler,Scheduler @prop #174."tasks" {} rc @prop #174."lock" 0 rc @prop #174."lock_timeout" 300 rc @prop #174."master" #-1 rc @prop #174."task" 0 rc @prop #174."version" "3.01" rc @prop #174."trusts" {} rc @prop #174."intervals" {} rc ;;#174.("intervals") = {"now", "seconds", "minutes", "hours", "days", "nights", "weeks", "fortnights", "months", "years"} @prop #174."interval_times" {} rc ;;#174.("interval_times") = {0, 1, 60, 3600, 86400, 604800, 1209600, 2419200, 31449600} ;;#174.("help_msg") = {" Moo Job Scheduler, written by T. Pascal, King of Pascal (t_pascal@oxy.edu) and some help and ideas by Gustavo Glusman (bmgustav@dapsas1.weizmann.ac.il) Released October 23, 1993", "Premise: Sometimes, it is necessary to have moo-tasks (processes) which execute with a long period, say once a day, every month, etc. Sometimes, it is necessary to have verbs execute repetatively, over and over and over again. Sometimes, it is necessary to have verbs which need to be executed at a particular time.", "And, sometimes, a combination of the above needs to occur: A verb that runs every hour on the hour, for example. Assuming the premises are true, these processes must stay in the task queue, often forming clutter which must be weeded through by the wizards. Thus, the scheduler is born.", "Scheduler: The scheduler is designed as a process storage chamber. Verbs which execute with a long period (an hour, a day, etc.) can be stored on the scheduler, without filling up the queued task list. Verbs which need to happen with a certain number of iterations, or infinitely, can be handled by code in the scheduler, reducing the burden on the programmer. The scheduler also accounts for drift in lag, allowing a verb to run at a certain time, every time.", " Building Blocks:", "", " :schedule (rel_time,obj,verb[,args])", " :schedule_at (abs_time,obj,verb[,args])", " :schedule_every (rel_time,obj,verb[,args])", "", "", " \"rel_time\" indicates a time interval from the present moment, that is: a relative time, or \"x seconds from now\"", " \"abs_time\" indicates an absolute time, for example: 749069038", " \"obj\" indicates the object on which the verb you will call resides", " \"verb\" is the verb you will be calling", " \"args\" is/are the argument(s) you will use in the verb call.", "", "The \"rel_time\" is a number, given in seconds.The \"obj\" is an object number, like #1, the verb is a string, like \"tell\". The \"args\" is a list of arguments to be passed, and may be left off. If left off, no arguments will be passed.", "", " Examples:", "", " :schedule(35,#11,\"announce_all\",{\"I am here!\"})", "", " which is equivalent to:", " ;fork(35) #11:announce_all(\"I am here!\"); endfork", " ", " :schedule_at(749069497,$fountain,\"start\")", "", " equals:", "", " ;fork(time()+6*24*3600) $fountain:start(); endfork", "", " :schedule_every(15,$puppet,\"action\",{\"move\",\"eat\",\"walk\"})", "", " is fairly close in meaning to:", "", " [verb code on $puppet]", " ...", " fork (15)", " this:(verb)(\"move\",\"eat\",\"walk\");", " endfork", "", "", "Extra Neat-o's:", "The \"object\" parameter in the verb calls above may be substituted with strings.", "The string will then be passed to the player's eval_cmd_str(), and must return an object number. If the code does not return a valid object number, the scheduled verb will not run.", "Also, the \"arguments\" parameter may be left as a simple value (integer, string, whatever), or left off entirely.", " Examples:", "", " :schedule_every(35,\"player.location\",\"announce_all\",{\"I am here!\"})", " ", " Every 35 seconds, this verb will announce to the player's current location.", "", " :schedule(35,\"player\",\"tell\",\"Hello from me!\")", " ", " Equivalent to :schedule(35,\"player\",\"tell\",{\"Hello from me!\"})", "", " :schedule(35,\"player\",\"tell\")", "", " Equvalent to :schedule(35,\"player\",\"tell\",{})", "Stuff on top of building blocks:", "Naturally, you may build neat nestings on the scheduler. You could do a \":schedule_at(time,#91,\"schedule_every\",{...\" etc. However, this is messy, and not easy for beginners. Hence, the scheduler now has an english-like parser.", "Wouldn't it be great if you could tell the scheduler to do things \"every 5 minutes\", \"6 times every 3 minutes starting in 5 hours\", or \"Sun Sep 26 12:01:29 1993\"? Well you can!", "", " :schedule_english(english_string,obj,verb,args)", "", " \"english_string\" is of the following form, each part optional:", "", " [ times] [every [] ] [starting] [in [] ", "", " ] [[at]