hour

hour

The current game hour, on a 24-hour clock.

The hour comes from the game's own day/night cycle, not real-world time.

Arguments

Takes no arguments.

Returns

An int from 0 to 23 — the current hour of the game day.

Examples

after command (say) {
  do "say The hour is [hour]."
}

If this way run when the time was 19, so the mob would say "The hour is 19." The value would change as game time advances.

Because the result is an int, branch on it with the operators:

after command (say) {
  if [or [ge [hour] 21] [lt [hour] 6]] {
    do "say It is dark out. Best stay indoors."
  }
}

This warns the actor during the night hours (9 p.m. through 5 a.m.).

See also