Scheduled Activities

version 10 by John Clemens

  • Home page
  • Beginning
  • Next



  • Documentation

    This extension allows activities to be scheduled at absolute and relative times. These activities may later be checked or cancelled. The advantage of this over the standard events is that activities may take a variable, and the same activity may be scheduled multiple times. Rudimentary support is also provided for grouping output of multiple activities scheduled for the same turn. The extension only allows for activities which are applied to objects or to nothing (i.e., it does not allow activities applied to other kinds of value).
    The change log and contact information are at the top of the extension code.
    Scheduled activities are stored in a table called the Table of Scheduled Events. This table initially holds 50 future activities; if more storage is needed, you can add a table continuation as follows:
        Table of Scheduled Events (continued)
      SA_Moment  SA_Turn  SA_Event  SA_Object_Event  SA_Target  SA_Similar  
      a time  a number  an activity on nothing  an activity on objects  an object  a number  
      with 100 blank rows  
    (note that the column names have been changed from previous versions).
    A new rule (the scheduled events rule) is inserted before the timed events rule (the rule which handles the usual timed events). So scheduled activities will occur immediately before events invoked with phrases like "the egg-timer clucks in four turns from now".
    SCHEDULING: The extension provides the following phrases to schedule activities:
        schedule (an activity) for (an object) at (a time)
        schedule (an activity) at (a time)
        schedule (an activity) for (an object) in (a number) minutes
        schedule (an activity) in (a number) minutes
        schedule (an activity) for (an object) now
        schedule (an activity) now
        schedule (an activity) for (an object) in (a number) turns
        schedule (an activity) in (a number) turns
    Here, "now" means at the end of the current turn.
    CANCELING: Activities can also be canceled:
        cancel all scheduled events for (an object)
        cancel all scheduled events
        cancel next timed event for (an object)
        cancel next timed event
        cancel all scheduled (an activity)
        cancel all scheduled (an activity) for (an object)
        cancel all scheduled events at (a time)
        cancel all scheduled events for (an object) at (a time)
    Note that "next timed event" considers only events scheduled in times, not those scheduled in turns. Also note that only activities scheduled with the phrases above can be canceled or checked in this way.
    CHECKING: The following conditions are supplied:
        if there is an event scheduled
        if there is an event scheduled for (an object)
        if there is (an activity) scheduled for (an object)
        if there is (an activity) scheduled
        if there is an event scheduled at (a time)
        if there is an event scheduled for (an object) at (a time)
        if there is (an activity) scheduled at (a time)
        if there is (an activity) scheduled for (an object) at (a time)
        if there is an event scheduled now
        if there is (an activity) scheduled now
        if there is an event scheduled for (an object) now
        if there is (an activity) scheduled for (an object) now
    REPORTING: Several conditions allow better reporting of multiple activities happening in the same turn.
        if first current activity
    This condition is true when carrying out the first scheduled activity during a given turn.
        if first similar activity
    This condition is true when carrying out a particular activity for the first time during a given turn (even if other activities have been carried out). This can be used to combine reports for carrying out the same activity with multiple objects in the same turn; see the example "Bunnies".
    Note that these two conditions do not apply to skipped events caused by changing the time directly.
    A new relation, the pending relation, is defined between objects and activities when the given activity is scheduled for the object during the current turn. So, for instance, the condition
        if a rabbit is pending waking
    will be true if the waking activity is scheduled for some rabbit during the current turn.
    DESCRIPTIONS: Several phrases are included allowing object descriptions, so it is possible to say, for instance, "schedule dispersing in 5 turns for everything enclosed by the location." The included phrases are:
        schedule (an activity) at (a time) for (a description)
        schedule (an activity) in (a number) minutes for (a description)
        schedule (an activity) now for (a description)
        schedule (an activity) in (a number) turns for (a description)
        cancel all scheduled events for (a description)
        cancel all scheduled (an activity) for (a description)
        if there is an event scheduled for (a description)
        if there is (an activity) scheduled for (a description)
        if there is an event scheduled now for (a description)
        if there is (an activity) scheduled now for (a description)