|This article is in need of a clean-up. You can help out The Tekkit Classic Wiki by re-organizing parts of the article, checking grammar and spelling, and doing other helpful things to correct the article.|
API's included in Tekkit 3.1.2 (Under Construction)
Wikipedia defines an API as "An application programming interface (API) is a specification intended to be used as an interface by software components to communicate with each other. An API may include specifications for routines, data structures, object classes, and variables." in Tekkit the API's make it possible to tie your programs into your World and write better programs.
The Bit API is for manipulating numbers using bitwise binary operations in Computer Craft.
|Method name||Description||Return type|
|bit.tobits(n)||Converts a number to an array (numerically-indexed table) containing the corresponding binary bit values||table the bits making up the value n, with entries up to the most-significant 1 bit in n|
|bit.blshift(n, bits)||Shifts a number left by a specified number of bits||int the value of n shifted left by bits bits, which is equivalent to n×2bits|
|bit.brshift(n, bits)||Shifts a number right by a specified number of bits||int the value of n shifted right by bits bits, which is equivalent to ⌊n÷2bits⌋|
|bit.bxor(m, n)||Computes the bitwise exclusive OR of two numbers||int the value of m XOR n|
|bit.bor(m, n)||Computes the bitwise inclusive OR of two numbers||int the value of m OR n|
|bit.band(m, n)||Computes the bitwise AND of two numbers||int the value of m AND n|
|bit.bnot(n)||Computes the bitwise NOT of a number||int the value of NOT n|
|bit.bnot(bit_tbl)||Converts an array (numerically-indexed table) of 0 and 1 values representing a number in binary into that number||int the number resulting from the conversion of bit_tbl from binary|
Control and read the state of redstone adjacent to the computer. Includes bundled cables.
When using Bundled Cables with a Computer, be sure that the cable comes straight out from the side, not across the side, that you wish to connect to on the computer. The usage of bundled cables is as follows:
-- Usage of bundled cables with computers. Uploaded by CrashDive 12 November, 2015. cSide = "back" -- Change this to the side of the bundled cable. rs.setBundledOutput(cSide, colors.white) -- Toggles the white cable on/off and turns off all other colors. rs.setBundledOutput(cSide, colors.combine(colors.orange, colors,brown)) -- Toggles orange and brown cables and turns off all other cables. rs.setBundledOutput(cSide, colors.combine(rs.getBundledOutput(cSide), colors.black) -- Toggles the black cable on and does not change the state of any other cables. rs.setBundledOutput(cSide, colors.subtract(rs.getBundledOutput(cSide), colors.black) -- Toggles the black cable on and does not chane the state of any other cable. rs.setBundledOutput(cSide, 0) -- Turns off all cables.