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

Iron tanks and more

Started by joostlek, 15 August 2014 - 09:09 AM
joostlek #1
Posted 15 August 2014 - 11:09 AM
Hello everyone,

Im now playing Direwolf 20 on a server, all going good, having steam power, too much oil and fuel etc.

Now I was trying some things to make a program that actually read the Iron tanks with Steam Oil and Fuel and then it showed on my OpenPeripheral glasses.
I was trying to make a way to transform the amount and capacity into procents and then show a graph and also the amount and the max amount
Didnt came any further and I have no idea how to do it.

(Having additional things like RF reading is usefull too)
theoriginalbit #2
Posted 15 August 2014 - 11:14 AM
Please post up the code you have so far, as well as any errors you encountered, and/or details on where you're stuck so that we may assist you further.
joostlek #3
Posted 15 August 2014 - 12:16 PM
steam file

local steam = peripheral.wrap("rcirontankvalvetile_8")
steamTables = steam.getTankInfo("rcirontankvalvetile_8")
steamTank = steamTables[1]
----If-shizzle cuz my tank is always 250 or 0 and then I get errors
if steamTank == 0 then
 amount = 1
else
 amount = steamTank.amount
end
Glass file

glass = peripheral.wrap("left")
glass.clear()
function getCommand()
while true do
  event, command - os.pullEvent("chat_command")
  if command == "steam" then
   shell.run("steam")
  end
end
end

My problem is, I dont know how to get everything connected with the glasses and stuff (cuz theres no openperipheral wiki, only openmod site)
I dont know how should I set up?

My idea is for now: main file which gets all the in-game chat command and then that command will run another command like steam, and that will make stuff on the screen (oh, just thought, had another problem, cant get a proper loop for the updating tanks)
natedogith1 #4
Posted 15 August 2014 - 12:31 PM
If you run 'openp/docs side' it will list peripheral methods(though this is a bit less useful with terminal glasses). You could always just run the individual tgb.add* functions (tgb being the wrapped terminal glasses bridge) and call the results listMethods function (for example 'tgb.addBox(1,1,1,1).listMethods()', 'tgb.listMethods()' will tell you the arguments needed)