This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Forgotten_Boy's profile picture

Dead Simple Railcraft Tank Monitoring

Started by Forgotten_Boy, 24 October 2013 - 02:38 AM
Forgotten_Boy #1
Posted 24 October 2013 - 04: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

Instructions:
  • 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:
[attachment=1376: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:
[attachment=1375: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 on 13 April 2015 - 01:02 AM
SuperZorro #2
Posted 25 October 2013 - 06: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.
Forgotten_Boy #3
Posted 25 October 2013 - 03: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.
SuperZorro #4
Posted 25 October 2013 - 07:30 PM
I'm running FTB Unleashed.

http://imgur.com/9H4koc5

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

I probably did oversize my tank for DNA :)/>

Thanks!
Forgotten_Boy #5
Posted 25 October 2013 - 08: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.
SuperZorro #6
Posted 26 October 2013 - 09: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.

http://imgur.com/4cK28uB
PyromancerVx #7
Posted 26 October 2013 - 12:26 PM
Looks awesome!
basdxz #8
Posted 26 October 2013 - 12:36 PM
Could this work for GregTech Quantum Tanks? And if so could you add the support for it and all of the GregTech liquids?
per #9
Posted 26 October 2013 - 02:02 PM
This was a great program..thanks mate!
Forgotten_Boy #10
Posted 26 October 2013 - 03: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.
xtralicu #11
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 :(/>

http://imgur.com/VHkjHuK

Do you know what's wrong?

I'm playing ftb ultimate v1.1.2
Forgotten_Boy #12
Posted 01 November 2013 - 11:03 PM
Hmm, that's an odd one. The line of code referenced is:
monitor.setBackgroundColor(colors.black)
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.
xtralicu #13
Posted 02 November 2013 - 06:20 AM
Hey thanks for making time for me.

Since a video can say a lot more then words:

http://youtu.be/exroeiKo7fQ

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)
sens #14
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.
xtralicu #15
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/>
AmigaLink #16
Posted 02 November 2013 - 12:15 PM
I have the same problem like xtralicu. :unsure:/>
Modpack: BackermanLP 0.4.0
Cozzimoto #17
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.

~Cozz
Forgotten_Boy #18
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:
32768
1
- try running the client at the valve again. Same error?
Forgotten_Boy #19
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.
xtralicu #20
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/>
Cozzimoto #21
Posted 02 November 2013 - 03:54 PM
[
Spoiler]
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.

well i dont really need to steal anything, there are snippets of stuff i find interesting, but if you like you can look at mine and see how i got mine to be fully dynamic. with a max size monitor i can probaly fit about 6-7 tank data comfortably, which is why i wanted to go with a multi monitor support option to see if i cant get one computer to track more info without having to use another computer.
Forgotten_Boy #22
Posted 02 November 2013 - 04:05 PM
If the error is the same on client and server then something is really wrong - only the server should have a monitor, and if it doesn't detect a monitor the line of code that is erroring will never be reached. In other words, if your computer is actually at a valve the line 160 shouldn't ever be run.

Lets make sure of what your client is connected to. At a lua prompt, try this:

valve = peripheral.wrap("back")
for k,v in pairs(valve) do print(k) end

You should see
getTanks
listMethods

If we don't see that "getTanks" there, then we've learned something.
Forgotten_Boy #23
Posted 02 November 2013 - 04:09 PM
Cozzimoto: multi-monitor support will be tough - at least for what you get from it. Much tougher than adding a second computer! Because then you'll probably need to change the client and how it broadcasts the rednet message, essentially adding your own channel id to each message.
xtralicu #24
Posted 02 November 2013 - 04:45 PM
This is the response:



Is it realy not a railcraft tank valve?



pretty sure it is one :/
Wojbie #25
Posted 02 November 2013 - 04:54 PM

Are You testing it on server or on ssp? Cause if on server they could have turned off OpenPeripherals.
Forgotten_Boy #26
Posted 02 November 2013 - 05:05 PM
Yep it looks like you are lacking OpenPeripherals. It's not a valve that ComputerCraft can recognize unless you have OpenPeripherals installed.
xtralicu #27
Posted 02 November 2013 - 05:15 PM
Indeed that's the problem, i don't see it it on the forgemod list.
It's always the small things.

Anyway thanks alot for the help Forgotten_Boy and wojbie!
I'l ask the server admin to install OpenPeripherals and see how that goes

Have a nice day ^^
Landstryder #28
Posted 11 November 2013 - 10:14 AM
Using mincraft 1.6.4 with the latest openperipheral it seens that the label for the RC tanks has changed…

the lines

local tankSide = getDeviceSide("iron_tank_valve");
local tankSide2 = getDeviceSide("steel_tank_valve");

seem to no longer coraspond to the tile names

when I called peripheral.getType() it told me it was rcsteel tankvalve tile

trying now to edit that in to see if it will make it work….

… and it appears that peripheral.getTanks() is not fully supported yet in the new version of OP
Edited on 11 November 2013 - 09:31 AM
Cozzimoto #29
Posted 11 November 2013 - 02:11 PM
Open Peripheral for minecraft version 1.6.4 is a beta, im sure the OP created this program from the latest stable build of OP which is currently 0.1.9 for minecraft 1.5.2
Forgotten_Boy #30
Posted 11 November 2013 - 06:24 PM
Thanks, Cozzimoto! You are correct. Hopefully they change it back :)/>
mxtrukilla #31
Posted 21 November 2013 - 07:55 PM
can you add liquid force from dartcraft mod
Forgotten_Boy #32
Posted 24 November 2013 - 09:58 PM
I could add Liquid Force, but need to know the exact name as it appears on the tankmon tank. Is it "Liquid Force" and what color should it be?
basdxz #33
Posted 25 November 2013 - 01:53 AM
A while back I have suggested adding GregTech support, as far as I can see the API for the GT tanks is almost the same as for the RC tanks. If I could make the needed changes, would you add it to the code for everyone to use? PS I am getting the same error, may be incompatible with 1.6?
Edited on 25 November 2013 - 01:23 AM
Forgotten_Boy #34
Posted 25 November 2013 - 02:49 AM
By all means, if you have some tested code for GregTech support along with colors you like, post a pastebin and I'll update my code. As I've said before, hopefully before final release they will change their valve names back, if not I'll update to support old and new.
theoriginalbit #35
Posted 25 November 2013 - 02:51 AM
I could add Liquid Force, but need to know the exact name as it appears on the tankmon tank. Is it "Liquid Force" and what color should it be?
You should also consider updating this program for the latest OpenPeripheral and add Terminal Glasses support. NeverCast added an awesome method onto them that allows you to easily render liquids and they have their texture :)/> Liquid force btw is a yellow colour.
Forgotten_Boy #36
Posted 25 November 2013 - 03:05 AM
Mmm, liquid textures on the HUD would be nice.
I was working on Terminal Glasses but my version of that didn't work yet; haven't tried with the latest stuff.

