DPB1Class · Bots, plugins and tasks

Coroutine

This class is used by IBots to create the loop of actions to make the bot work. Pls look at the NullBot exemple to see the exact implementation. This is a complex class that implement the async Task logic of the bot, you shouldent bother to much with it, just implement it like in NullBot and then execute the real bot logic in TaskManager.

Namespace: DreamPoeBot.Loki.Coroutine

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

Members and overloads

25 declared here

Coroutine

MethodLink ↗
public Coroutine.Coroutine(Func<Task<object>> taskProducer)

Creates a new Coroutine instance using the supplied arguments.

Parameters

taskProducer
Parameter type: Func<Task<object>>No current DPB page is linked for this built-in, external, generic or compatibility-only type.

Specifies task producer.

Coroutine

MethodLink ↗
public Coroutine.Coroutine(Func<Task> taskProducer)

Creates a new Coroutine instance using the supplied arguments.

Parameters

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

Specifies task producer.

Dispose

MethodLink ↗
public void Coroutine.Dispose()

Releases resources owned by this instance.

Return type: voidNo return value.

ExternalTask

MethodLink ↗
public static Task Coroutine.ExternalTask(Func<Task> taskProducer)

Calls ExternalTask on Coroutine with taskProducer and returns Task. Open the return contract below before using the result.

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

Parameters

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

Specifies task producer.

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

ExternalTask

MethodLink ↗
public static Task Coroutine.ExternalTask(Task externalTask)

Calls ExternalTask on Coroutine with externalTask and returns Task. Open the return contract below before using the result.

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

Parameters

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

Specifies external task.

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

ExternalTask

MethodLink ↗Deprecated
public static Task<bool> Coroutine.ExternalTask(Task externalTask, int millisecondsTimeout)

Calls ExternalTask on Coroutine with externalTask, millisecondsTimeout and returns Task<bool>. Open the return contract below before using the result.

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

Parameters

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

Specifies external task.

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

Specifies milliseconds timeout.

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

ExternalTask

MethodLink ↗Deprecated
public static Task<bool> Coroutine.ExternalTask(Task externalTask, TimeSpan timeout)

Calls ExternalTask on Coroutine with externalTask, timeout and returns Task<bool>. Open the return contract below before using the result.

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

Parameters

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

Specifies external task.

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

Specifies timeout.

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

ExternalTask

MethodLink ↗
public static Task<T> Coroutine.ExternalTask<T>(Func<Task<T>> taskProducer)

Calls ExternalTask on Coroutine with taskProducer and returns Task<T>. Open the return contract below before using the result.

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

Parameters

taskProducer
Parameter type: Func<Task<T>>No current DPB page is linked for this built-in, external, generic or compatibility-only type.

Specifies task producer.

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

ExternalTask

MethodLink ↗
public static Task<T> Coroutine.ExternalTask<T>(Task<T> externalTask)

Calls ExternalTask on Coroutine with externalTask and returns Task<T>. Open the return contract below before using the result.

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

Parameters

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

Specifies external task.

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

ExternalTask

MethodLink ↗Deprecated
public static Task<ExternalTaskWaitResult<T>> Coroutine.ExternalTask<T>(Task<T> externalTask, int millisecondsTimeout)

Calls ExternalTask on Coroutine with externalTask, millisecondsTimeout and returns Task<ExternalTaskWaitResult<T>>. Open the return contract below before using the result.

Return type: Task<ExternalTaskWaitResult<T>>
Explore ExternalTaskWaitResult<T> → members & methods

Describes the outcome of external task wait. Check the returned outcome before continuing with another action.

Parameters

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

Specifies external task.

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

Specifies milliseconds timeout.

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

ExternalTask

MethodLink ↗Deprecated
public static Task<ExternalTaskWaitResult<T>> Coroutine.ExternalTask<T>(Task<T> externalTask, TimeSpan timeout)

Calls ExternalTask on Coroutine with externalTask, timeout and returns Task<ExternalTaskWaitResult<T>>. Open the return contract below before using the result.

Return type: Task<ExternalTaskWaitResult<T>>
Explore ExternalTaskWaitResult<T> → members & methods

Describes the outcome of external task wait. Check the returned outcome before continuing with another action.

Parameters

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

Specifies external task.

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

Specifies timeout.

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

Resume

MethodLink ↗
public void Coroutine.Resume()

Calls Resume on Coroutine without arguments. This overload has no return value.

Return type: voidNo return value.

Sleep

MethodLink ↗
public static Task Coroutine.Sleep(int milliseconds)

Calls Sleep on Coroutine with milliseconds and returns Task. Open the return contract below before using the result.

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

Parameters

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

Specifies milliseconds.

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

Sleep

MethodLink ↗
public static Task Coroutine.Sleep(TimeSpan timeout)

Calls Sleep on Coroutine with timeout and returns Task. Open the return contract below before using the result.

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

Parameters

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

Specifies timeout.

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

ToString

MethodLink ↗
public override string Coroutine.ToString()

Returns a text representation of this value.

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

Returns: The string result.

Wait

MethodLink ↗
public static Task<bool> Coroutine.Wait(int maxWaitMs, Func<bool> condition)

Calls Wait on Coroutine with maxWaitMs, condition and returns Task<bool>. Open the return contract below before using the result.

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

Parameters

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

Specifies max wait ms.

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

Specifies condition.

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

Wait

MethodLink ↗
public static Task<bool> Coroutine.Wait(TimeSpan maxWaitTimeout, Func<bool> condition)

Calls Wait on Coroutine with maxWaitTimeout, condition and returns Task<bool>. Open the return contract below before using the result.

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

Parameters

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

Specifies max wait timeout.

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

Specifies condition.

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

Yield

MethodLink ↗
public static Task Coroutine.Yield()

Calls Yield on Coroutine without arguments and returns Task. Open the return contract below before using the result.

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.

Current

PropertyLink ↗
public static Coroutine Coroutine.Current { get; }

Reads current on Coroutine as Coroutine. Open the value type below for its members and accepted values.

Value type: Coroutine
Explore Coroutine → members & methods

This class is used by IBots to create the loop of actions to make the bot work. Pls look at the NullBot exemple to see the exact implementation. This is a complex class that implement the async Task logic of the bot, you shouldent bother to much with it, just implement it like in NullBot and then execute the real bot logic in TaskManager.

FaultingException

PropertyLink ↗
public CoroutineException Coroutine.FaultingException { get; private set; }

Reads or assigns faulting exception on Coroutine as CoroutineException. Open the value type below for its members and accepted values.

Value type: CoroutineException
Explore CoroutineException → members & methods

Provides coroutine exception data and the operations listed below. Related types link to the values this API consumes or returns.

IsDisposed

PropertyLink ↗
public bool Coroutine.IsDisposed { get; private set; }

Whether this coroutine is disposed.

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

IsFinished

PropertyLink ↗
public bool Coroutine.IsFinished { get; }

Whether this coroutine is finished.

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

Result

PropertyLink ↗
public object Coroutine.Result { get; private set; }

Reads or assigns result on Coroutine as object. The exact type and accessors are shown below.

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

Status

PropertyLink ↗
public CoroutineStatus Coroutine.Status { get; private set; }

Reads or assigns status on Coroutine as CoroutineStatus. Open the value type below for its members and accepted values.

Value type: CoroutineStatus
Explore CoroutineStatus → members & methods

Named values for coroutine status. Select a value when an API accepts or returns CoroutineStatus.

Ticks

PropertyLink ↗
public int Coroutine.Ticks { get; private set; }

Reads or assigns ticks on Coroutine as int. The exact type and accessors are shown below.

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

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.

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.