core.script_api:wait()
Pause for a duration, until a timestamp, or for a relative time.
Usage
core.script_api:wait(
duration=None,
until=None,
message="",
silent=10,
)Parameters
duration: float or int = None-
The number of seconds to sleep. If specified, the function will sleep for this duration. If paused during this duration the remaining wait time continue after unpausing. If a str or datetime object is used here it will be redirected to the until argument.
until: str or datetime = None-
A target time or relative time string. It can be: - An absolute timestamp: “YYYY-MM-DD HH:MM:SS” or “HH:MM”. - A relative time string starting with ‘+’ followed by a number and a unit (e.g., “+24h” for 24 hours, “+30m” for 30 min., “+1d” for 1 day). - A
datetimeobject representing a specific time. message: str = ""-
Print this string if the sleep exceeds the silent argument.
silent: float = 10- Print a message string if this value is exceeded.
Examples
>>> wait(duration=10)
Pauses execution for 10 seconds.>>> wait(until="2025-11-05 15:30")
Pauses execution until 15:30 on November 5, 2025.>>> wait(until="+2h")
Pauses execution for 2 hours from the current time.>>> wait(until="18:00")
Pauses execution until 18:00 today,
or until the same time tomorrow if it has already passed today.