public class EventQueue<T extends EventQueue> extends Event
Event.EventMode, Event.EventStatus
bank, bot, camera, chatbox, client, colorPicker, combat, configs, depositBox, dialogues, diaries, display, doorHandler, equipment, experienceTracker, favour, grandExchange, graphicObjects, groundItems, hintArrow, inventory, keyboard, logger, logoutTab, magic, map, menu, mouse, npcs, objects, players, prayer, projectiles, quests, settings, skills, store, tabs, trade, walking, widgets, worlds
Constructor and Description |
---|
EventQueue() |
Modifier and Type | Method and Description |
---|---|
void |
add(Event event)
Adds an event to the queue
|
T |
awaitState(int timeout,
java.util.concurrent.Callable<java.lang.Boolean> state,
java.util.concurrent.Callable<java.lang.Boolean>... breakConditions)
Adds a
WaitEvent to the queue, to await a specific state |
T |
awaitState(int timeout,
int sleepTime,
java.util.concurrent.Callable<java.lang.Boolean> state,
java.util.concurrent.Callable<java.lang.Boolean>... breakConditions)
Adds a
WaitEvent to the queue, to await a specific state |
T |
endQueueIf(java.util.concurrent.Callable<java.lang.Boolean> condition)
Ends the entire event queue if the condition is met, and fails the event
|
int |
execute()
This is the execution method.
|
addChild, exchangeContext, getChildren, getMode, getParent, getStatus, hasFailed, hasFinished, interrupt, isQueued, isWorking, onEnd, onStart, removeChild, setAsync, setBlocking, setFailed, setFinished, setParent
execute, getBank, getBot, getCamera, getChatbox, getClient, getColorPicker, getCombat, getConfigs, getDepositBox, getDialogues, getDiaries, getDisplay, getDoorHandler, getEquipment, getExperienceTracker, getFavour, getGrandExchange, getGraphicObjects, getGroundItems, getHintArrow, getInventory, getKeyboard, getLogoutTab, getMagic, getMap, getMenuAPI, getMouse, getNpcs, getObjects, getPlayers, getPrayer, getProjectiles, getQuests, getSettings, getSkills, getStore, getTabs, getTrade, getWalking, getWidgets, getWorlds, gRandom, gRandom, gRandom, initializeContext, log, log, myPlayer, myPosition, random, random, sleep, stripFormatting, warn
public void add(Event event)
event
- The event to add to the queuepublic T endQueueIf(java.util.concurrent.Callable<java.lang.Boolean> condition)
condition
- The condition to check forpublic T awaitState(int timeout, java.util.concurrent.Callable<java.lang.Boolean> state, java.util.concurrent.Callable<java.lang.Boolean>... breakConditions)
WaitEvent
to the queue, to await a specific statetimeout
- The max time to waitstate
- The state to wait forbreakConditions
- Optional break conditionspublic T awaitState(int timeout, int sleepTime, java.util.concurrent.Callable<java.lang.Boolean> state, java.util.concurrent.Callable<java.lang.Boolean>... breakConditions)
WaitEvent
to the queue, to await a specific statetimeout
- The max time to waitsleepTime
- The time to sleep between state checksstate
- The state to wait forbreakConditions
- Optional break conditionspublic int execute() throws java.lang.InterruptedException
Event
onLoop()
in OSBot v1.