Well I have tried to merge them.
–fluidTank = tank
–mon = monitor
for _,side in pairs(rs.getSides()) do – this uses the redstone.getSides() call to look at each side of the computer
if peripheral.isPresent(side) then – if we find a perhiperal…
if peripheral.getType(side) == "monitor" then – then we try to identify if it's one of the peripherals we're looking for
mon = peripheral.wrap(side) – if it's what we're looking for, we wrap it
elseif peripheral.getType(side) == "tank" then
fluidTank = peripheral.wrap(side)
elseif peripheral.getType(side) == "modem" then
if not peripheral.call(side,"isWireless") then – eliminate wireless modems
local mdm = peripheral.wrap(side) – temporarily wrap the modem
for e,f in pairs(mdm.getNamesRemote()) do – look for attached peripherals
if string.sub(f,1,4) == 'tank' then – if we find a tank
fluidTank = peripheral.wrap(f) – wrap it
elseif string.sub(f,1,7) == 'monitor' then
mon = perihperal.wrap(f)
end
end
end
end
end
end
mon.setTextScale(2)
–Change the number in the parathanses up top to chose what size text you want(Goes up to 5)
mon.clear()
mon.setCursorPos(1,1)
mon.write("Tank 1:")
repeat
local pertable = fluidTank.getTankInfo("unknown")
local pertable1 = pertable[1]
local h = 2
for i,j in pairs(pertable1) do
mon.setCursorPos(1,h)
mon.write(tostring(i)..":"..tostring(j).." ")
h = h + 1
end
sleep(1)
until h==1000
–Credits to Dog from the computer craft forums for alot of help on debugging and bettering this code
there is a problem at line 30 though
attempt to call nil if I remember