92 posts
Posted 24 August 2013 - 12:20 PM
I have written the following code based off of the OpenPeripheral documentation to read from a BuildCraft tank:
tank = peripheral.wrap("left")
tableInfo = tank.getTanks("unknown")
for key, value in pairs(tableInfo) do
print(key .. " = " .. tostring(value))
end
However line 2 gives me an attempt to call nil error.
I have the tank on the computer's left (
http://prntscr.com/1n599j ) and I am running 1.6.2 with the latest version of both mods (OpenPeripheral and BuildCraft)
What is going wrong?
301 posts
Location
Whenever, Wherever!
Posted 24 August 2013 - 11:49 PM
… um. Try playing around with it in lua.
Oh! And answers take time, we are not your assistants.
1190 posts
Location
RHIT
Posted 25 August 2013 - 08:29 AM
1) I have deleted your posts bumping the thread. They are out of line and unnecessary.
2) Your problem most likely has to do with the fact that OpenPeripheral documentation seems to be out of date. Go into the lua console and type this:
p = peripheral.wrap("side")
for i,v in pairs(p) do print(i,v) end
This will give you a list of all the methods that a peripheral has, and the getTanks or its equivalent should be shown. If you are given an error by that second line, it probably means that the tank is not a peripheral and you should contact Mikeemoo with the information.
32 posts
Location
UK
Posted 25 August 2013 - 09:48 AM
I'm not sure if this is the problem or not, but I thought you need the peripheral proxy to wrap a non solid block.
As I said not sure if this is it but ill try it myself when I get a chance.
1190 posts
Location
RHIT
Posted 25 August 2013 - 10:06 AM
I'm not sure if this is the problem or not, but I thought you need the peripheral proxy to wrap a non solid block.
As I said not sure if this is it but ill try it myself when I get a chance.
The peripheral proxy is for blocks such as the wireless modem, which cannot be connected to via wired modem cable. So long as the computer is directly next to the BC tank, it should be able to wrap it as a peripheral.