DPB2Class · Utilities and settings

WaitTimer

Track a time interval without blocking the bot. Keep the same timer instance between ticks and reset it after the periodic work.

Namespace: DreamPoeBot.Loki.Common

public class WaitTimer
Reference: DPB2 0.4.5.103Compare the DPB1 reference → Check signatures and usage notes separately; a matching type is not a compatibility guarantee.

Use this API

Class usage example: Gate repeated work →

Members and overloads

15 declared here

WaitTimer

MethodLink ↗
public WaitTimer.WaitTimer(TimeSpan waitTime)

Creates a new WaitTimer instance using the supplied arguments.

Parameters

waitTime
Parameter type: TimeSpanNo current DPB page is linked for this built-in, external, generic or compatibility-only type.

Specifies wait time.

Reset

MethodLink ↗
public void WaitTimer.Reset()

Starts a new interval now, using the supplied duration when provided. IsFinished remains false until the interval has elapsed.

Return type: voidNo return value.

Reset

MethodLink ↗
public void WaitTimer.Reset(TimeSpan newDuration)

Starts a new interval now, using the supplied duration when provided. IsFinished remains false until the interval has elapsed.

Return type: voidNo return value.

Parameters

newDuration
Parameter type: TimeSpanNo current DPB page is linked for this built-in, external, generic or compatibility-only type.

Specifies new duration.

Stop

MethodLink ↗
public void WaitTimer.Stop()

Moves the start time five days into the past, making short intervals immediately eligible. This does not stop the bot or its components.

Return type: voidNo return value.

Update

MethodLink ↗
public void WaitTimer.Update()

Raises Finished if the interval has elapsed and a handler is subscribed. Call Reset to prevent repeated notifications on later Update calls.

Return type: voidNo return value.

EndTime

PropertyLink ↗
public DateTime WaitTimer.EndTime { get; }

Reads end time on WaitTimer as DateTime. The exact type and accessors are shown below.

Value type: DateTimeNo current DPB page is linked for this built-in, external, generic or compatibility-only type.

IsFinished

PropertyLink ↗
public bool WaitTimer.IsFinished { get; }

Whether this wait timer is finished.

Value type: boolNo current DPB page is linked for this built-in, external, generic or compatibility-only type.

StartTime

PropertyLink ↗
public DateTime WaitTimer.StartTime { get; private set; }

Reads or assigns start time on WaitTimer as DateTime. The exact type and accessors are shown below.

Value type: DateTimeNo current DPB page is linked for this built-in, external, generic or compatibility-only type.

TimeLeft

PropertyLink ↗
public TimeSpan WaitTimer.TimeLeft { get; }

Reads time left on WaitTimer as TimeSpan. The exact type and accessors are shown below.

Value type: TimeSpanNo current DPB page is linked for this built-in, external, generic or compatibility-only type.

WaitTime

PropertyLink ↗
public TimeSpan WaitTimer.WaitTime { get; set; }

Reads or assigns wait time on WaitTimer as TimeSpan. The exact type and accessors are shown below.

Value type: TimeSpanNo current DPB page is linked for this built-in, external, generic or compatibility-only type.

Class usage examples

These examples demonstrate the class, not every member listed above. Each example links the declarations it teaches.

Imports used by these examples
using System;
using System.Linq;
using DreamPoeBot.Loki.Game;
using DreamPoeBot.Loki.Game.Objects;
using DreamPoeBot.Loki.Bot;
using DreamPoeBot.Loki.Bot.Pathfinding;
using DreamPoeBot.Loki.Common;

Gate repeated work

public sealed class PeriodicCheck
{
    private readonly WaitTimer _timer = new WaitTimer(TimeSpan.FromSeconds(1));

    public void Start() { _timer.Stop(); } // First check is immediately eligible.

    public void Tick()
    {
        if (!_timer.IsFinished) return;
        _timer.Reset();
        // Perform one bounded check here.
    }
}

Requires System and DreamPoeBot.Loki.Common. This is a helper class, not a discoverable plugin: own one instance in your component and call its Start/Tick. The timer is a field, so it survives between ticks. Stop makes this timer eligible; it does not suspend the component.

Guides using this class

See how these APIs fit together. Labs include complete source; the FollowBot walkthrough teaches you to build your own bot from selected fragments and checkpoints.

DPB2 0.4.5.103 · Reference reviewed 2026-10-30. Descriptions use source summaries where available, otherwise concise signature-based descriptions. Examples illustrate usage; they are not a live-game test.