Posted 24 April 2012 - 07:54 PM
Wolf Peripheral Control Index 1.0.0
Welcome to WPCI, my API for ComputerCraft. It was originally written specifically to be included in my WolfOS, however I decided to release it. It is designed to add more functions that allow more control over peripherals, specifically Monitors.
So far, there are 21 functions:
Mediafire download:
WPCI 1.0.0 - http://www.mediafire...byxtuhrr90ae65h
Welcome to WPCI, my API for ComputerCraft. It was originally written specifically to be included in my WolfOS, however I decided to release it. It is designed to add more functions that allow more control over peripherals, specifically Monitors.
So far, there are 21 functions:
All [side] parameters must be lower case strings. All [handle] parameters must be wrapped peripherals, and defaults to term. All [rate] parameters must be positive, and defaults to 10. All [align] parameters must be lower case strings (left, centre or right), and defaults to current cursor position. All [direction] parameters must be lower case strings (up or down/left or right) and defaults to up/left. All [repeats] parameters must be positive numbers, and defaults to 1.isPeripheralPresent(side) - Returns true if a peripheral is present on the given side.
isDrivePresent(side) - Returns true if a disk drive is present on the given side.
isMonitorPresent(side) - Returns true if a monitor is present on the given side.
isModemPresent(side) - Returns true if a modem is present on the given side.
isComputerPresent(side) - Returns true if a computer is present on the given side.
isTurtlePresent(side) - Returns true if a turtle is present on the given side.
getPeripheralType(side) - Returns the type of the peripheral on the given side.
getAllPeripherals() - Returns two tables, the first being a list of the sides containing a peripheral, and the second containing a list of the peripheral type on that side.
assignHandle(side) - Assigns a handle to a variable of the peripheral contained on the given side. Returns nil if no peripheral is present.
clearScreen(handle) - Clears the screen of the given monitor.
clearLine(handle) - Clears the current line of the given monitor.
resetCursorPos(handle) - Moves the cursor of the given monitor back to the top left corner.
writeToScreen(text, align, handle) - Writes text to the screen of the given monitor with the specified alignment.
printToScreen(text, align, handle) - Same as write, but moves cursor to the beginning of a new line afterwards.
slowWriteToScreen(text, align, handle, rate) - Animated version of write. Rate is speed of animation.
slowPrintToScreen(text, align, handle, rate) - Animated version of print.
writeVerticalToScreen(text, handle) - Writes text in a vertical column to the screen of the given monitor.
slowWriteVerticalToScreen(text, handle, rate) - Animated version of vertical write.
scrollTextHorizontal(text, repeats, handle, direction, rate) - Scrolls text horizontally across screen in the given direction. Repeats is amount of times text is scrolled.
scrollTextVertical(text, repeats, handle, direction, rate) - Scrolls text in a vertical column on screen in the given direction.
flashText(text, repeats, handle, direction, rate) - Flashes text in fixed position. Rate is how fast text flashes, repeats is number of flashes, and direction in this case is either horizontal or vertical.
Mediafire download:
WPCI 1.0.0 - http://www.mediafire...byxtuhrr90ae65h