DPB1Class · Bots, plugins and tasks

Coroutines

Asynchronous helpers for timing, interaction and common game actions. Await these helpers within the bot workflow.

Namespace: DreamPoeBot.Loki.Bot

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

Use this API

Class usage example: Inspect the shared interaction timing settings →

Members and overloads

17 declared here

CloseBlockingWindows

MethodLink ↗
public static Task Coroutines.CloseBlockingWindows()

Close ALL the game Ui windows. you usually call this before to interact with some world object (npc, loot, moster, areatransation etc etc)

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

Returns: An asynchronous operation. Await it before reading the result or continuing the workflow.

ExInteractWith

MethodLink ↗
public static Task<Vector2i> Coroutines.ExInteractWith(NetworkObject obj, bool holdCtrl = false, int timeout = 1000)

Attempts to interact with a game object and returns the character's interaction position. The character may move into range when necessary. For WorldItems, this overload allows the game to equip the collected item automatically when the game permits it.

Return type: Task<Vector2i>
Explore Vector2i → members & methods

A two-dimensional integer position. Used by grid-position and pathfinding APIs; screen-position APIs may expect a different coordinate type.

Parameters

obj
Parameter type: NetworkObject

The game object to interact with.

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

Whether to hold the Control key during the interaction.

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

The maximum time, in milliseconds, to wait for the interaction.

Returns: The interaction position when successful; otherwise, DreamPoeBot.Common.Vector2i.Zero.

ExInteractWith

MethodLink ↗
public static Task<Vector2i> Coroutines.ExInteractWith<T>(NetworkObject obj, bool holdCtrl, int timeout)

Attempts to interact with a game object of the requested type and returns the character's interaction position. The character may move into range when necessary. For WorldItems, this overload allows the game to equip the collected item automatically when the game permits it.

Return type: Task<Vector2i>
Explore Vector2i → members & methods

A two-dimensional integer position. Used by grid-position and pathfinding APIs; screen-position APIs may expect a different coordinate type.

Parameters

obj
Parameter type: NetworkObject

The game object to interact with.

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

Whether to hold the Control key during the interaction.

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

The maximum time, in milliseconds, to wait for the interaction.

Returns: The interaction position when successful; otherwise, DreamPoeBot.Common.Vector2i.Zero.

ExInteractWith

MethodLink ↗
public static Task<Vector2i> Coroutines.ExInteractWith<T>(NetworkObject obj, bool holdCtrl = false, int timeout = 1000, bool autoEquip = true)

Attempts to interact with a game object of the requested type and returns the character's interaction position. The character may move into interaction range when necessary.

Return type: Task<Vector2i>
Explore Vector2i → members & methods

A two-dimensional integer position. Used by grid-position and pathfinding APIs; screen-position APIs may expect a different coordinate type.

Parameters

obj
Parameter type: NetworkObject

The game object to interact with.

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

Whether to keep the Control key pressed while interacting.

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

The maximum time, in milliseconds, to wait for the interaction.

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

For WorldItems, true to allow the game to equip the collected item automatically when the game permits it; false to collect it without requesting automatic equipment. This value has no effect on other object types.

Returns: The interaction position when successful; otherwise, DreamPoeBot.Common.Vector2i.Zero.

FinishCurrentAction

MethodLink ↗
public static Task Coroutines.FinishCurrentAction(bool resetInput = true)

This function make sure we are not actually performing another action, and if so, it wait till the end of that action, or the default timeout (5000ms). You usually call this to make sure a previous action you performed (cast a non instant skill, MoveToward etc etc) run to completition, before to perform another one.

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

Parameters

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

True, if you want to reset all key state after the current action completed.

Returns: An asynchronous operation. Await it before reading the result or continuing the workflow.

InteractWith

MethodLink ↗
public static Task<bool> Coroutines.InteractWith(NetworkObject obj, bool holdCtrl = false)

Attempts to interact with a game object, such as an item, NPC, chest, portal or area transition. The character may move into interaction range when necessary. For WorldItems, this overload allows the game to equip the collected item automatically when the game permits it.

Return type: Task<bool>No current DPB page is linked for this built-in, external, generic or compatibility-only type.

Parameters

obj
Parameter type: NetworkObject

The game object to interact with.

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

Whether to hold the Control key during the interaction.

Returns: True when the interaction was started successfully; otherwise, false.

InteractWith

MethodLink ↗
public static Task<bool> Coroutines.InteractWith<T>(NetworkObject obj, bool holdCtrl)

Attempts to interact with a game object of the requested type. The character may move into interaction range when necessary. For WorldItems, this overload allows the game to equip the collected item automatically when the game permits it.

Return type: Task<bool>No current DPB page is linked for this built-in, external, generic or compatibility-only type.

Parameters

obj
Parameter type: NetworkObject

The game object to interact with.

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

Whether to hold the Control key during the interaction.

Returns: True when the interaction was started successfully; otherwise, false.

InteractWith

MethodLink ↗
public static Task<bool> Coroutines.InteractWith<T>(NetworkObject obj, bool holdCtrl = false, bool autoEquip = true)

