trainworld_computercraft/computer/5/both
2025-06-22 00:08:46 +02:00

56 lines
1.3 KiB
Text

W = window.create(term.native(),5,10,10,13)
W2 = window.create(term.native(),35,10,10,13)
--W.setBackgroundColor(colors.lightGray)
--W.setTextColor(colors.black)
W.clear()
W2.clear()
function scoundrilmirror()
while true do
--local x,y = W.getCursorPos()
--paintutils.drawBox(4,9,46,23,colors.gray)
--W.setBackgroundColor(colors.brown)
--W.setTextColor(colors.pink)
id,mess = rednet.receive()
if id == 4 then
W[mess[1]](unpack(mess[2]))
end
--W.setCursorPos(x,y)
--paintutils.drawBox(4,9,46,23,colors.gray)
end
end
function theifmirror()
while true do
id,mess = rednet.receive()
if id == 3 then
W2[mess[1]](unpack(mess[2]))
end
end
end
function eventmirror()
while true do
event = {os.pullEventRaw()}
if event[1] == "rednet_message" then
elseif event[1] == "modem_message" then
else
rednet.send(
4,
event,
"pocketevent"
)
rednet.send(
3,
event,
"pocketevent"
)
--print(event)
end
end
end
parallel.waitForAll(
scoundrilmirror,
theifmirror,
eventmirror
)