Queues - GregHib/void GitHub Wiki

Queues are a way of executing some code after a set amount of time, unlike Timers a Queue only runs once. Some queues allow being paused by delays which means they are often used in interface interactions where delays/suspending is required.

There are 4 types of Queues:

  • Weak - Removed by interuptions and String queues
  • Normal - Skipped if interface is open
  • Strong - Closes interfaces and cancels Weak actions
  • Soft - Closes interfaces and paused by suspensions but not by other queues

[!NOTE] Read more details about queues and how they work on osrs-docs/queues.

Queues are easy enough to start and can be started on any Character, they only require a unique name and an initial delay in ticks:

Normal queues

Normal queues are for regular, do something in a few ticks or do something suspendable now

player.queue("welcome") {
        statement("Welcome to Lumbridge! To get more help, simply click on the Lumbridge Guide or one of the Tutors - these can be found by looking for the question mark icon on your minimap. If you find you are lost at any time, look for a signpost or use the Lumbridge Home Teleport spell.")
    }

Weak queues

Weak queues are often used for item-on-item interactions and other interruptable skills

player.weakQueue("cast_silver", 3) {
    inventory.replace("silver_bar", data.item)
    exp(Skill.Crafting, data.xp)
    make(item, amount - 1)
}

Strong queues

Strong queues are mainly used for non-interruptable events such as Hits, emotes and dying:

player.strongQueue("lumbridge_flag") {
    target.animate("lumbridge_flag")
    player.playAnimation("lumbridge_flag_raise")
}

Soft queues

Soft queues are used for things that have to happen and nothing short of death will stop them.

player.softQueue("remove_ammo") {
    player.equipment.remove(ammo, required)
}