Posted 11 December 2017 - 02:59 PM
So I've tried to make a network (trial and error, so only 2 computers for now), and use 1 main computer to send/transmit commands over the network. But for some reason my modems/computers just stop working, as in, No errors, no yielding error, no nothing and it doesnt loop.
First computer:
Second computer:
What am i missing here?
edit:
screenshot:
How the **** do I add a screenshot, its not allowed?
First computer:
Spoiler
local modem = peripheral.wrap("left")
local newScreen = peripheral.wrap("top")
term.redirect(newScreen)
term.clear()
term.setCursorPos(1,1)
modem.open(1)
local event, modemSide, senderChannel,
replyChannel, message, senderDistance = os.pullEvent("modem_message")
modem.transmit(1, 1, "getEnergyStored")
print("message send")
print(message)
Spoiler
local modem = peripheral.wrap("right")
local newScreen = peripheral.wrap("top")
local capBank = peripheral.wrap("back")
term.redirect(newScreen)
term.clear()
term.setCursorPos(1,1)
modem.open(1)
print("Channel 1 is now opened for listening.")
local function capEnergy()
return capBank.getEnergyStored()
end
while true do
local event, message = os.pullEvent("modem_message")
if message then
if message == "getEnergyStored" then
local energyStored = capEnergy()
modem.transmit(1, 1, energyStored)
end
else
print("nothing yet")
end
end
What am i missing here?
edit:
screenshot:
How the **** do I add a screenshot, its not allowed?
Edited on 11 December 2017 - 02:11 PM