DPB2Class · 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 CoroutineView DPB1 version →

Members and overloads

25 results

Coroutine

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

Creates a new Coroutine instance using the supplied arguments.

taskProducerFunc<Task<object>>
Specifies task producer.

Coroutine

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

Creates a new Coroutine instance using the supplied arguments.

taskProducerFunc<Task>
Specifies task producer.

Dispose

MethodLink ↗
public void Coroutine.Dispose()

Releases resources owned by this instance.

ExternalTask

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

Executes the external task operation with the supplied arguments.

taskProducerFunc<Task>
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)

Executes the external task operation with the supplied arguments.

externalTaskTask
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)

Executes the external task operation with the supplied arguments.

externalTaskTask
Specifies external task.
millisecondsTimeoutint
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)

Executes the external task operation with the supplied arguments.

externalTaskTask
Specifies external task.
timeoutTimeSpan
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)

Executes the external task operation with the supplied arguments.

taskProducerFunc<Task<T>>
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)

Executes the external task operation with the supplied arguments.

externalTaskTask<T>
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)

Executes the external task operation with the supplied arguments.

externalTaskTask<T>
Specifies external task.
millisecondsTimeoutint
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)

Executes the external task operation with the supplied arguments.

externalTaskTask<T>
Specifies external task.
timeoutTimeSpan
Specifies timeout.

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

Resume

MethodLink ↗
public void Coroutine.Resume()

Executes the resume operation.

Sleep

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

Executes the sleep operation with the supplied arguments.

millisecondsint
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)

Executes the sleep operation with the supplied arguments.

timeoutTimeSpan
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.

Returns: The string result.

Wait

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

Executes the wait operation with the supplied arguments.

maxWaitMsint
Specifies max wait ms.
conditionFunc<bool>
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)

Executes the wait operation with the supplied arguments.

maxWaitTimeoutTimeSpan
Specifies max wait timeout.
conditionFunc<bool>
Specifies condition.

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

Yield

MethodLink ↗
public static Task Coroutine.Yield()

Executes the yield operation.

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

Current

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

Gets current for Coroutine.

FaultingException

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

Gets faulting exception for Coroutine.

IsDisposed

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

Whether this coroutine is disposed.

IsFinished

PropertyLink ↗
public bool Coroutine.IsFinished { get; }

Whether this coroutine is finished.

Result

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

Gets result for Coroutine.

Status

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

Gets status for Coroutine.

Ticks

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

Gets ticks for Coroutine.

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