This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
JohnSmith41Junk's profile picture

segdisplay API - Easily utilize single-segment displays with ComputerCraft!

Started by JohnSmith41Junk, 16 January 2016 - 07:39 AM
JohnSmith41Junk #1
Posted 16 January 2016 - 08:39 AM
The ProjectRed mod for Minecraft adds many things that the old RedPower mod added, such as bundled cables and circuits. The one that this API focuses on is the segmented display.

A segment display is a block that has a number made up of segments, and each segment is lit with a redstone signal over a colored cable on a bundle connected to the display. It is most commonly used for displaying numbers, although I plan to add support for letters as well.

Normally, setting up segmented displays with ComputerCraft is difficult, as you need to set the colors individually, or use a bundled cable code. This API aims to make it easy to use segmented displays in your programs.

Usage:

os.loadAPI("segdisplay")
segdisplay.display("side", "number")
Side is the side that the display's bundled cable is connected to, and number is 0-9.

Example:

os.loadAPI("segdisplay")
segdisplay.display("bottom", "2")

Current issues:
- Only works with a single segment display

Download:
Type this into your computer:

pastebin get dRSbGEPF segdisplay
Edited on 18 January 2016 - 12:33 AM
Bomb Bloke #2
Posted 16 January 2016 - 09:38 AM
I'm assuming I'm not the only one who was wondering what a "segmented display" is, so here's a link explaining them. They're sorta like the displays older digital calculators and so on use.
JohnSmith41Junk #3
Posted 16 January 2016 - 10:04 AM
I added a bit of info to the OP