Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal

Archived

This topic is now archived and is closed to further replies.

  • 0
iceman11a

How to monitor air pressure

Question

I have a mod installed and with the DNS Techpack. and I need an option to monitor the air pressure going threw a tube. Below is a sample code I have in lua for CC (Computercraft) and I need this to work in OC (Opencomputers)

p = peripheral.wrap("back")
while true do
 x = p.getPressure()
 print("Current pressure " .. x)
 if x < 4 then
 rs.setOutput("right", true)
 print("Pressure low, Starting Engines")
 else
 rs.setOutput("right", false)
end
sleep(5)
end

This code monitors the back of the pc and reads the air pressure and displays the amount of bars, If the amount of bars falls below. 4.0. It sands a redstone signal and engines start up and keep the air pressure up to 4.0 bars

 

Does any one know how to do this in OpenC

 

Thanks

Ice

 

Share this post


Link to post
Share on other sites

16 answers to this question

Recommended Posts

you need adapter, place compressor  to adapter (or adapter to compressor), 

component = require("component")

compressor = component.air_compressor

local pressure = 0

while true do

pressure =  compressor.getPressure()

end

 

cycles or anything else completely the same  

Share this post


Link to post
Share on other sites

Ok, does this have to be a machine or can it be a tube. Or ?. The idea is that I can play with it. to check it for my self. It would be an idea to get some kind of an idea so that I don't spend hours playing with some thing that doesn't work.

 

and do you know how many adapters I can have on one PC system. will the pc just list it with a new id. I'll have to play with that all so.

Last is there a limit on the length on how much network cable I can place down. Can I stretch the network cable. I need to make some poles from blocks and run it 1000 blocks up to 4000 blocks away from the PC and Servers.

 

Thanks for your help

 

UPDATE: getPressure() is not supported any more.

Share this post


Link to post
Share on other sites

Thanks again, Can you tell me what version you have. Nothing shows up like in your screen shots.

 

I have Opencomputers core version 1.0.0

and Opencomputers is 1.3.4.63 and last

opencomponents is 0.2.0.20

Share this post


Link to post
Share on other sites

OpenComponents-MC1.7.10-0.2.0.20-universal

OpenComputers-MC1.7.10-1.3.4.63-universal

PneumaticCraft-1.2.6

updated to

PneumaticCraft-1.7.10-1.2.8-15-universal, works well

Share this post


Link to post
Share on other sites

and i have ComputerCraft1.64pr5

OpenPeripheralAddons-1.7.10-0.2.0-snapshot-122

OpenPeripheralCore-1.7.10-0.5.0-snapshot-142

maybe this not work, because you don`t have computer craft? Try to install.

Share this post


Link to post
Share on other sites

Ok, Then your in the wrong forum, I'm in Opencomputers forum. You should have posted your info in the cmputercraft forum. I need help using Opencomputers. No wonder I couldn't find any thing.

Share this post


Link to post
Share on other sites

Ok, Then your in the wrong forum, I'm in Opencomputers forum. You should have posted your info in the cmputercraft forum. I need help using Opencomputers. No wonder I couldn't find any thing.

my pictures on opencomputers PC. On opencomputers getPressure() works perfectly for me

Share this post


Link to post
Share on other sites

Sometimes CC stuff only gets loaded when CC is present so you may need it to even use it from OC (OpenComponents can only convert/use what it sees, if the CC stuff isn't loaded because CC isn't there then it's not going to do much good)

Share this post


Link to post
Share on other sites

Thanks how ever adigyran, You told me that you were using computercraft. The same options your telling me that work in computercraft also work in opencomputers and that's not true. I all ready looked That doesn't work.

 

JoshTheEnder, That could be very true. The idea is that this is a opencomputer forum and the other guy should have known that and tested his idea in opencomputer, As far as I can see there is no way to check for the pressure in opencomputer.

Share this post


Link to post
Share on other sites

proof that works

ComputerCraft1.64

Computronics-1.7.10-1.0.5

OpenComponents-MC1.7.10-0.2.0.20-universal

OpenComputers-MC1.7.10-1.3.4.63-universal

OpenPeripheralAddons-1.7.10-0.2.0-snapshot-122

OpenPeripheralCore-1.7.10-0.5.0-snapshot-142

PneumaticCraft-1.7.10-1.2.8-15-universal

all this stuff works both in CC and OC for me through adapter block

Share this post


Link to post
Share on other sites

Ok, That's why. Lets look at your list

 

ComputerCraft1.64 (I don't have this mod nor do I want it)

Computronics-1.7.10-1.0.5 ( I don't know what this mod is I have to see if it was added to the modpack I have)

OpenComponents-MC1.7.10-0.2.0.20-universal  (Yes. I have this one)

OpenComputers-MC1.7.10-1.3.4.63-universal (Yes I have this one)

OpenPeripheralAddons-1.7.10-0.2.0-snapshot-122 (I don't think these are added to my mod)

OpenPeripheralCore-1.7.10-0.5.0-snapshot-142 ( This one I don't think have been added to my mod)

PneumaticCraft-1.7.10-1.2.8-15-universal (this version haven't been updated in my mod pack at this time)

 

At the time I was playing with OP and in MC 1.6.4. This option didn't exist. I checked and the mod Computronics-1.7.10-1.0.5 is not a part of the modpack. I don't think nor will I think that DNS will add this mod. CC or Computercraft is a mod I don't like. Because of the limits on this mod. I don't think that OP will be getting added to the mod all so. Like I said. The option I want is not available in the modpack I have. I don't have access to the server to add these mod's. How ever  can you get me a link for these mods.

 

Computronics-1.7.10-1.0.5

OpenPeripheralAddons-1.7.10-0.2.0-snapshot-122

OpenPeripheralCore-1.7.10-0.5.0-snapshot-142

PneumaticCraft-1.7.10-1.2.8-15-universal (I Have 1.2.6) I couldn't find this mod

 

Ice

Share this post


Link to post
Share on other sites

Well then I'm all confused. Do I need all of those extra mods or what? Your saying I need all of those mods and your saying just install CC. well will CC do it all for me or will I have to install all of the mods from the other post. Please tell me just what I need. This is why you have me so confused.

Share this post


Link to post
Share on other sites

my opinion is methods in Pneumatic craft only active when CC is installed. Try just install CC,Open computer and Open components. OpenPeripherals and rest i think you don`t need (this just example, i even have access to computer craft peripherals in OC if i have CC) (Sorry for grammar mistakes, English is not  my native language)

Share this post


Link to post
Share on other sites

not a problem. Ok, I run a mod pack I don't know if i can install those mods. Some of them I all ready have installed. I just don't have OpenPeripherals and i know this has nothing to do with it sense I all ready check this my self. This is still in the Alpha and it was never added. So that I do know.

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.