Skip to content

Cassettes

MasonGulu edited this page Nov 22, 2022 · 5 revisions

Cassettes are a simple tape format. They offer a linear data "stream" with only relative movements along the tape. To add length to a tape right click with it in your hand and some extra tape in your inventory.

Peripheral API

---@return boolean
hasTape()

---@param characters nil|integer
---@param async nil|boolean
---@return string
read(characters, async)

---@param string string
---@param async nil|boolean
---@return boolean
write(string, async)

---@param offset integer
---@param async nil|boolean
---@return integer
seek(offset, async)

---@param label string
---@return boolean
setLabel(label)

---@return boolean
clearLabel()

write, and seek return a boolean indicating success, if it's true the operation completed as expected, otherwise it was interrupted by the end of the tape being reached. Reading past the end of a tape will result in an error (not sure about this currently, kinda WIP).

Clone this wiki locally