I added a liquid called "Liquid Force" (uppercase is important here, correct me if I'm wrong) and it should appear as yellow on the ComputerCraft monitor now. I can't test it, so hopefully it works for you!
Edited on 25 November 2013 - 02:14 AM
kwstoudt #37
Posted 25 December 2013 - 11:04 AM
Love the program. However, I play on a server that has the wireless modem disabled :(/>
Any chance I can get a copy of the program that uses wired modems?
AmigaLink #38
Posted 02 January 2014 - 08:41 PM
I have fix this great program for OpenPeripherals 0.2.1

pastebin get QgJbdSLX tankmon
kalmor #39
Posted 03 January 2014 - 12:31 PM
Was playing around with this yesterday and also managed to get it to work similar to the post above. One addition I did make was the following :


local function showLevel(count,max,filled,color,label, amt, threshold, signal)

local screenw, screenh = monitor.getSize()

max = max +1

if (not screenw) then


I noticed it wasn't always showing the last tank for some reason, so adding 1 to the max seems to fix the problem.

Also, not sure if these might help, but I modified the colours and lables a little. I'm currently monitoring 15 tanks displaying on the widest screen I could make (8 blocks long by 5 heigh)

local liquidColors = {{"water", colors.blue, "Water" },
{"tile.oilStill", colors.gray, "Oil"},
{"creosote", colors.brown, "Creosote"},
{"essence", colors.lime},
{"steam", colors.lightGray},
{"honey", colors.orange, "Honey"},
{"bioethanol", colors.orange, "Ethanol"},
{"lava", colors.orange, "Lava"},
{"item.fuel", colors.yellow, "Fuel"},
{"biomass", colors.lime, "Biomass"},
{"fortron", colors.lightBlue},
{"sludge", colors.black},
{"liquid DNA", colors.magenta},
{"juice", colors.green, "Frt Juice"},
{"seedoil", colors.yellow, "Seed Oil"},
{"liquid force", colors.yellow},
{"oil", colors.gray, "Oil"},
{"fuel", colors.yellow, "Fuel"},
{"uumatter", colors.purple, "UUMatter"},
{"vegetable", colors.magenta, "Veg"},
{"deuterium", colors.lightBlue, "Deuterium"},
{"xpjuice", colors.lime, "XP"}
}



Thanks for a great script. Makes monitoring my tanks so much easier and I no longer have to go running around between tanks looking to see how full they are.

Forgotten_Boy #40
Posted 07 January 2014 - 01:54 AM
Haha, fifteen tanks looks awesome! Thanks for your fixes as well, I'll update the program. I added the four new liquids however I left the previous labels intact; not sure if some of your differences were relating to a different version of OpenPeripherals.

To kwstoudt, about wired modems: I've never tried it, but I'm not sure why it wouldn't work. The code detects a modem like this:
local modemSide = getDeviceSide("modem");
and I assume the wired modem is the same, but I don't know. If not just changing this line to be the correct peripheral name may be enough. No time for me to check at the moment, especially since the program is much simpler to use in wireless form!
kwstoudt #41
Posted 07 January 2014 - 07:45 PM
To kwstoudt, about wired modems: I've never tried it, but I'm not sure why it wouldn't work. The code detects a modem like this:
local modemSide = getDeviceSide("modem");
and I assume the wired modem is the same, but I don't know. If not just changing this line to be the correct peripheral name may be enough. No time for me to check at the moment, especially since the program is much simpler to use in wireless form!

Thanks. It would work in wireless except that the server I play on has it disabled.
oeed #42
Posted 08 January 2014 - 02:53 AM
Wow, I really like the nice simple interface, it's very simple, effective and easy to understand. Kudos.
kalmor #43
Posted 08 January 2014 - 09:07 AM
Hmm, I'm currently using OpenPeripheral-0.2.1-snapshot-112-forge9.11.1.953.

Had problems with earlier versions on 1.6.4 so I've been using the snapshot versions which seem to work alot better.

I think some of the liquids actually changed in some of the other mods as well. For instance ethanol is now bioethanol in latest version of forestry.

Also seems to be case sensitive so while it was finding the tanks, the colouring didn't work till I made the label changes. :)/>

I think 15 tanks is kinda the limit though. Any more and it starts to look a little cramped. ;)/>
Forgotten_Boy #44
Posted 08 January 2014 - 02:31 PM
Thanks to AmigaLink for the updated liquids. I've added your changes to the original paste so this program should now support OpenPeripherals 0.2.1, while continuing to support older Open Peripherals (0.1.9) . Also added a few new liquids from kalmor.
roadkill613 #45
Posted 08 January 2014 - 06:16 PM
hello i am attempting to get your tankmon to work but having issues. i am playing on the modpack SGTEKKIT running CCv1.58, railcraft v8.3.2.0 and openperipheral v0.2.1

i am attempting to monitor my lava tank level but when i run the program on the tank side and monitor side they dont talk to each other. thinking they might be out of range i moved the monitor side 5 blocks away in order to debug but no luck.

i attached monitors on top of the tank computer and it didnt give the error like it should telling me its not reading the tank. im not the best with CC but am learning

i thought the issue might be with the following line because when i look at the valve its "Iron Tank Valve" in caps but changing it didnt help anything
local tankSide = getDeviceSide("iron_tank_valve");

im sorry for not being able to explain the issue better. all i know is when i turn the program on both computers do the exact same thing showing the broadcasting message and how many clients are connected and thats it.

Edit i was able to get that line working by changing ("iron_tank_valve") to ("rcirontankvalvetile")

however now i get error to call nil on line 263 where the code is
local tank = valve.getTanks("back")[1]
Edited on 08 January 2014 - 09:11 PM
Forgotten_Boy #46
Posted 09 January 2014 - 02:54 AM
Roadkill: well, every version you are using is newer so no guarantees this can run on your setup.

Just to make sure: the "tank computer" must be adjacent to the valve, and it must be a Railcraft tank. This computer *cannot* have a monitor attached; the computer with the monitor conversely cannot be adjacent to a valve.

If the computers are set up correctly the problem may be in what the Open Peripheral is returning for the valve; it may be the value you are showing ("rcirontankvalvetile") in which case, yep, this isn't going to work without some updates.
roadkill613 #47
Posted 09 January 2014 - 04:40 AM
using the code you supplied in post #22
valve = peripheral.wrap("back")
for k,v in pairs(valve) do print(k) end

i was able to see
getAdvancedMethodsData
getTankInfo
listMethods

i was able to change that .getTanks to .getTankInfo and made it a little further in the program. now it will scan for the server and connect but i dont think im gonna be able to figure this next one out so hopefully soon someone a whole lot smarter than me and using the same version can chime in
its giving error attempt to index?(a nil value) at line 287 witch is write("** Tank contains: " .. tostring(tank["amount"]))

witch i am guessing that it isnt getting a value for "amount" but im starting to think that im gonna have to wait for some more updates.. to be able to read everything its asking for

thanks for the help. i will keep checking back for updates..
Forgotten_Boy #48
Posted 09 January 2014 - 12:09 PM
Yes, unfortunately it looks like a whole lot of things have been renamed. Good on you for getting to the next bug. Probably the program will now need separate paths to support the new stuff, or give up on backwards compatibility. If you can figure out where the new "amount" value is stored you're almost done!
+Nick #49
Posted 09 January 2014 - 01:05 PM
Awesome! :)/> Definitely going to help! Any way you could get this onto a glasses bridge within OpenPeripherals, so its on your HUD at all times?
kalmor #50
Posted 09 January 2014 - 04:02 PM
@roadkill613

