Event documentation

Introductions

The 'event' API grants you full programmatic access to the running computer's event queues.

The event api exists in the global space as "event" or "_G.event"

Before we start, it's recommended to clear event queues at the start of an event using process, to prevent old events from causing problems

Categories?

each computer contains multiple categories, and every event is registered to one of them based off its relevance to the category. Below is a list of all categories

  • Unlabeled
  • User
  • System
  • Network
  • Peripheral
  • Compatibility

when a queue is retrieved by the API, all events that are returned are also removed from their home que, meaning that a event cant be read from the computer twice. its also relevant that each event is capped at 75 events capacity, and if needed old events will be forgotten to make room

Lookup table

queueEvent(Category, event, args...) Queues an event with the given specifications
getQueue(Category, filter = nil) Pulls every event eligible out of the queue
getFirst(Category, filter = nil) Pulls the first eligible item from the queue
clear(Category) Clears the event queue
clear() Clears all event queues

Functions in detail

queueEvent(Category, event, args...)

Queues an event with the given specifications

Parameters: Category[String, non-case-specific], Event[String], Args[Any...] Returns: None

getQueue(Category, filter = nil)

Pulls every event of the type specified by filter, or every event is no filter is provided

Because events are represented as lists, this function returns a list of lists that contain event data

Parameters: Category[String, non-case-specific], Filter[String] default value nil Returns: [[String, args...]...]

getFirst(Category, filter = nil)

Pulls the first event from the queue that fits the filter, or if there's no filter just the first event, and if there's no event that it returns nil

Parameters: Category[String, non-case-specific], Filter[String] default value nil Returns: [String, args...] or nil

clear(Category)

Clears the given event queue

Parameters: Category[String, non-case-specific] Returns: None

clear()

Completely wipes every event queue

Parameters: None Returns: None