Skip to content

Mag Card Reader

BastouP411 edited this page Nov 2, 2021 · 13 revisions

This peripheral allows you to read and write data from magnetic cards.

The maximum size of data stored in a Mag Card can be set in the server config file.

Mag Card Reader

Crafting

Mag Card Reader

To be crafted, the Mag Card Reader requires:

  • 7 stone blocks
  • 1 redstone
  • 1 iron ingot

Shaped crafting recipe

Mag Card

To be crafted, the Mag Card requires:

  • 1 paper
  • 1 redstone
  • 1 iron ingot

Shapeless crafting recipe

Methods

The wraped peripheral will be named reader

reader.write(data: string, [label: string]): nil

Writes the string data on the next swiped mag card, and sets the card label to label.

reader.cancelWrite(): nil

Cancels the previoulsly scheduled mag card write.

reader.lightGreen(): nil

Sets the Mag Card Reader light to green.

reader.lightYellow(): nil

Sets the Mag Card Reader light to yellow.

reader.lightRed(): nil

Sets the Mag Card Reader light to red.

Events

mag_swipe

This event is fired when a Mag Card is swiped. This returns:

  1. side: string The side the Mag Card Reader is attached to.
  2. uuid: string The unique id of the Mag Card.
  3. data: string The data writen on the Mag Card.

mag_write

This event is fired when a Mag Card is written. This returns:

  1. side: string The side the Mag Card Reader is attached to.
  2. uuid: string The unique id of the Mag Card.
  3. newData: string The data written on the card.
  4. oldData: string The data previously written on the card.