Have you tried Amigalinks version in post #38?

I'm running the same versions of the mods you have installed and it's all working fine on my side. Although I will admit, I did my own modifications (stripped out all the checking on the clients side and force wrapped the tank to the back of the computer) but it's pretty much the same changes Amigalink made otherwise.
kwstoudt #51
Posted 10 January 2014 - 01:14 PM
I could add Liquid Force, but need to know the exact name as it appears on the tankmon tank. Is it "Liquid Force" and what color should it be?

How would one check what the computer wants to call the liquid? The tank says "Liquid Force" in yellow, but how would we check it in the computer?
Forgotten_Boy #52
Posted 10 January 2014 - 05:51 PM
If you look back at posts #47 (and 22) in this thread, you get almost all the way there. Using the lua prompt, you can then call getTank or getTankInfo as your version requires and you should get a table back where you'll see the liquid name.
roadkill613 #53
Posted 11 January 2014 - 05:27 PM
@roadkill613

Have you tried Amigalinks version in post #38?

I'm running the same versions of the mods you have installed and it's all working fine on my side. Although I will admit, I did my own modifications (stripped out all the checking on the clients side and force wrapped the tank to the back of the computer) but it's pretty much the same changes Amigalink made otherwise.

i updated to this version and am alot closer to getting it there thanks for that. i thought his post was referencing the original pastebin.

