Description
This is the component provided by the Tape Drive block.
Component name: tape_drive.
This is the component provided by the Tape Drive block.
Component name: tape_drive.
isEnd():boolean Returns true if the tape drive is empty or the inserted tape has reached its end
setLabel(label:string):string Sets the label of the tape. Returns the new label, or nil if there is no tape inserted
write(data:number or string) Writes the specified data to the tape if there is one inserted
getSize():number Returns the size of the tape, in bytes
setVolume(volume:number) Sets the volume of the tape drive. Needs to be beween 0 and 1
stop():boolean Make the Tape Drive stop playing the tape. Returns true on success
isReady():boolean Returns true if there is a tape inserted
seek(length:number):number Seeks the specified amount of bytes on the tape. Negative values for rewinding. Returns the amount of bytes sought, or nil if there is no tape inserted
read([length:number]):string Reads and returns the specified amount of bytes or a single byte from the tape. Returns nil if there is no tape inserted
getLabel():string Returns the current label of the tape, or nil if there is no tape inserted
getPosition():number Returns the position of the tape, in bytes
play():boolean Make the Tape Drive start playing the tape. Returns true on success
getState():string Returns the current state of the tape drive
setSpeed(speed:number):boolean Sets the speed of the tape drive. Needs to be beween 0.25 and 2. Returns true on success