Disk
A programmable object capable of storing complex data. Be aware, while disks can store userdata & function values, it cannot save them.
It is a craftable and spawnable non-flammable solid.
Here is a list of possible sizes that reach the maximum malleability (400) that have integer components: 1x400x1, 1x200x2, 1x100x4, 1x80x5, 1x50x8, 1x40x10, 1x25x16, 1x20x20, 2x100x2, 2x50x4, 2x40x5, 2x25x8, 2x20x10, 4x25x4, 4x20x5, 4x10x10, 5x16x5, 5x10x8, 10x8x5, 16x5x5, 20x10x2, 20x5x4
At its default size (0.50x4x4) it has a durability of 1, at its maximum size it has a durability of 4.
By default, its colour is #da8541.
It requires 3 Copper
, 10 Quartz
, and 4 Silicon
to be crafted.
Methods
Clear()
Clears all the contents of the disk.
ClearDisk()
Compress()
Decompress()
Read(key) → value
Reads the specified key from the disk and returns the value.
The key parameter can be anything.
The value return can be anything.
ReadAll() → content
Reads the entire content of the disk and outputs it as a dictionary.
The content return is a dictionary with keys that are any
s and values that are any
s.
Write(key, value)
Write the specified key with the specified value to the disk.
The parameters for Write
are as follows:
- The key parameter can be anything.
- The value parameter can be anything.
WriteAll()
ReadEntireDisk() → content
This method is deprecated. Superseded by Disk:ReadAll()
.
The content return is a dictionary with keys that are any
s and values that are any
s.
Events
Loop(deltaTime)
Fires when the object is updated by the game loop.
The deltaTime parameter is the 'time' since the last tick, it does not represent the actual time since the last tick was occurred, rather just how often a game tick should be fired (it will always be precisely 1
). It is a number
.