how ever now no mater what liquid is in the tank im getting a tank contains nil. so i would be interested in what you did in your version. if you could post your change with line number so i can try that i would be greatful
kwstoudt #54
Posted 11 January 2014 - 11:11 PM
If you look back at posts #47 (and 22) in this thread, you get almost all the way there. Using the lua prompt, you can then call getTank or getTankInfo as your version requires and you should get a table back where you'll see the liquid name.

it returned 'nil' when I ran the code on my tank containing liquid force
Forgotten_Boy #55
Posted 13 January 2014 - 12:00 AM
Unfortunately I don't have the same version as you on any of this stuff, so I can't help directly. Do double check that you have OpenPeripherals and in the same version as others in this thread who have it working.

If tankmon works for you for any other liquid then you're on your way, however I gather you've got nothing but nils at the moment. Bashing away at the lua prompt isn't much fun - errors and missing data will rarely provide a helpful message - but it's a useful way if you want to see what is going on directly. Sorry I can't be more helpful at the moment, hopefully I can get a further updated version at some point.
kwstoudt #56
Posted 13 January 2014 - 08:23 AM
Unfortunately I don't have the same version as you on any of this stuff, so I can't help directly. Do double check that you have OpenPeripherals and in the same version as others in this thread who have it working.

If tankmon works for you for any other liquid then you're on your way, however I gather you've got nothing but nils at the moment. Bashing away at the lua prompt isn't much fun - errors and missing data will rarely provide a helpful message - but it's a useful way if you want to see what is going on directly. Sorry I can't be more helpful at the moment, hopefully I can get a further updated version at some point.

