115 posts
Posted 21 December 2013 - 08:03 PM
Hello! I am trying to make a program that gets the contents of a Tinker's construct smeltery, Sadly the documentation found
here doesn't seem to work(unless I am doing something terribly wrong or using the wrong version)
The error given was attempt to call nil on line 2
my very limited test
codetinkers' version 1.5.1
cc version 1.58
openperipherals version 0.2.1
modpack: FTB Tech World 2
Any info/assistance is greatly appreciated
Edited on 21 December 2013 - 07:49 PM
115 posts
Posted 21 December 2013 - 08:49 PM
Occured to me I should add the error, added to OP
767 posts
Posted 22 December 2013 - 11:42 AM
looks like you dont, declare the side of which the tank are on?
LINE: 2:
local tabinf = pwrap.getTanks("unknown") — should be the side of the peripheral
Im not sure if thats the main problem, else i dont know how to solve this
115 posts
Posted 22 December 2013 - 11:53 AM
looks like you dont, declare the side of which the tank are on?
LINE: 2:
local tabinf = pwrap.getTanks("unknown") — should be the side of the peripheral
Im not sure if thats the main problem, else i dont know how to solve this
I tried both ways, sadly to no avail
7 posts
Location
Nerd Cave
Posted 22 December 2013 - 02:20 PM
What you did wrong is "pwrap.getTanks()" is not a part of computercraft. a better way to do it is:
local tabinf = peripheral.wrap("right") -- you can change the side
767 posts
Posted 22 December 2013 - 02:54 PM
Hmm, Now when i've looked a bit closer, and didn't find a solution i just want to note that as the error says, its attempting to call the
pwrap.getTanks("left")
which is nil… I have no idea why… Maybe you're not using the latest version etc?
23 posts
Posted 22 December 2013 - 03:07 PM
Method has changed going from 1.5.2 to 1.6.4. It is now .getTankInfo(TankSide)
local tabinf = pwrap.getTankInfo("unknown")
Whole lots of things have changed with new OpenPeripherals, but every peripheral also lets you print all the methods it can use with
peripheralvar.listMethods()
Edited on 22 December 2013 - 02:10 PM
8543 posts
Posted 22 December 2013 - 03:20 PM
Use this instead of listMethods:
textutils.tabulate(peripheral.getMethods("side"))
peripheral.getMethods is actually part of ComputerCraft. I still haven't heard any good reasons for the inclusion of listMethods.
115 posts
Posted 22 December 2013 - 03:28 PM
I actually did what Lyqyd suggested slightly earlier but haven't been able to report back as of yet, This worked.. Sadly it gives a meta table(i think) and i'm not sure how to handle this,it gives two results "1" and
"net.minecraftforge.fluids.FluidTankInfo@38b3430b"
Edited on 22 December 2013 - 02:37 PM
23 posts
Posted 22 December 2013 - 03:48 PM
I actually did what Lyqyd suggested slightly earlier but haven't been able to report back as of yet, This worked.. Sadly it gives a meta table(i think) and i'm not sure how to handle this,it gives two results "1" and
"net.minecraftforge.fluids.FluidTankInfo@38b3430b"
You have to update your OpenPeripherals.
http://openmods.info:8080/job/OpenPeripheral/
115 posts
Posted 22 December 2013 - 04:05 PM
Works perfectly after updating, thank you!