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

[lua] Interactive Sorting System

Started by Dsystem, 01 February 2013 - 03:31 AM
Dsystem #1
Posted 01 February 2013 - 04:31 AM
Hello guys,

I have a huge proplem with interactive sorters from mis peripherals. When i try to execute and item out of a chest it wont work correctly.


I try it with jungle wood planks. The id in minecraft is: 5:3
I tryed to get the id with that code:
p = peripheral.wrap("back")
event, item = os.pullEvent()
print(item)

It returns: 1080502569

With that id i want to execute an item with:
p = peripheral.wrap("back")
p.extract(4,1080502569,5,1)
It means iam trying to extract wood from right and put one into left, but it wont work. I'm not getting any errors or something like that. r

If anyone can help me i would be so happy. I would also be happy if you could give me other code snippets for the sorter.

Thank you in advance (:
PhilHibbs #2
Posted 01 February 2013 - 04:40 AM
I try it with jungle wood planks. The id in minecraft is: 5:3
I tryed to get the id with that code:
p = peripheral.wrap("back")
event, item = os.pullEvent()
print(item)

It returns: 1080502569
What does os.pullEvent() have to do with Block IDs or inventories?
Dsystem #3
Posted 01 February 2013 - 04:45 AM
In my post i said i use misc peripherals and the peripheral is interactive sorter. He returns it over a pullEvent()
PhilHibbs #4
Posted 01 February 2013 - 05:02 AM
From the documentation, it seems to me that pullEvent() could be giving you any event at all, such as a key press, mouse click, rednet broadcast, whatever. So that number 1080502569 could be anything. Is there any documentation for the peripheral, and does it say what event you should be looking for?

*Edit* pullEvent("isort_item") maybe?
Dsystem #5
Posted 01 February 2013 - 05:03 AM
No it doesnt exist a documenation. the only thing is this post: http://www.computerc...eta-reader-api/

scroll down a bit.


//edit yes but with that i get the same number.
PhilHibbs #6
Posted 01 February 2013 - 05:57 AM
Then I'm all out of ideas. Have you tried retrieving the count as well as the id, like this:
event, item, count = os.pullEvent("isort_item")
PhilHibbs #7
Posted 01 February 2013 - 06:03 AM
Oh, looky here: http://www.computercraft.info/forums2/index.php?/topic/4587-cc1481mc146-miscperipherals-30/
"Unique IDs got a new algorithm over reverse engineering attempts. They are world-unique now. Sorry if I broke your sorting system."
Dsystem #8
Posted 01 February 2013 - 06:20 AM
But how do i get my ids for the items now? have you got any ideas? i mean it must be possible to get the ids for the items otherwise extract would be useless.
TheArchitect #9
Posted 01 February 2013 - 05:52 PM
Run through the machine only the item you want to find out > get its ID