The only thing I'm getting "nil" on is the Liquid Force from DartCraft. Everything else works just fine.

Running FTB Unleashed 1.1.3
ComputerCraft 1.53
OpenPeripheral 0.1.9
Edited on 13 January 2014 - 07:24 AM
Drexic #57
Posted 27 January 2014 - 04:23 PM
I can confirm the issues with the new Openperipheral 2.1 and railcraft tanks.

If you use the getTanksInfo() method it will bring up a message along with what seems to be a table after the '@' symbol. I still need to do some more learning to figure out how to separate out the two items but it might work somewhat like the liquid containers from steve's carts (double for loops to traverse both tables)
Drexic #58
Posted 29 January 2014 - 02:31 AM
using the code you supplied in post #22
valve = peripheral.wrap("back")
for k,v in pairs(valve) do print(k) end

i was able to see
getAdvancedMethodsData
getTankInfo
listMethods

i was able to change that .getTanks to .getTankInfo and made it a little further in the program. now it will scan for the server and connect but i dont think im gonna be able to figure this next one out so hopefully soon someone a whole lot smarter than me and using the same version can chime in
its giving error attempt to index?(a nil value) at line 287 witch is write("** Tank contains: " .. tostring(tank["amount"]))

witch i am guessing that it isnt getting a value for "amount" but im starting to think that im gonna have to wait for some more updates.. to be able to read everything its asking for

thanks for the help. i will keep checking back for updates..

The reason for this is that the tank.amount method/values do not exist anymore
getTanksInfo() does not return the same values that getTanks() did.

Has anyone found out what the new reading method is? I have a feeling that there is some special way of using getTanksInfo() for doing the same thing I just dont see it.
Zyme #59
Posted 30 January 2014 - 09:03 AM
Would LOVE to get this to work.

I run old FTB Ultimate 1.4.7 :(/>

I get this error:


parallel:22:tankmon:188: attempt to index ? (a number value)
Drexic #60
Posted 31 January 2014 - 02:32 AM
Mistake on my part, I need to do much more research before declaring I have found the solution BUT those interested can take a peek at this link. Warning there is not much information on that forum post.


https://github.com/O...heral/issues/88



I swear I will figure this out.
Edited on 31 January 2014 - 01:42 AM
Forgotten_Boy #61
Posted 31 January 2014 - 12:56 PM
Sorry Zyme, not sure what to tell you! Your error seems uniquely weird (is this your first comp running it or your second? At a monitor or a valve?) so I'd check all your mod versions (CC, OpenP, Railcraft) first and try some of the earlier debug methods that Drexic is using (go to the Lua prompt and make sure you can see *anything* at your tank valve) as you may find the problem soon. The solution, maybe not so easy!

Drexic: good luck! Hope you find the answer and we can update the program!
Drexic #62
Posted 31 January 2014 - 07:07 PM
(I edited this because the original did not make sense)

Alright folks it seems to be true.

Direwolf20 FTB launcher pack uses openperipheral 2.1. In this version when you use the getTankInfo() method the result is a string instead of a readable table.
This is a known issue and is solved in the most recent openperipherals 3.0. I will do the modifications to the code for the updated version of Openperipherals and upload it somewhere, the old way of quarrying information is not going to work (I.E. getTanks()).

Sited Source
https://github.com/O...heral/issues/83

Updated version
http://openmods.info:8080/

its going to take a me a while (busy with real life… sadly…)
Edited on 31 January 2014 - 08:14 PM
RikuSS4 #63
Posted 08 February 2014 - 05:55 PM
I modified this program to work with terminal glasses. I only used the latest version of Open Peripheral for testing though. I will add ability to change which tanks are displayed in the HUD using the chat box later.
Here is the pastebin:
http://pastebin.com/ENkHsHjH
ShadowWarrior979 #64
Posted 09 March 2014 - 07:02 PM
Hi mate sick program :)/> is there away to make the writing on each bar bigger or a different colour because its hard to see what each bar represents
Forgotten_Boy #65
Posted 09 March 2014 - 08:41 PM
If you search the program there is a line:
monitor.setTextScale(.5)
If you change that to something like
monitor.setTextScale(2)  
the text will become much bigger but will cause other display problems.

