Actions

RuneScript/Queues: Difference between revisions

From RuneWiki

(Created page with " === Commands === queue getqueue clearqueue === Queue Types === ==== Normal ==== Requires protected access before it can execute ==== Weak ==== Requires protected access before it can execute. Cleared when closing modals. Moving or interacting with something new closes modals and inherently clears weak queues ==== Strong ==== Requires protected access before it can execute. Closes modals before executing and if the queue contains a strong queue at all (modals tec...")
 
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:


=== Commands ===
=== Commands ===
queue
getqueue(queue $script)(int);


getqueue
clearqueue(queue $script);


clearqueue
 
queue(queue $script, int $delay, int $arg);
 
weakqueue(queue $script, int $delay, int $arg);
 
strongqueue(queue $script, int $delay, int $arg);
 
softqueue(queue $script, int $delay, int $arg);
 
longqueue(queue $script, int $delay, int $arg, int $on_logout);
 
There are asterisk versions - which mean it’s a dynamic command and may supply an arbitrary number of arguments.
 
queue*(queue $script, int $delay, …args);
 
weakqueue*(queue $script, int $delay, …args);
 
strongqueue*(queue $script, int $delay, …args);
 
softqueue*(queue $script, int $delay, …args);


=== Queue Types ===
=== Queue Types ===


==== Normal ====
==== Normal ====
Requires protected access before it can execute
Requires protected access before it can execute.


==== Weak ====
==== Weak ====
Line 27: Line 46:
Not granted protected access so it can always execute.
Not granted protected access so it can always execute.


This concept comes from soft timers, which share the same behavior
This concept comes from soft timers, which share the same behavior. No protected access means they typically cannot edit anything on the player - unless the command or type is marked as not requiring protection
 
==== Long ====
These scripts act like normal queues, but on logout may:
 
^accelerate - ignore any remaining delay and attempt to execute
 
^discard - do nothing (cleared)
 
These are useful to ensure something always happens if you want it to.

Latest revision as of 16:36, 16 February 2024

Commands

getqueue(queue $script)(int);

clearqueue(queue $script);


queue(queue $script, int $delay, int $arg);

weakqueue(queue $script, int $delay, int $arg);

strongqueue(queue $script, int $delay, int $arg);

softqueue(queue $script, int $delay, int $arg);

longqueue(queue $script, int $delay, int $arg, int $on_logout);

There are asterisk versions - which mean it’s a dynamic command and may supply an arbitrary number of arguments.

queue*(queue $script, int $delay, …args);

weakqueue*(queue $script, int $delay, …args);

strongqueue*(queue $script, int $delay, …args);

softqueue*(queue $script, int $delay, …args);

Queue Types

Normal

Requires protected access before it can execute.

Weak

Requires protected access before it can execute.

Cleared when closing modals. Moving or interacting with something new closes modals and inherently clears weak queues

Strong

Requires protected access before it can execute.

Closes modals before executing and if the queue contains a strong queue at all (modals technically close twice)

Modals are aggressively closed because they block protected access

Soft

Not granted protected access so it can always execute.

This concept comes from soft timers, which share the same behavior. No protected access means they typically cannot edit anything on the player - unless the command or type is marked as not requiring protection

Long

These scripts act like normal queues, but on logout may:

^accelerate - ignore any remaining delay and attempt to execute

^discard - do nothing (cleared)

These are useful to ensure something always happens if you want it to.