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
Next revision Both sides next revision
api:computer [2018/09/10 00:27]
payonel
api:computer [2018/09/30 07:05]
payonel [Computer API]
Line 47: Line 47:
   The user will lose all access to this computer. When the last user is removed from the user list, the computer becomes accessible to all players. `userdel USER` is a command line option to invoke this method.   The user will lose all access to this computer. When the last user is removed from the user list, the computer becomes accessible to all players. `userdel USER` is a command line option to invoke this method.
 - `computer.pushSignal(name:​ string[, ...])`  ​ - `computer.pushSignal(name:​ string[, ...])`  ​
-  Pushes a new signal into the queue. Signals are processed in a FIFO order. The signal has to at least have a name. Arguments to pass along with it are optional. Note that the types supported as signal parameters are limited to the basic types nil, boolean, number ​and string, tables and functions are not supported.+  Pushes a new signal into the queue. Signals are processed in a FIFO order. The signal has to at least have a name. Arguments to pass along with it are optional. Note that the types supported as signal parameters are limited to the basic types nil, boolean, numberstring, ​and tables. Yes tables are supported (keep reading). Threads ​and functions are not supported
 +   
 +  Note that only tables of the supported types are supported. That is, tables must compose types supported, such as other strings and numbers, or even sub tables. But not of functions or threads.
 - `computer.pullSignal([timeout:​ number]): name, ...`  ​ - `computer.pullSignal([timeout:​ number]): name, ...`  ​
   Tries to pull a signal from the queue, waiting up to the specified amount of time before failing and returning `nil`. If no timeout is specified waits forever.  ​   Tries to pull a signal from the queue, waiting up to the specified amount of time before failing and returning `nil`. If no timeout is specified waits forever.  ​
Line 53: Line 55:
   Generally it is more convenient to use `event.pull` from the [[api:​event|event]] library. The return value is the very same, but the `event` library provides some more options.   Generally it is more convenient to use `event.pull` from the [[api:​event|event]] library. The return value is the very same, but the `event` library provides some more options.
 - `computer.beep([frequency:​string or number[, duration: number])` - `computer.beep([frequency:​string or number[, duration: number])`
 +
   Causes the computer to produce a beep sound at `frequency` Hz for `duration` seconds. This method is overloaded taking a single string parameter as a pattern of dots `.` and dashes `.` for short and long beeps respectively.   Causes the computer to produce a beep sound at `frequency` Hz for `duration` seconds. This method is overloaded taking a single string parameter as a pattern of dots `.` and dashes `.` for short and long beeps respectively.