Signals are messages sent to a computer from some external source and can be used for many purposes. They always have at least a name, and may have any number of (simple) parameters. Note that computers may also queue signals on themselves.
Signals can be consumed using computer.pullSignal() or its convenience wrapper, event.pull().
The following lists all signals triggered by components and the built-in libraries. They are listed in the following format: name(arg: type, ...)
, meaning you would pull them like local name, arg, ... = event.pull()
. For example, to pull a modem message:
local event = require("event") local _, localNetworkCard, remoteAddress, port, distance, payload = event.pull("modem_message") print("Received data '" .. tostring(payload) .. "' from address " .. remoteAddress .. " on network card " .. localNetworkCard .. " on port " .. port .. ".") if distance > 0 then print("Message was sent from " .. distance .. " blocks away.") end
component_added(address: string, componentType: string)
componentType
is the type of the component (e.g. redstone
or gpu
).component_available
instead, which is queued by the component library when a primary component was added / the primary component changed.component_removed(address: string, componentType: string)
componentType
is the type of the component (e.g. redstone
or gpu
).component_unavailable
instead, which is queued by the component library when a primary component is removed.component_available(componentType: string)
component_added
, to avoid conflicts with the component library.component_unavailable(componentType: string)
component_removed
, to avoid conflicts with the component library.term_available()
term_unavailable()
touch(screenAddress: string, x: number, y: number, button: number, playerName: string)
term.setCursor
or gpu.set
, for example). The player name is the user name of the player that triggered the event.drag(screenAddress: string, x: number, y: number, button: number, playerName: string)
touch
signal. The only difference is the implicit meaning: when this signal is fired, it “belongs” to a touch
signal that was fired earlier. This can only be triggered by dragging in the GUI.drop(screenAddress: string, x: number, y: number, button: number, playerName: string)
touch
signal. Despite the name, it does not necessarily follow a drag
signal.scroll(screenAddress: string, x: number, y: number, direction: number, playerName: string)
touch
signal, in “letters”. The direction
indicates which way to scroll, where a positive value usually means “up”, whereas a negative value means “down”. Note that this may differ based on the client's operating system and/or driver configuration. The player name is the user name of the player that triggered the event.touch
.walk(screenAddress: string, x: number, y: number[, playerName: string])
touch
.key_down(keyboardAddress: string, char: number, code: number, playerName: string)
key_up(keyboardAddress: string, char: number, code: number, playerName: string)
clipboard(keyboardAddress: string, value: string, playerName: string)
redstone_changed(address: string, side: number, oldValue: number, newValue: number[, color: number])
motion(address:string, relativeX:number, relativeY:number, relativeZ:number[, entityName:string])
modem_message(receiverAddress: string, senderAddress: string, port: number, distance: number, ...)
modem.broadcast()
as the message's payload.inventory_changed(slot: number)
from Stargate Tech 2.
bus_message(protocolId: number, senderAddress: number, targetAddress: number, data: table, metadata: table)
protocolId
is the protocol version that was used.senderAddress
is the address of the device sending the message.targetAddress
is the address of the device that the messages was intended for (-1 for network broadcasts).data
is a table of the data that was sent.metadata
is a table of data that are unique to the device that send the address.from Redstone in motion / remain in motion.
Important: This component has moved to the OpenComponents addon.
Contents of OpenComponents have already been added into OpenComputers.
carriage_moved(success: boolean[, reason:string[, x:number, y: number, z: number]])
success
parameter indicates whether the move or simulation was successful, i.e. whether the carriage could be moved. If the move failed, reason
is the error message. Depending on the error message, (x
, y
, z
) is the world coordinate of the block that caused the move to fail.Components | 3D Printer - Abstract Bus - Access Point - Chunkloader - Computer - Crafting - Data Card - Database - Debug - Drone - Drive - EEPROM - Experience - Filesystem - Generator - Geolyzer - GPU - Hologram - Internet - Inventory Controller - Leash - Microcontroller - Modem - Motion Sensor - Navigation - Net Splitter - Piston - Redstone - Redstone in Motion - Robot - Screen - Sign - Tank Controller - Tractor Beam - Transposer - Tunnel - World Sensor | |
---|---|---|
Others | Component Access - Signals | |
Cross-Mod Integration | Applied Energistics |