Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
component:signals [2017/11/13 01:20]
jv110 A few typos under screen_resized, add sneak-activating note under touch
component:signals [2023/12/27 03:29] (current)
hfsr [Contents]
Line 3: Line 3:
 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 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 [[api:​computer|computer.pullSignal()]] or its preferred ​wrapper, [[api:​event|event.pull()]]. The latter is preferred because unwanted signals and the requested signal itself are also distributed as events, which is used by a couple of system functions, such as primary component tracking.+Signals can be consumed using [[api:​computer|computer.pullSignal()]] or its convenience ​wrapper, [[api:​event|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: 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:
Line 76: Line 76:
 ---------------------------- ----------------------------
  
-- `redstone_changed(address:​ string, side: number, oldValue: number, newValue: number)` ​  +- `redstone_changed(address:​ string, side: number, oldValue: number, newValue: number[, color: number])`   
-  This signal is queued by [[component:​redstone|redstone components]] when an incoming signal changes. The address is either that of the [[block:​redstone_io|Redstone I/O block]] or that of the computer with the [[item:​redstone_card|redstone card]] ​that generated ​the signal. The side is one of the [[api:​sides|sides]] constants and indicates on which side the signal changed. This is relative to the container of the component, so for computers and robots this depends on which way they are facing. For Redstone I/O blocks this is always the absolute side. +  This signal is queued by [[component:​redstone|redstone components]] when an incoming signal changes. The address is of the [[block:​redstone_io|Redstone I/O block]] or that of the [[item:​redstone_card|redstone card]] ​installed in the machine where the redstone ​signal ​was detected. The side is one of the [[api:​sides|sides]] constants and indicates on which side the signal changed. This is relative to the container of the component, so for computers and robots this depends on which way they are facing. For Redstone I/O blocks this is always the absolute side. The color is only included with bundled inputs, referring to which color of input changed. 
  
-Note: There is no indication of the bundle/​channel number from T2 cards or the I/O Block. [[https://​github.com/​MightyPirates/​OpenComputers/​issues/​1385|GH issue]] 
  
 Motion Sensor Block Motion Sensor Block
Line 104: Line 104:
 Abstract Bus Card Abstract Bus Card
 ----------------- -----------------
 +
 +from [Stargate Tech 2](http://​stargatetech.theender.net/​miscellaneous/​home.html).
  
 - `bus_message(protocolId:​ number, senderAddress:​ number, targetAddress:​ number, data: table, metadata: table)` ​ - `bus_message(protocolId:​ number, senderAddress:​ number, targetAddress:​ number, data: table, metadata: table)` ​
Line 116: Line 118:
 -------- --------
  
-**Important**:​ This component has moved to the OpenComponents addon.+from [Redstone in motion / remain in motion](https://​www.curseforge.com/​minecraft/​mc-mods/​remain-in-motion). 
 + 
 +<del>**Important**:​ This component has moved to the OpenComponents addon.</​del> ​  
 +Contents of OpenComponents have already been added into OpenComputers.
  
 - `carriage_moved(success:​ boolean[, reason:​string[,​ x:number, y: number, z: number]])`  ​ - `carriage_moved(success:​ boolean[, reason:​string[,​ x:number, y: number, z: number]])`  ​
Line 123: Line 128:
 Contents Contents
 ----------- -----------
-{{page>api:​contents&​noheader&​noeditbutton&​nouser&​nofooter}}+{{page>component:​contents&​noheader&​noeditbutton&​nouser&​nofooter}}