Jump to content




AE OpenPeripheral - countOfItemType ID Question


  • You cannot reply to this topic
7 replies to this topic

#1 Debugger

  • Members
  • 16 posts

Posted 23 June 2014 - 03: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 by Debugger, 23 June 2014 - 03:26 AM.


#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 23 June 2014 - 04:16 AM

Are you asking how to concatenate?

#3 Debugger

  • Members
  • 16 posts

Posted 23 June 2014 - 04:55 AM

View PostBomb Bloke, on 23 June 2014 - 04:16 AM, said:

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.

#4 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 23 June 2014 - 05: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`

#5 Debugger

  • Members
  • 16 posts

Posted 23 June 2014 - 05: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)

#6 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 23 June 2014 - 05: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.

#7 Debugger

  • Members
  • 16 posts

Posted 23 June 2014 - 05:39 AM

View Posttheoriginalbit, on 23 June 2014 - 05:30 AM, said:

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!

#8 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 23 June 2014 - 05: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.





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users