Computer: Difference between revisions
No edit summary |
No edit summary |
||
| Line 51: | Line 51: | ||
|} | |} | ||
== Machine | == Machine Events == | ||
content | content | ||
{{Navbox content}} | {{Navbox content}} | ||
Revision as of 20:20, 31 July 2026

Computers come in 5 different tiers, namely Wood, Iron, Diamond, Netherite and finally Creative, though that tier is not available in survival. These tiers only differ in the amount of inventory slots and computer speed. In the future, tiers will also impact the amount of usable memory.

The computer is what provides most of the core Lua components and is where you place item-components, such as Hard Disk Drives or Floppy Disks. You can start the computer by pressing the power button shown in the gui-image. Similarly, to forcefully stop a computer you can press the same button. Both actions can also be performed by shift-right-clicking the computer with an empty hand, which then either starts or stops it, depending on the current state.
The lit indicator on the front of the computer indicates the run-state. A computer can be in one of the following states:
| Color | State |
|---|---|
| Red - On | Stopped |
| Red - Blinking | Crashed |
| Green - On | Running |
| Green - Blinking | Currently unimplemented, but will indicate Working in the future |
Provided Component
The computer block provides access to the computer component.
This component includes the following properties:
| Name | Type | Read/Write | Description |
|---|---|---|---|
uefi |
UefiUD |
READ | Provides access to the UEFI located on the Mainboard installed in the current computer's inventory. |
nvram |
NvramUD |
READ | Provides access to the NVRAM located on the Mainboard installed in the current computer's inventory. This can be used to store data that persists across reboots and does not require a filesystem. See NVRAM for more information. |
tpm |
not yet implemented | READ | In the future will provide access to the Trusted Platform Module. |
| Name | Type | Description |
|---|---|---|
:beep(freq:number, duration:number) |
void |
Plays a hearable sound with frequency freq and duration duration, hearable near the computer block.
|
:getMachineEvent() |
any[] |
Dequeues and returns the next item in the computer's event queue. Example return values are {"keyPressed", "\n", 257, 28, 0} when pressing the ENTER key in a gui or {nil} when there is no queued event. All possible events are listed in section #Machine Events.
|
:beep(freq:number, duration:number) |
void |
Plays a hearable sound with frequency freq and duration duration, hearable near the computer block.
|
Machine Events
content