austinv11 / PeripheralsPlusPlus

A pseudo-port of miscperipherals, with other stuff as well!
GNU General Public License v2.0
25 stars 28 forks source link

Can't get os.pullEvent("isort_item") to fire on interactive sorter #171

Closed codestripper closed 6 years ago

codestripper commented 7 years ago

Description

When an item is inserted into the interactive inventory the "isort_item" event is not fired

Steps to Reproduce

  1. Place down computer
  2. Place sorter to the rear
  3. Use the following code: sorter=peripheral.wrap("back") while true do print("Waiting for Event...") local event, item, amount = os.pullEvent("isort_item") print("Event has fired") end
  4. Put an item into the sorter's inventory

Expected behavior: The program should print the event, param, and amount, variables when the event fires.

Actual behavior: The program keeps running as the event is never detected

Version affected: Peripherals++ v1.3.6, FML v7.99.30.1492

Additional Information

Added this mod to the Tekkit Legends pack. Thought it might be because I wasn't using CC v1.75 so I tried switching and still didn't work.

pcnorden commented 6 years ago

Sorry for being really late with this reply, but I'm leaving this here for other to find. In case you want to use the Interactive Sorter the samt way that you could in Misc. Peripherals, a.k.a os.pullEvent("isort_item"), that won't work here. Namely, the event has changed name. Now the event is called itemReady, so instead of os.pullEvent("isort_item") you now call os.pullEvent("itemReady"). The event won't contain any data also, so you need to do a <peripheralName>.analyze() to get the data. I myself do

sorter = peripheral.wrap("left")
while true do
    os.pullEvent("itemReady")
    itmData =sorter.analyze()
    print(itmData.stringId)
end

The table ìtmData` contains this example output:

Name data type
stringId minecraft:cobblestone string
name Cobblestone string
oreDictionaryEntries {"cobblestone"} array
meta 0 int
numericalId 4 int
amount 64 int

Hope that this clears things up for some people!

codestripper commented 6 years ago

Well that would have been nice to know about 7 months ago lol. But really good to know in case I ever play with the mod again. Thank you for the solution!

pcnorden commented 6 years ago

No problem =)

However, another note that someone might find "funny" is that the interactive sorter only can push items to things with inventories, NOT buildcraft pipes. Just found that one out.