16 posts
Posted 23 June 2014 - 04:26 AM
I'm using my computer to print to a monitor a a number of certain items. But I can't figure out how to add an item with an ID with a colon.
if I wanted to print our something like enderium, how would I go about dealing with the syntax?
countOfItemType(20264:74,0)
Thanks in advance!
Edited on 23 June 2014 - 02:26 AM
7083 posts
Location
Tasmania (AU)
Posted 23 June 2014 - 05:16 AM
Are you asking how to
concatenate?
16 posts
Posted 23 June 2014 - 05:55 AM
Are you asking how to
concatenate?
Thanks for the reply!. I don't believe so as it can only be an int and the ID for many items isn't.
for example, in lua, I can do the following to get a white wool count. White Wool ID is 35
countOfItemType(35,0)
but if I wanted to for Orange Wool, (at 35:1)
countOfItemType(35:1,1)
I get an error
the error line in it's entirety in case it helps
lua:36: [string "lua]:1: ')' expected.
7508 posts
Location
Australia
Posted 23 June 2014 - 06:10 AM
this is because in Lua you can't do 35:1, it doesn't understand that syntax.
I had to refresh my memory with this particular piece of OpenPeripheral integration, but the syntax is countOfItemType(itemId, dmgValue) meaning it would be countOfItemType(35,1) this should have been made apparent if you used the built in `docs` program on the computer at `openp/docs`
16 posts
Posted 23 June 2014 - 06:18 AM
You are correct, but the ID of orange wool shows 35:1 , not 35. Like I said, it works fine for items without the colon in the id and since the argument for the countOfItemType takes an int, it seams like I'm missing something.
(example for others not knowing the openp/docs command he's referring to, in this instance it's "openp/docs left countOfItemType" to show the info of the method)
7508 posts
Location
Australia
Posted 23 June 2014 - 06:30 AM
okay time to clear something up. the ID of orange wool is 35, what you see after the colon is the damage value, which is 1.
16 posts
Posted 23 June 2014 - 06:39 AM
okay time to clear something up. the ID of orange wool is 35, what you see after the colon is the damage value, which is 1.
That makes sense then. If the item takes no damage, use it as an additional id marker.
Thanks TheOriginalBit! I'll give that a shot!
7508 posts
Location
Australia
Posted 23 June 2014 - 06:40 AM
okay again, a 'damage' value doesn't mean the item can take damage, in the world on Minecraft 'damage' and 'metadata' are synonyms.