Jump to content

Dead Simple Railcraft Tank Monitoring

83 replies to this topic

#1 Forgotten_Boy

  • Members
  • 72 posts
  • LocationOntario, Canada

Posted 24 October 2013 - 03:38 AM

UPDATED: April 12th, 2015
- Now updated for Minecraft 1.7.10, ComputerCraft 1.73 and OpenPeripherals 0.7.1

Tired of living beside tanks of creosote just so you can keep an eye on the levels? Sick of walking deep into your lair to monitor various liquids? Here is a solution that turns the Computer Craft Advanced Computer (with a wireless modem) into a block that lets you monitor tank levels at a distance. The setup couldn't be simpler and the display is completely dynamic and fits in nicely with Applied Energistics terminals to give you an at-a-glance understanding of how your tanks are doing.

The pastebin link is http://pastebin.com/aMUgrXU6

  • Set up an advanced computer next to the valve of any Railcraft steel or iron tank. Add a wireless modem; the sides of the peripherals don't matter.
  • Install tankmon:
  • pastebin get aMUgrXU6 tankmon
  • Set up another advanced computer where you want to watch your levels. Attach a wireless modem and at least one Advanced Monitor block. Install tankmon as above and run it. i.e. type "tankmon" and hit Enter.
  • Run tankmon on your computer that was beside the tank. In a few seconds, your tank level should appear. When monitoring a single tank, you can use a monitor stack to duplicate the look of the gauges on the tank, like this:
Attached Image: 2013-10-22_16.38.17.png

The tank display will update every second or so. It includes appropriate colors for 12 common liquids and, if there's room to show it, the absolute value of the amount of liquid in the tank.

Now, just keep adding tanks! Set up an advanced computer with wireless modem beside any tank valve you like. A bar will appear on the screen shortly after you run tankmon at every new valve. If your monitor becomes too crowded, add more monitor blocks. You can add as many tanks as you want, like this:
Attached Image: 2013-10-22_04.11.59.png

But what are those red lines? There's more! On a client, you can run tankmon like this:
tankmon 100 left
tankmon 0 top
In the first example, the tank will send redstone signal on the left side until the tank is full. In the second, it will output signal on top when it goes empty. You can use any value 0-100 (the percentage the tank is full) and any side. The computer at the valve will emit redstone signal on that side if the tank level is at or below the level you specify.
The monitoring display shows a dotted line for any tank where you have set a threshold. The line will be solid red if it is currently outputting redstone signal. Now you can monitor and initiate processes without ever visiting your tanks.

Edited by Forgotten_Boy, 13 April 2015 - 02:02 AM.

#2 SuperZorro

  • Members
  • 10 posts

Posted 25 October 2013 - 05:33 AM

Thanks for this!

Got a an exeption first when I ran it, but just rerunning it worked, so didn't note the error. Seems to run fine now.

Is it posible to change colors? My fruit juice, liquid dna and 1 more are all white.

#3 Forgotten_Boy

  • Members
  • 72 posts
  • LocationOntario, Canada

Posted 25 October 2013 - 02:03 PM

Name your liquids exactly (and the mod they are from if you can) and I'll add them. I never really expected anyone would want giant vats of beeNA.

#4 SuperZorro

  • Members
  • 10 posts

Posted 25 October 2013 - 06:30 PM

I'm running FTB Unleashed.


Seed Oil from Forestry
Liquid DNA from Extra Bees
Fruit Juice from Forestry (Apple Juice previously?)

I probably did oversize my tank for DNA :)


#5 Forgotten_Boy

  • Members
  • 72 posts
  • LocationOntario, Canada

Posted 25 October 2013 - 07:18 PM

Seed oil, Liquid DNA and Fruit Juice have all been added. Just update your server computer with the pastebin above; no need to update the clients.

The colors overlap a little, for example, seed oil and fuel and honey all look the same. Not sure if Seed Oil would look better in the default white.

Let me know if you think something else would make more sense.

#6 SuperZorro

  • Members
  • 10 posts

Posted 26 October 2013 - 08:42 AM

Looks great, thanks :)

I like that the colors represent the liquid color as close as possible, even if a few of them look the same.


#7 PyromancerVx

  • Members
  • 8 posts

Posted 26 October 2013 - 11:26 AM

Looks awesome!

#8 basdxz

  • Members
  • 116 posts

Posted 26 October 2013 - 11:36 AM

Could this work for GregTech Quantum Tanks? And if so could you add the support for it and all of the GregTech liquids?

#9 per

  • Members
  • 6 posts

Posted 26 October 2013 - 01:02 PM

This was a great program..thanks mate!

#10 Forgotten_Boy

  • Members
  • 72 posts
  • LocationOntario, Canada

