computercraft

ComputerCraft get Item Id inside Blood Magic altar


I'm trying to automate a Blood Magic Altar in Enigmatica 2 Expert Skyblock (1.12.2). I'm trying to get the ID of the item inside the altar but this does not work. I searched a lot and have not found any solution which worked. So here is my option, which does not work:

local altar = peripheral.find('bloodmagic:altar')
print(altar.getAllStacks()[1].all().id)

The error, which occures, is that getAllStacks on the altar returns nil, although there is something inside the altar.

Any one any soltuion regarding this? Thanks a lot :-)


Solution

  • You can get the item's name by doing this:

    local altar = peripheral.find('bloodmagic:altar')
    print(altar.list()[1].name)
    

    If you want to differentiate between the different slates you can use their damage value (the number after the "/"):

    print(altar.list()[1].damage)