Outils pour utilisateurs

Outils du site


en:yaml:timers

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
en:yaml:timers [2026/05/03 18:39] – Fix EN action tokens to real engine syntax cyrilfiestaen:yaml:timers [2026/10/19 01:29] (Version actuelle) – Wiki 4.17 : corrections apres audit des exemples et traductions cyrilfiesta
Ligne 1: Ligne 1:
-**Language:** [[fr:yaml:timers|Français]] | **English**+**Language / Langue :** [[fr:yaml:timers|FR]] | **EN**
  
 ====== Timers (YAML) ====== ====== Timers (YAML) ======
Ligne 5: Ligne 5:
 JDR-Bot provides several timing mechanics. JDR-Bot provides several timing mechanics.
  
-===== Visual Pause {{timer:N}} =====+===== Visual Pause %%{{timer:N}}%% =====
  
 <code yaml> <code yaml>
Ligne 24: Ligne 24:
     duration: "30"     duration: "30"
     to: expired_room     to: expired_room
-    text: "Timer started — v_hourglass_v seconds left."+    text: "Timer started: v_hourglass_v seconds left."
 </code> </code>
  
Ligne 69: Ligne 69:
         do: "other_var.+.1"         do: "other_var.+.1"
 </code> </code>
 +
 +On a global timer:
 +
 +<code yaml>
 +global_timers:
 +  - id: poison_tick
 +    duration: 30
 +    state: OFF
 +    tick:
 +      - if: "v_hp_v > 0"
 +        do: "hp.-.1"
 +        text: "The poison acts... (HP: v_hp_v)"
 +</code>
 +
 +  * ''tick:'' runs independently of ''to:'' and ''do:'', which run when the timer expires.
 +  * Leaving the room cancels a local timer and its tick.
 +  * Calls through ''trigger_event:'' are limited to 10 nested levels, including from a tick.
 +
 +===== Stopping a timer =====
 +
 +A **local timer** cancels itself as soon as the player leaves the room: it belongs to that room.
 +
 +A **global timer** is stopped with the same switch that starts it:
 +
 +<code yaml>
 +do: "timer_global:bomb:OFF"      # pauses the timer
 +</code>
 +
 +Or:
 +
 +<code yaml>
 +do: "timer_global:bomb:SWITCH"   # toggles its state
 +</code>
 +
 +''OFF'' keeps the remaining time: a later ''ON'' resumes where the timer stopped.
  
en/yaml/timers.1777826341.txt.gz · Dernière modification : de cyrilfiesta