Posted 26 October 2013 - 02:22 PM

I'm not using GregTech at the moment but OpenPeripherals does support it. All the program would need to do is recognize that it's a GregTech tank and not a Railcraft tank and call the different API functions to determine the stored amounts. There seem to be a lot of other options with GregTech tanks so it may be a little more involved.

#11 xtralicu

  • Members
  • 6 posts

Posted 01 November 2013 - 10:39 AM

Thanks!!! I was looking for a tank monitor with a nice presentation and this is perfect!

but i'm getting an error though :(


Do you know what's wrong?

I'm playing ftb ultimate v1.1.2

#12 Forgotten_Boy

  • Members
  • 72 posts
  • LocationOntario, Canada

Posted 01 November 2013 - 11:03 PM

Hmm, that's an odd one. The line of code referenced is:
Is your monitor advanced? Your colors API is missing? That doesn't seem possible. Did you break the monitor block after starting the server?

Something I know could mess it up is if something else in Rednet range is sending Rednet messages, it could potentially crash.

If it's none of these things, lets discuss it further in more detail.

#13 xtralicu

  • Members
  • 6 posts

Posted 02 November 2013 - 06:20 AM

Hey thanks for making time for me.

Since a video can say a lot more then words:

As you can see i want to monitor the lava tank downstairs to the giant monitor in the monitor room.

This is the only Rednet network that i'm using and there are no other players close in range.

When googling for "colors api' i'm readin this;
For the non-American English version just replace 'colors' with 'colours' and it will use the other API.
Il try and change all ''colors'' in the code to ''colours'', if that works i'l post it here. (Does not work).

Changing the texture pack to default does not fix it either (You never know)

#14 sens

  • Members
  • 49 posts
  • LocationFrance

Posted 02 November 2013 - 07:59 AM

I won't presume to have the same understanding of the program as its author, but it looks like it needs the computer to have at least one Advanced Monitor attached.

#15 xtralicu

  • Members
  • 6 posts

Posted 02 November 2013 - 10:59 AM

Yeah i tried this but it gives the same error. Since only the client needs a monitor, i left the tank computers monitorless.

Thanks anyway every help is welcome i want that awesome api!!! :P

#16 AmigaLink

  • Members
  • 4 posts
  • LocationGermany

Posted 02 November 2013 - 12:15 PM

I have the same problem like xtralicu. :unsure:
Modpack: BackermanLP 0.4.0

#17 Cozzimoto

  • Members
  • 221 posts
  • LocationDallas, Tx

Posted 02 November 2013 - 12:59 PM

i love the idea, looked through all my scripts and i found one of my old ones of a tank monitor client/server all in one program, i like the emiting redstone on the computers for the client that is at the valve. looks like you have a little of an aligning problem with the text and the tank values.

im trying to make my script have multi-monitor support and i want to implement your emiting redstone idea, maybe we can collab? i havent touched my tank program in a few weeks so if you want let me know what you think.


#18 Forgotten_Boy

  • Members
  • 72 posts
  • LocationOntario, Canada

Posted 02 November 2013 - 02:12 PM

Looking at video, it looks like your tankmon client at the valve is failing. When you run the client at the valve it should stay running - there should be no blinking cursor on the computer screen. Even if no tankmon server is running, the client should wait until one appears. I was assuming your error message was at the server. If that valve error message is different, you'll have to tell me as I can't see from the video.

Couple more obvious things to eliminate: is that actually a Railcraft tank?
My modpack versions of the relevant pieces:
ComputerCraft 1.53
Railcraft 1.5.2 - 7.3
OpenPeripherals 0.1.9

Things to try:
- on an Advanced Computer, type "lua" to go to an interactive Lua prompt (lua>). Then type "print (colors.black"). It should print out:
- try running the client at the valve again. Same error?

#19 Forgotten_Boy

  • Members
  • 72 posts
  • LocationOntario, Canada

Posted 02 November 2013 - 03:22 PM

Cozzimoto: definitely there are some formatting problems with my text/bars. My main goal was that the display be flexible and dynamic, so it isn't pixel-perfect in a few ways.
I'd encourage you to steal whatever you like from my code! The redstone stuff isn't too tough but works well for making the clients/servers behave dynamically.

#20 xtralicu

  • Members
  • 6 posts

Posted 02 November 2013 - 03:28 PM

Trying everything you provided does not work.

The error is exactly the same at the valve and the server.

I tried the lua prompt and that gives me the corect numbers. Still the same error.

Yess the tank is a railcraft one (are there other tanks that look like this?) but yeah i'm pretty sure it's a railcraft one.
This is so weird as it does not give an error at the other colors. changing backround color to cyan does not work.

Don't tell me i have to run 5 stairs to see the tank storage :P

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users