Attempts to interact with a game object of the requested type. The character may move into interaction range when necessary.

Return type: Task<bool>No current DPB page is linked for this built-in, external, generic or compatibility-only type.

Parameters

obj
Parameter type: NetworkObject

The game object to interact with.

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

Whether to keep the Control key pressed while interacting.

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

For WorldItems, true to allow the game to equip the collected item automatically when the game permits it; false to collect it without requesting automatic equipment. This value has no effect on other object types.

Returns: True when the interaction was started successfully; otherwise, false.

LatencyWait

MethodLink ↗
public static Task<int> Coroutines.LatencyWait()

This is a convenient method to pause The bot execution for a number of ms equal to your actual average latency multiplied for the LatencyFactor. Usually used after the execution of an action, this make sure the game has time to send the current action to the server and recieve an answer.

Return type: Task<int>No current DPB page is linked for this built-in, external, generic or compatibility-only type.

Returns: The number of ms the bot paused for.

LatencyWait

MethodLink ↗
public static Task<int> Coroutines.LatencyWait(float factor)

This is a convenient method to pause The bot execution for a number of ms equal to your actual average latency multiplied for the factor parameter. Usually used after the execution of an action, this make sure the game has time to send the current action to the server and recieve an answer.

Return type: Task<int>No current DPB page is linked for this built-in, external, generic or compatibility-only type.

Parameters

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

Specifies factor.

Returns: An asynchronous operation. Await it before reading the result or continuing the workflow.

Loot

MethodLink ↗
public static Task<LootResult> Coroutines.Loot(NetworkObject obj, bool shouldMove, int tmeout)

Attempts to pick up a WorldItem. When shouldMove is enabled, the character may move into interaction range before picking it up. This overload allows the game to equip the collected item automatically when the game permits it.

Return type: Task<LootResult>
Explore LootResult → members & methods

Named values for loot result. Select a value when an API accepts or returns LootResult.

Parameters

obj
Parameter type: NetworkObject

The WorldItem to pick up.

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

Whether the character may move into interaction range. If false, the method returns DreamPoeBot.Loki.Game.LootResult.ShouldMove when movement is required.

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

The maximum time, in milliseconds, to wait for the interaction. Allow enough time for movement when shouldMove is true.

Returns: DreamPoeBot.Loki.Game.LootResult.None when the interaction was started; otherwise, a value describing why it could not be started.

Loot

MethodLink ↗
public static Task<LootResult> Coroutines.Loot(NetworkObject obj, bool shouldMove = true, int tmeout = 250, bool autoEquip = true)

Attempts to pick up a WorldItem. When shouldMove is enabled, the character may move into interaction range before picking it up.

Return type: Task<LootResult>
Explore LootResult → members & methods

Named values for loot result. Select a value when an API accepts or returns LootResult.

Parameters

obj
Parameter type: NetworkObject

The WorldItem to pick up.

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

Whether the character may move into interaction range. If false, the method returns DreamPoeBot.Loki.Game.LootResult.ShouldMove when movement is required.

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

The maximum time, in milliseconds, to wait for the interaction. Allow enough time for movement when shouldMove is true.

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

True to allow the game to equip the collected item automatically when the game permits it; false to collect it without requesting automatic equipment.

Returns: DreamPoeBot.Loki.Game.LootResult.None when the interaction was started; otherwise, a value describing why it could not be started.

ReactionWait

MethodLink ↗
public static Task<int> Coroutines.ReactionWait()

Calls ReactionWait on Coroutines without arguments and returns Task<int>. Open the return contract below before using the result.

Return type: Task<int>No current DPB page is linked for this built-in, external, generic or compatibility-only type.

Returns: An asynchronous operation. Await it before reading the result or continuing the workflow.

FinishCurrentActionTimeout

PropertyLink ↗
public static int Coroutines.FinishCurrentActionTimeout { get; set; }

Set the `FinishCurrentAction` Timeout value. Default value is 5000ms.

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

LatencyFactor

PropertyLink ↗
public static float Coroutines.LatencyFactor { get; set; }

Set the Factor we multiply the actual latency for, in LatencyWait().

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

ReactionMaxSleepDelay

PropertyLink ↗
public static int Coroutines.ReactionMaxSleepDelay { get; set; }

Set the Max sleep value for ReactionWait.

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

ReactionMinSleepDelay

PropertyLink ↗
public static int Coroutines.ReactionMinSleepDelay { get; set; }

Set the Min sleep value for ReactionWait.

Value type: intNo 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;

Inspect the shared interaction timing settings

var latencyFactor = Coroutines.LatencyFactor;
var minimumReactionMs = Coroutines.ReactionMinSleepDelay;
var maximumReactionMs = Coroutines.ReactionMaxSleepDelay;

These are shared timing settings, not proof of action completion. Read them without changing other components' defaults. For a small cancellable wait, follow the AcademyWorkshop stopwatch-and-Yield example. Coroutine helpers belong inside the bot-owned workflow, never Task.Run or async void Tick.

DPB1 0.3.29.56 · 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.