The idea is when the tank's fluid runs low if to send out a signal threw a bundled cables. and all so threw rednet. (I haven't played with rednet) I don't under stand a lot of it.
This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
Monitor 3 tanks from railcraft
Started by iceman11a, 16 May 2015 - 09:52 PMPosted 16 May 2015 - 11:52 PM
I'm looking for a way to monitor the amount of fluid in 3 tanks from the railcraft mod. Has any one every done this before. Does some one have a lua code to show me how to do this.
The idea is when the tank's fluid runs low if to send out a signal threw a bundled cables. and all so threw rednet. (I haven't played with rednet) I don't under stand a lot of it.
The idea is when the tank's fluid runs low if to send out a signal threw a bundled cables. and all so threw rednet. (I haven't played with rednet) I don't under stand a lot of it.
Posted 17 May 2015 - 12:11 AM
If you don't already have it, you will need open peripherals.
With a (new) computer next to the tank valve (it has to be a valve), run "openp/docs" (you will have to pass the tank direction as a parameter).
this will print a bunch of stuff that may be useful
(this is the extent of my knowledge)
With a (new) computer next to the tank valve (it has to be a valve), run "openp/docs" (you will have to pass the tank direction as a parameter).
this will print a bunch of stuff that may be useful
(this is the extent of my knowledge)
Posted 17 May 2015 - 12:11 AM
There's a railcraft tank monitoring program here. OpenPeripheral functions vary between versions, so you may have to use different functions.
Posted 17 May 2015 - 12:19 AM
Thanks for the info. I wanted some thing simple. Some thing that I can learn from.
Posted 17 May 2015 - 08:22 PM
I still need to know how to setup this lus code. What do I need to attache to what and so on. I still need a server all so. and I have no idea what to do, Guys I can use some help here.
Posted 17 May 2015 - 08:47 PM
As I said before, you will need Open Peripherals (I think you will need core and integration for this).
I'm going to assume that you know how to build a railcraft tank. You will need it to have 3 valves, one for each: input, output and computer.
If you don't know how to use peripherals yet then read this.
Place the computer next to a valve.
Run this command into the terminal where side is the side that the tank valve is on the computer (front/back/left/right/up/down)
If Open Peripheral is installed correctly, then the documentation of the tank will be printed.
I'm going to assume that you know how to build a railcraft tank. You will need it to have 3 valves, one for each: input, output and computer.
If you don't know how to use peripherals yet then read this.
Place the computer next to a valve.
Run this command into the terminal where side is the side that the tank valve is on the computer (front/back/left/right/up/down)
openp/docs <side>
If the computer says "no such program" then Open Peripherals is installed incorrectly. (You may need to check for case sensitivity, try ls or dir to print all files/folders)If Open Peripheral is installed correctly, then the documentation of the tank will be printed.
Edited on 17 May 2015 - 06:51 PM
Posted 18 May 2015 - 09:51 AM
As I said, Yes I have all that installed. I need to klnow how to code a server. This code sends info to a server. I need to make a computercraft pc a server to get messages from the tanks.
and last, Do I have to put the pc next to the value. Is it possible to run a wired and wireless modem on the same pc.
and last, Do I have to put the pc next to the value. Is it possible to run a wired and wireless modem on the same pc.
Posted 18 May 2015 - 11:35 AM
You should be able to use the modems, if that doesn't work, Open Peripherals has the peripheral proxy as a direct fix to this.
Posted 18 May 2015 - 07:39 PM
Ok, That's good. Last thing, what about the rednet code. what do I do about the lua code to handle the code that gets sent..
Posted 18 May 2015 - 07:56 PM
Using a peripheral via a modem is nearly identical to using the peripheral directly.
The only difference is when wrapping the peripheral:
Place a wired modem on the computer and peripheral block (the tank valve in this case).
Right click with an empty hand the modem on the peripheral block, your chat box will have a name in it, write this down.
On your computer (in your program) wrap the peripheral like so:
Use the peripheral as you normally would.
Edit: Having read your title again, each of your tanks will need to be wrapped separately
Edit 2: Rereading the OP, Rednet API and Redstone API on the Wiki
The only difference is when wrapping the peripheral:
Place a wired modem on the computer and peripheral block (the tank valve in this case).
Right click with an empty hand the modem on the peripheral block, your chat box will have a name in it, write this down.
On your computer (in your program) wrap the peripheral like so:
p = peripheral.wrap("Peripheral_Block_1")
Where "Peripheral_Block_1" is the name that you wrote down from the chat box.Use the peripheral as you normally would.
Edit: Having read your title again, each of your tanks will need to be wrapped separately
Edit 2: Rereading the OP, Rednet API and Redstone API on the Wiki
Edited on 18 May 2015 - 06:08 PM
Posted 18 May 2015 - 08:19 PM
Thanks for the info. Sorry you miss under stood. I mean that the lua code. The one I downloaded and added to my computercraft pc. It has an option to connect to anoother pc via rednet. I have no idea what how to code the lua to monitor this. From what I see it sends tank info. to another cc pc. I didn't see a server code in the one I have. and I didn't see one added to this code. Just the client side. That monitors the tanks. I need the lua code that gets the info from the cc pc that monitors and sends the info