Pigpork 0 Posted July 13, 2016 Share Posted July 13, 2016 Hi, I'm new and I need some help on opencomputers. Can anyone post or make a tutorial on redstone cards? Because I cant find any tutorials on redstone cards which aren't outdated Quote Link to post Share on other sites
0 Solution Ch1ck3nL1v3r 2 Posted July 13, 2016 Solution Share Posted July 13, 2016 Hello! In order to use a redstone card the first thing you need to do is require the component library and set up a variable for the redstone card, using the following code: local component = require("component") local redstone = component.redstone You will then have access to the redstone component, documentation for which is here: http://ocdoc.cil.li/component:redstone You may also want to require the sides API, the code to do so looks like this: local sides = require("sides") This will give you access to the sides API, which lets you say "sides.top" or "sides.bottom" when using the redstone card, something that is very handy. Documentation for this API is here: http://ocdoc.cil.li/api:sides Here is some example code using the redstone component and the sides API to help you get started local component = require("component") --require component in order to use the component API local sides = require("sides") local redstone = component.redstone -- create the variable "redstone" (which is shorter than typing out component.redstone) redstone.setOutput(sides.bottom, 15) -- Set the redstone output on the bottom of the computer to 15, the maximum for vanilla redstone local strength = redstone.getInput(sides.top) -- Set the new local variable "strength" to the strength of the redstone signal on top of the computer case print(strength) Hope you found this post helpful! Quote Link to post Share on other sites
0 Pigpork 0 Posted July 15, 2016 Author Share Posted July 15, 2016 Thank you Ch1ck Quote Link to post Share on other sites
Hi, I'm new and I need some help on opencomputers.
Can anyone post or make a tutorial on redstone cards? Because I cant find any tutorials on redstone cards which aren't outdated
Link to post
Share on other sites