Posted 03 August 2015 - 10:16 AM
Redstone I/O is a peripheral for ComputerCraft that is meant to be connected to a LAN cable and can be used for various things like:
- reading a redstone signal (with strength)
- sending a redstone signal (with strength)
- throwing an Lua event when detects any change in redstone signal
Redstone signal can be placed only from side which is indicated by red cross.
Recipe
Recipe is the same as in older version made by Nuchaz.
Redstone block in the middle and smooth stones on the outside.
Code
redio = peripheral.wrap("io_1")
redio.setOutput(true) -- enables a redstone signal with strength 15
redio.setOutput(false) -- disables the redstone signal
redio.setOutput(10) -- outputs a redstone signal of 10
redio.setOutput(0) -- disables the redstone signal
redio.getInput() -- returns true/false if there is a redstone signal or not (any strength)
redio.getAnalogInput() -- returns an integer from 0-15 of the redstone strength
event, state, strength, id = os.pullEvent("redstone") -- pulls an event with 4 return values
-- event returns: redstone
-- state returns true/false if there is redstone
-- strength returns an integer from 0-15 indicating the redstone strength
-- id returns the id of the peripheral the threw the event
How to install it?
Simply put the .jar file to your mods folder.
Download
V1.01 [MC 1.7.10][CC 1.73]: Click!
V1.0 [MC 1.7.10][CC 1.73]: Click!
Source code soon…
Changelog
- V1.0: Rebuild the original code and ported to MC 1.7.10.
- V1.01: Changed methods and event name for more matching Redstone API.
Thanks for NuchaZ
I put here a link to the old version if someone want the original source code. :)/>
Click!
Now this block is a part of FirePeripherals pack. See here: http://www.computercraft.info/forums2/index.php?/topic/24542-mc-1710cc-173-fireperipherals-v10/
Edited on 01 September 2015 - 12:06 AM