There's no easy way get things exactly right for everyone. For the most part, you shouldn't have so many liquids on one screen that you get confused - after a while you should remember the locations and the bar heights give you the eyeball accuracy you need. To really know, you'll have to walk up to the screen - or try the HUD addition that RikuSS4 added above.
Edited on 09 March 2014 - 07:41 PM
kwstoudt #66
Posted 13 March 2014 - 09:04 PM
Would there be any chance you could make this program work for OpenBlocks tanks?
Forgotten_Boy #67
Posted 14 March 2014 - 05:17 AM
Well, I can't at the moment but other people keep advancing this further…
XLT_Frank #68
Posted 09 May 2014 - 09:48 PM
I modified this program to work with terminal glasses. I only used the latest version of Open Peripheral for testing though. I will add ability to change which tanks are displayed in the HUD using the chat box later.
Here is the pastebin:
http://pastebin.com/ENkHsHjH

So I cannot seem to get this to work. The program does not detect any tanks. However if I run some sample code, it sees the tanks, no problem. Suggestions?
XLT_Frank #69
Posted 10 May 2014 - 04:22 AM
I was able to fix the issue by changing:

local tankTypes = {"iron_tank_valve", "steel_tank_valve", "openblocks_tank", "drum", "ender_tank", "cofh_thermalexpansion_tank", "net_minecraft_src_buildcraft_factory_tiletank", "tileentitycertustank", "tconstruct_lavatank"};
to

local tankTypes = {"rcirontankvalvetile","rcsteeltankvalvetile","iron_tank_valve", "steel_tank_valve", "openblocks_tank", "drum", "ender_tank", "cofh_thermalexpansion_tank", "net_minecraft_src_buildcraft_factory_tiletank", "tileentitycertustank", "tconstruct_lavatank"};
MrEmielH #70
Posted 10 May 2014 - 04:07 PM
for those who are looking for a more advanced program that can do more then only railcrafttanks, and can also monitor energy-storage, ae-storage, nuclear information and machine information
all liquids are suported
http://www.computerc...achine-monitor/
Edited on 10 May 2014 - 02:10 PM
XLT_Frank #71
Posted 10 May 2014 - 06:33 PM
for those who are looking for a more advanced program that can do more then only railcrafttanks, and can also monitor energy-storage, ae-storage, nuclear information and machine information
all liquids are suported
http://www.computerc...achine-monitor/

There were multiple pastebin's in there. Which one should I go with? I would love to incorporate this.
MrEmielH #72
Posted 11 May 2014 - 11:22 AM
for those who are looking for a more advanced program that can do more then only railcrafttanks, and can also monitor energy-storage, ae-storage, nuclear information and machine information
all liquids are suported
http://www.computerc...achine-monitor/

There were multiple pastebin's in there. Which one should I go with? I would love to incorporate this.
these should work
boot_prior_1: 1X0azEEB
safe_mode: s0sAYjnc
startup xEk0csb7
juicetyven #73
Posted 15 July 2014 - 04:47 PM
Might've missed someone else doing the same, but my tanks were named rcsteeltankvalvetile and my methodname was getTanksInfo.

