SHOW:
|
|
- or go back to the newest paste.
| 1 | - | --[[ |
| 1 | + | |
| 2 | - | Output API, By SuPeRMiNoR2 (With help from immibis) |
| 2 | + | |
| 3 | - | LICENSE |
| 3 | + | |
| 4 | - | http://creativecommons.org/licenses/by/3.0/deed.en_US |
| 4 | + | |
| 5 | - | This license only applies to THIS PROGRAM, not to minecraft, computercraft, or redpower |
| 5 | + | |
| 6 | - | You may edit, and/or use this program/API in your own programs/APIS. You do not have to leave this license comment in, but you can if you want :) |
| 6 | + | |
| 7 | - | ]]-- |
| 7 | + | |
| 8 | color = colors[color] or colours[color] | |
| 9 | - | --Version: 1.5 |
| 9 | + | |
| 10 | error("Invalid colour", 2)
| |
| 11 | end | |
| 12 | local func = (state and colors.combine or colors.subtract) | |
| 13 | rs.setBundledOutput(side, func(rs.getBundledOutput(side), color)) | |
| 14 | end | |
| 15 | ||
| 16 | function get(color) | |
| 17 | color = colors[color] or colours[color] | |
| 18 | return rs.testBundledInput(side, color) | |
| 19 | end | |
| 20 | ||
| 21 | function toggle(color) | |
| 22 | cstate = get(color) | |
| 23 | if cstate == false then | |
| 24 | set(color, true) | |
| 25 | end | |
| 26 | if cstate == true then | |
| 27 | set(color, false) | |
| 28 | end | |
| 29 | end | |
| 30 | ||
| 31 | function setside(s) | |
| 32 | side = s | |
| 33 | end |