IO documentation

Introductions

Currently only allows computers to interface with peripherals, however functionality will be extended to networking as well

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

Lookup table

getPeripherals() Gets a list of all attached peripheral IDs
getPeripheralType(id) Gets a text description of a peripheral
wrapPeripheral(id) Creates an interface to interact with a peripheral
callFunction(id, function, arguments...) calls a specific function from a peripheral

Functions in detail

getPeripherals()

Return a list of all attached peripherals' id

Parameters: None Returns: [string]

getPeripheralType(id)

Gets a text description of a peripheral based on its id

Parameters: ID[String] Returns: String

wrapPeripheral(id)

Wraps the peripheral into ann API like table that contains its functions in a lua accessible object

Parameters: ID[String] Returns: Table

callFunction(id, function, arguments...)

Attempts to call a specific function from a peripheral, passing the arguments following the function parameter

Parameters: ID[String], Function[String], Arguments[Any]... Returns: Any