Incase anyone wonders how you can read the table outputted by tank.getTanksInfo("tank") you can stick it in a variable and read var[1].amount, like so;

http://pastebin.com/qWEb0bYh - text-based monitoring with no scaling whatsoever - quick-and-dirty hookup with wired modems, so your program was quite the catch. :)/>

Also a shameless pastebin of the version i ended up using to monitor my tanks, with the two changed words needed to fix it for me. You might have to change the irontanks-name yourself. http://pastebin.com/9gnJZdWg

Thanks for the awesome program!
BaRF #74
Posted 28 July 2014 - 01:23 PM
Wow this is a great program! Never have to visit my basement again :)/> It's also easy to add liquids and colors so MobEssence and Liquid Essence are also monitored :)/> Maybe an option to have an in-game menu for adding stuff? (For people who don't like editing programs ;)/>)
Forgotten_Boy #75
Posted 31 July 2014 - 07:13 PM
Great to see people are still discovering it! Post a screenshot in use if you can, I always love seeing it in action.
Fyrhtu #76
Posted 02 January 2015 - 03:17 AM
Updated to make compatible with the Direwolf20 Minecraft 1.7 modpack, ver 1.3 (ComputerCraft 1.65, Open Peripherals Addons 0.2.0-snapshot-139, Open Peripheral Core 0.5.0-snapshot-172, Open Peripheral Integration 0.1.0-snapshot-17.)
Also added Life Essence
http://pastebin.com/AEs0eGaG
Forgotten_Boy #77
Posted 13 April 2015 - 03:02 AM
Added to the first post:
UPDATED: April 12th, 2015
- Now updated for Minecraft 1.7.10, ComputerCraft 1.73 and OpenPeripherals 0.7.1
iceman11a #78
Posted 19 May 2015 - 06:34 AM
Thanks for the lua code. It seems to be working fine. A note. The code crashes when the tanks are empty. and the 2nd questions is. What happens when a tank gets too low on what ever it's holding. Do you have a way to send a signal threw bundled cable. Or some thing when the tank gets too low.
Forgotten_Boy #79
Posted 19 May 2015 - 04:42 PM
Yes, the latest version doesn't work with an empty tank :/. If you set the redstone level (see the first post for instructions) it should emit a redstone signal on the side you specify at the tank level you specify.
iceman11a #80
Posted 19 May 2015 - 06:49 PM
Thanks, I really need this to work with bundled cable like other machines work.
greystripe3 #81
Posted 23 April 2016 - 04:04 AM
Whenever I try this out, I get this error server-side whenever it establishes a connection. (Sorry for the massive bump)
Edited on 23 April 2016 - 02:07 AM
Forgotten_Boy #82
Posted 23 April 2016 - 06:34 AM
I haven't run this in a while… What's your versions? Of Minecraft, OpenPeripherals, Railcraft…
It looks like the error is on getTankInfo, which suggests something has changed since my program was written.
greystripe3 #83
Posted 23 April 2016 - 06:38 AM
I threw railcraft into Tekkit (mc 1.6.4, not tekkit legends) and tried running this, and this is what I got :/ Ill try tomorrow, and see what i get.
Edited on 23 April 2016 - 04:38 AM
rasikkes #84
Posted 01 October 2016 - 12:07 PM
Hi,

I've tried all the versions of this program and them not working fine for me, but i loved the idea and the simple layout of this program so i've tried to make the program working good for me.

It took me 2 days of trying and testing and now the program does finally what i wanted.

The first thing i did was to make the program proof for crashing on empty tanks, so i made a check if tank["contents"] is nil or not. If it's nil then the tank is empty and conaints no fluid.

Also i fixed the tank conains nil issue, it now displays the amount in the tank.

And i made some changes in the text output and removed a term.clearline() cause it was doeing that on the advanced monitor and not on the computer's own screen.

This works for me on minecraft 1.7.10, computercraft 1.75, open Peripherals 1.3, Railcraft 9.12.2.0

Here is my version of tankmon

http://pastebin.com/p5XEWFw4

In CC's advanced computer (tank and server) do


pastebin get p5XEWFw4 tankmon

and run it, first run the server and then the client(s)