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

Help with displaying thaumcraft jars on screen

Started by meat113, 17 August 2014 - 10:57 PM
meat113 #1
Posted 18 August 2014 - 12:57 AM
So I did some googling and ended up here, I found this thread: http://www.computerc...haumcraft-jars/

I was trying to use his code here: http://pastebin.com/S3Na2m3q

Basically I just want to have jars around my altar and have a computer screen displaying what I have in what jar.

I have a wired modem conncted to an advanced computer, with networking cables that go out to all the modems that are connected to open peripherals proxies which are connected to jars.

I have made sure all the modems are connected, it'll say tt_aspectcontainer_(number) connected.

When I try to run the program it gives the error: line 31: bad argument: string expected, got nil

any help would be much appreciated :)/>

ps: using minecraft version 1.6.4 with FTB Monster 1.1.1

edit: also, 90% of my jars have labels… I have a few jars that are not labelled yet and some are empty, not sure if this is a problem
Edited on 17 August 2014 - 11:15 PM
Dragon53535 #2
Posted 18 August 2014 - 02:14 AM
Looking at the ORIGINAL coder of that block he's updated since then, so i'll give you his current code for it.
Spoiler

local function getJarData()
		peripheralData["jar"] = {}
		for index, peripheralName in pairs(peripheral.getNames()) do
				if (peripheralName:find("tt_aspectContainer") or peripheralName:find("tilejar")) then
						if (type(peripheral.call(peripheralName, "getAspects")) == "table") then
								if (not peripheralData["jar"][string.lower(peripheral.call(peripheralName, "getAspects")[1]["name"])]) then
										peripheralData["jar"][string.lower(peripheral.call(peripheralName, "getAspects")[1]["name"])] = {}
								end
								peripheralData["jar"][string.lower(peripheral.call(peripheralName, "getAspects")[1]["name"])][#peripheralData["jar"][string.lower(peripheral.call(peripheralName, "getAspects")[1]["name"])] + 1] = peripheralName
						else
								if (not peripheralData["jar"][string.lower(peripheral.call(peripheralName, "getAspects"))]) then
										peripheralData["jar"][string.lower(peripheral.call(peripheralName, "getAspects"))] = {}
								end
								peripheralData["jar"][string.lower(peripheral.call(peripheralName, "getAspects"))][#peripheralData["jar"][string.lower(peripheral.call(peripheralName, "getAspects"))] + 1] = peripheralName
						end
				end
		end
end


However you should adapt it into your code, just replace the function retrieveData() with this one and change any variables to the ones in the program. Here's the link to the full code.
meat113 #3
Posted 18 August 2014 - 02:40 AM
Okay so here's what I have so far: http://pastebin.com/PC70kK0X

I am using the function from the updated link you gave me and I have replaced the variable jarData with peripheralData.
Now it gives the error on line 23: bad argument #1 value expected

Keep in mind I'm a complete newb, I'm not sure if there are variables I havn't replaced, I think it's just the array variable I needed to replace