make_timer

Declaration

make_timer (name: STRING; duration: INTEGER; repeating, ascending: BOOLEAN)

Description

Creates or restarts a timer called name.

name   name of the timer. If it already exists, the new values are applied and it is restarted.
duration   number of seconds to wait before firing. If duration is '0', then the timer does NOT fire. Use a non-firing timer if you just want to display a timer without firing. Good for making a total-time spent timer.
repeating   If False, the timer fires only once. If True, then it will fire every duration seconds until delete_timer or stop_timer is called for name.
ascending   If True, the timer counts up from 0. If False, the timer counts down from duration.

See Also

delete_timer
is_timer
timer functions
Timer_Manager

Example

script start_test is
  make_timer ('test', 3600, False, False)
    -- a timer that fires in an hour and counts down
end

script on_test_fired is
  delete_timer ('test')
  load_item_in_frame ('time_is_up', 'main_window_frame')
end