Jump to content




Dead Simple Railcraft Tank Monitoring


83 replies to this topic

#21 Cozzimoto

  • Members
  • 221 posts
  • LocationDallas, Tx

Posted 02 November 2013 - 03:54 PM

[
Spoiler

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.

#22 Forgotten_Boy

  • Members
  • 72 posts
  • LocationOntario, Canada

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.

#23 Forgotten_Boy

  • Members
  • 72 posts
  • LocationOntario, Canada

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.

#24 xtralicu

  • Members
  • 6 posts

Posted 02 November 2013 - 04:45 PM

This is the response:

Posted Image

Is it realy not a railcraft tank valve?

Posted Image

pretty sure it is one :/

#25 Wojbie

  • Members
  • 631 posts
  • LocationKinda lost

Posted 02 November 2013 - 04:54 PM

View Postxtralicu, on 02 November 2013 - 04:45 PM, said:


Are You testing it on server or on ssp? Cause if on server they could have turned off OpenPeripherals.

#26 Forgotten_Boy

  • Members
  • 72 posts
  • LocationOntario, Canada

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.

#27 xtralicu

  • Members
  • 6 posts

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 ^^

#28 Landstryder

  • Members
  • 31 posts

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 by Landstryder, 11 November 2013 - 10:31 AM.


#29 Cozzimoto

  • Members
  • 221 posts
  • LocationDallas, Tx

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

#30 Forgotten_Boy

  • Members
  • 72 posts
  • LocationOntario, Canada

Posted 11 November 2013 - 06:24 PM

Thanks, Cozzimoto! You are correct. Hopefully they change it back :)

#31 mxtrukilla

  • New Members
  • 1 posts

Posted 21 November 2013 - 07:55 PM

can you add liquid force from dartcraft mod

#32 Forgotten_Boy

  • Members
  • 72 posts
  • LocationOntario, Canada

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?

#33 basdxz

  • Members
  • 116 posts

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 by basdxz, 25 November 2013 - 02:23 AM.


#34 Forgotten_Boy

  • Members
  • 72 posts
  • LocationOntario, Canada

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.

#35 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 25 November 2013 - 02:51 AM

View PostForgotten_Boy, on 24 November 2013 - 09:58 PM, said:

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.

#36 Forgotten_Boy

  • Members
  • 72 posts
  • LocationOntario, Canada

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 by Forgotten_Boy, 25 November 2013 - 03:14 AM.


#37 kwstoudt

  • Members
  • 18 posts
  • LocationProvo, Utah

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?

#38 AmigaLink

  • Members
  • 4 posts
  • LocationGermany

Posted 02 January 2014 - 08:41 PM

I have fix this great program for OpenPeripherals 0.2.1
pastebin get QgJbdSLX tankmon


#39 kalmor

  • Members
  • 3 posts

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.

Posted Image

#40 Forgotten_Boy

  • Members
  • 72 posts
  • LocationOntario, Canada

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!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users