Panakotta00 / FicsIt-Networks

Control, Monitor, Manage and Automate your Satisfactory.
https://ficsit.app/mod/FicsItNetworks
GNU General Public License v3.0
157 stars 51 forks source link

Codable splitters don't seem to work? #126

Closed arigo closed 3 years ago

arigo commented 3 years ago

It might be just me, but codable splitters don't seem to work at all right now:

splitter1 = component.proxy("E3DC3FCB418657200524E9904166C836")

while true do
  event.pull(0.1)
  if splitter1:getInput() then
    print(splitter1:transferItem(1))
  end
end

This keeps printing false and the items waiting in the input are sitting there. For reference, the same piece of code works fine with codable mergers (with getInput(1) of course).

arigo commented 3 years ago

Never mind, it works after I delete and re-create the input conveyor belt. Maybe it was badly attached. I realize now that if splitter1:getInput() then is bogus, as such a check always passes (even though it's been presented like this in various youtube videos). Maybe you could add a basic example to the documentation showing the right way, which appears to be:

splitter1 = component.proxy("E3DC3FCB418657200524E9904166C836")

while true do
  event.pull(0.1)
  if splitter1:getInput().Type then
    print(splitter1:transferItem(1))    -- prints false if the output 1 is full
  end
end
arigo commented 3 years ago

FWIW, https://docs.ficsit.app/ficsit-networks/0.0.1/lua/examples/storageRefill.html also uses the line if splitter:getInput() then, which I now think is bogus as such a check always passes.

Panakotta00 commented 3 years ago

I hope the issue you were having will be fixed with the next update...