Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --DjGiannuzz PneumaticCraft PressureControl Computer
- local tArgs = {...}
- pr = tArgs[1]
- inSide = tArgs[2]
- outSide = tArgs[3]
- function getRedstone(i)
- return 2*i
- end
- function getPressure(i)
- return i/2
- end
- rs = getRedstone(pr)
- print("Detecting Analog Redstone Signal level: " .. rs)
- print("Input side: " .. inSide)
- print("Output side: " .. outSide)
- print("Giving redstone signal at: " .. pr .. "bar")
- print()
- while true do
- x = redstone.getAnalogInput(inSide)
- print("Actual pressure: " .. getPressure(x))
- if x >= rs then
- redstone.setOutput(outSide, false)
- redstone.setBundledOutput(outSide, 0)
- else
- redstone.setOutput(outSide, true)
- redstone.setBundledOutput(outSide, 1)
- end
- sleep(0.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment