Basic Real Time

version 2 by Sarah Morayati

  • Home page
  • Beginning
  • Previous



  • Section 4 - Inform 7 Syntax

    The next real-time action is a stored action that varies.

    A glulx timed activity rule: perform the next real-time action;

    To start the/-- timer for (sec - a number) second/seconds: (-
    StartTimer({sec}*TIME_SCALAR); -)

    To set the/-- timer for (newsec - a number) second/seconds: (-
    SetNewTimer({newsec}*TIME_SCALAR); -)

    To pause the/-- timer: (- PauseTimer(); -)

    To resume the/-- timer: (- ResumeTimer(); -)

    To deduct (sec - a number) second/seconds from the/-- timer: (-
    DeductFromTimer({sec}*TIME_SCALAR); -)

    To add (sec - a number) second/seconds to the/-- timer: (-
    AddToTimer({sec}*TIME_SCALAR); -)

    To stop the/-- timer: (- glk_request_timer_events(0); time_elapsed = 0; -)

    To perform the next real-time action: (- TimedAction(); -)

    At the time when the action fires: try the next real-time action;

    To say seconds remaining: (- PrintSecondsRemaining(); -)

    To say seconds elapsed: (- PrintSecondsElapsed(); -)

    Basic Real Time ends here.