Jump to content




Pneumaticcraft script


  • You cannot reply to this topic
2 replies to this topic

#1 MrLethalBlood

  • New Members
  • 2 posts

Posted 21 May 2016 - 08:07 AM

Hey guys,

I got a question, i am a noob with cc, normally what i do is copy a code and then keep reading it and googling to understand it.

What I want is a script to get the pressure from my tube's and if the pressure is higher then 4 it must send a redstone signal to release air.

I was trying it a bit myself but I never know how to start a code and then actualy make a working one xD

like my level is a simple door lock....

anyways, i hope one of you could help me making one?

Thanks guys!

https://gyazo.com/d4...4454175c62ad2aa this is what I have so far, i tested the p.getpressure in lua and it works, but I have no idea how to make a script around it,.

#2 The_Cat

  • Members
  • 119 posts

Posted 22 May 2016 - 01:05 AM

Hi there,
I have no experience with pneumaticcraft, but these seems basic enough.
So you have the basics which is good all you need to do now is had a rs.setOutput("side", true) (which you have commented out)
dir can also be "front", "left", "right", "top", "bottom" and "back". (I find this easier)
Here's what I would do:
p = peripheral.wrap("back")
while true do --# Run forever so it doesn't just execute once
	if p.getPressure("north") > 4 then --# Looks like you know what this does
		redstone.setOutput("left", true) --# So if the statement is true we want to set an output to true, so you can connect the redstone with the vent valve
	else --# If it is not > then 4
		redstone.setOutput("left", false) --# Set the left side to false so it stops venting
	end
	os.sleep(0.5) --# Sleep for a set time as if you don't the program will crash (you can change this to anything you want) if you remove it you will get a wielding error
end
Hope this helps :)

Edited by The_Cat, 22 May 2016 - 01:06 AM.


#3 MrLethalBlood

  • New Members
  • 2 posts

Posted 22 May 2016 - 06:23 AM

Hey,
I am gonna test it in a bit, it looks like I was on the right path but missing some knowledge haha.
Thanks for the help and time :D





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users