**Language / Langue :** [[fr:yaml:timers|FR]] | **EN**
====== Timers (YAML) ======
JDR-Bot provides several timing mechanics.
===== Visual Pause {{timer:N}} =====
text: |
The mechanism starts...
{{timer:3}}
The door opens!
===== Local Timer =====
A local timer is declared in an event and is cancelled when the player leaves the room.
events:
- if: ~
timer: hourglass
duration: "30"
to: expired_room
text: "Timer started — v_hourglass_v seconds left."
===== Global Timer =====
global_timers:
- id: bomb
duration: 60
state: OFF
events:
- if: ~
do: "timer_global:bomb:ON"
Autonomous global timers can run their own actions when they expire:
global_timers:
- id: fatal_countdown
duration: 60
state: OFF
text: "Time is up!"
do:
- "score.-.20"
to: defeat_end
===== tick: =====
''tick:'' runs every second on local or global timers.
events:
- if: ~
timer: tick_demo
duration: "180"
to: expired_room
tick:
- if: ~
do: "ticks.+.1"
- if: "v_ticks_v > 5"
do: "other_var.+.1"