Posted 13 November 2016 - 11:03 PM
Hey Everyone, I just got back into programming with CC again and need a little help, (Hopefully not too much)
After installing a couple tech mods I wanted to have a way to handle power management in a sense, more in regards to Pneumaticraft, and while that doesnt have anything to do really with peripherals as far as I am aware (If im wrong please correct me because I would like to know) I am relying a lot off of redstone, and redstone strengths, I wrote a small management program that i have a hard coded value for my maximum pressure, which for testing purposes, is relatively useful. The problem is as I expand my air system to have more devices, compressors, etc… I need to adjust the program accordingly, on top of that I want to add in the use of being able to live view my pressures, flow, and rf generation (for completely unrelated mods).
With that in mind I decided it would be easier to write up an os program that has a basic GUI maybe a couple menu options, but the workload of making sure the compressors dont overproduce has to be running at all times as if the compressors do not shut off half my base will look like the result of a creeper rave.
This is the code i am using currently (i retyped it out so if there are a couple syntax errors please ignore them, it works in game)
really this is what I want to keep running in the background but I would like to be able to show these values on a monitor and be able to change the constant the airPressure is comparing against so that I can raise or lower the total system pressure.
So after all this really where i need a guide in the right direction is how to make it so that the program doesnt pause to wait for input on the constant so that the system doesnt blow up, and how to live stream data such as the pressure, and such.
Also one other question, Is there a way to send and receive redstone signal strengths all from a bundled cable on on side of the computer or do I have to run separate sides to determine this.
thanks
After installing a couple tech mods I wanted to have a way to handle power management in a sense, more in regards to Pneumaticraft, and while that doesnt have anything to do really with peripherals as far as I am aware (If im wrong please correct me because I would like to know) I am relying a lot off of redstone, and redstone strengths, I wrote a small management program that i have a hard coded value for my maximum pressure, which for testing purposes, is relatively useful. The problem is as I expand my air system to have more devices, compressors, etc… I need to adjust the program accordingly, on top of that I want to add in the use of being able to live view my pressures, flow, and rf generation (for completely unrelated mods).
With that in mind I decided it would be easier to write up an os program that has a basic GUI maybe a couple menu options, but the workload of making sure the compressors dont overproduce has to be running at all times as if the compressors do not shut off half my base will look like the result of a creeper rave.
This is the code i am using currently (i retyped it out so if there are a couple syntax errors please ignore them, it works in game)
really this is what I want to keep running in the background but I would like to be able to show these values on a monitor and be able to change the constant the airPressure is comparing against so that I can raise or lower the total system pressure.
local ventPressure = 7 -- this is to set a compressor vent to release air if it goes over about 4 bar (formula in mod is (Threshold(bar) = 7.5 - Redstone x 0.5)
redstone.setAnalogOutput("back, ventPressure)
while true do
local airPressure = redstone.getAnalogInput("front") -- checks the strength of signal coming from pressure gauge (2x pressure(bar))
if airPressure >= 8 -- 8 is the "Magic" number at this moment, would like this variable to change on user demand
then
redstone.setBundledOutput("right", colors.orange)
os.sleep(1)
else if airPressure < 8
then
redstone.setBundledOutput("right", 0)
end
end
end
So after all this really where i need a guide in the right direction is how to make it so that the program doesnt pause to wait for input on the constant so that the system doesnt blow up, and how to live stream data such as the pressure, and such.
Also one other question, Is there a way to send and receive redstone signal strengths all from a bundled cable on on side of the computer or do I have to run separate sides to determine this.
thanks