Jump to content




Dead Simple Railcraft Tank Monitoring


83 replies to this topic

#41 kwstoudt

  • Members
  • 18 posts
  • LocationProvo, Utah

Posted 07 January 2014 - 07:45 PM

View PostForgotten_Boy, on 07 January 2014 - 01:54 AM, said:

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.

#42 oeed

    Oversimplifier

  • Members
  • 2,095 posts
  • LocationAuckland, New Zealand

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.

#43 kalmor

  • Members
  • 3 posts

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. ;)

#44 Forgotten_Boy

  • Members
  • 72 posts
  • LocationOntario, Canada

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.

#45 roadkill613

  • Members
  • 11 posts

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 by roadkill613, 08 January 2014 - 10:11 PM.


#46 Forgotten_Boy

  • Members
  • 72 posts
  • LocationOntario, Canada

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.

#47 roadkill613

  • Members
  • 11 posts

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

#48 Forgotten_Boy

  • Members
  • 72 posts
  • LocationOntario, Canada

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!

#49 +Nick

  • Members
  • 8 posts
  • LocationEngland

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?

#50 kalmor

  • Members
  • 3 posts

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.

#51 kwstoudt

  • Members
  • 18 posts
  • LocationProvo, Utah

Posted 10 January 2014 - 01:14 PM

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?

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?

#52 Forgotten_Boy

  • Members
  • 72 posts
  • LocationOntario, Canada

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.

#53 roadkill613

  • Members
  • 11 posts

Posted 11 January 2014 - 05:27 PM

View Postkalmor, on 09 January 2014 - 04:02 PM, said:

@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

#54 kwstoudt

  • Members
  • 18 posts
  • LocationProvo, Utah

Posted 11 January 2014 - 11:11 PM

View PostForgotten_Boy, on 10 January 2014 - 05:51 PM, said:

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

#55 Forgotten_Boy

  • Members
  • 72 posts
  • LocationOntario, Canada

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.

#56 kwstoudt

  • Members
  • 18 posts
  • LocationProvo, Utah

Posted 13 January 2014 - 08:23 AM

View PostForgotten_Boy, on 13 January 2014 - 12:00 AM, said:

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 by kwstoudt, 13 January 2014 - 08:24 AM.


#57 Drexic

  • Members
  • 6 posts

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)

#58 Drexic

  • Members
  • 6 posts

Posted 29 January 2014 - 02:31 AM

View Postroadkill613, on 09 January 2014 - 04:40 AM, said:

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.

#59 Zyme

  • Members
  • 7 posts

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)

#60 Drexic

  • Members
  • 6 posts

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 by Drexic, 31 January 2014 - 02:42 AM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users