You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This would be better in a discussion, but they aren't enabled here.
If I wanted to go about adding networking, would I go along the lines of something like:
-- artist/items/network.lua--- Provides a module to support multiple turtles on a network.--localmodem=peripheral.find("modem")
-- This probably isn't the best way to find, or exit if there is no modem.ifnotmodemthenreturnendmodem.open(1) -- Or whatever channel, doesn't really matterreturnfunction(context)
localdisabled=false-- Do not create an infinite loop :)context.mediator:add_thread(function()
whiletruedolocal_,_,_._,items=os.pullEvent("modem_message")
disabled=trueself.mediator:publish("items.change",items) -- This seems right? I'm not sure.endend)
context.mediator:subscribe("items.change",function(items)
ifdisabledthenreturnend-- Now just broadcast the new items? I have no clue how this particular event works.modem.transmit(1,1,items)
end)
end
This is some very rough code, but it should provide an idea of what I'm thinking needs to happen in order to make this work?
The text was updated successfully, but these errors were encountered:
Is this code in a working state? I'm happy to contribute however not sure how to get it running, I tried adding it like a module but I get a few errors, ill look into it a bit more
This would be better in a discussion, but they aren't enabled here.
If I wanted to go about adding networking, would I go along the lines of something like:
This is some very rough code, but it should provide an idea of what I'm thinking needs to happen in order to make this work?
The text was updated successfully, but these errors were encountered: