CC and Redpower APIs

Revision as of 01:30, 25 October 2012 by 98.67.97.100 (talk) (→‎Usage in coding)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

ComputerCraft can interact with the Bundled Cables from Redpower. This gives the ability to use Redpowers advanced cables without the need of Redpower Logic. ComputerCrafts computers can trigger, set and read any of the coloured cables in the bundled cables. Multiple connections to one computer are possible allowing for huge machines to be controlled by just one computer.

How to set-up

A Console or Turtle will connect to any Redpower Bundled Cables or Jacketed Bundled Cable. The cables will show they are connected by touching the Console or Turtle.

Usage in coding

A program needs to be coded for these cables to do anything at all. Programming takes place in the Console with Lua . ComputerCraft uses Lua as its programming language. Redpower Bundled Cables are controlled by the use of APIs. Below are the most common APIs you will probably use in the beginning. Below this section you can find the more advanced APIs. For even more information, check out the Redstone and Colors section of this and the ComputerCraft wiki .

The APIs which you will need in the beginning to control Redpower are:

rs.setBundledOutput(side, color)

Sets a color to the bundled cable on a specific side. Color can be either the color name or the color decimal. PRO TIP: Sum different color decimals to turn on more colors at one. This means that e.g. white = 1 and yellow = 16 so to turn on white and yellow at the same time use 17 as the color decimal. This works for all colors. To turn off everything at once use 0 as the color decimal.

rs.testBundledInput(side, color)

Tests if the specified color is on or not. It will return true or false based on the state of the color. Can of course be set to a variable. Works also the same as above in the use of summed color numbers.

There are many more APIs to control Redpower. However, these APIs are described in detail on the Redstone and Colors section of this and the ComputerCraft wiki . Feel free to try them out!

Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Need wiki hosting?

Do you need a wiki for your Minecraft mod/gaming wiki? We'll host it for free! Contact us.

Other wikis

Indie-game wikis
Powered by Indie Wikis