Posted 18 September 2013 - 07:30 PM
Hay,
I tried to open a new topic with my question, but the forum said: "You cannot start a new topic"!
My Question:
I wrote a script that repead a wired modem signal, because after 250 - 300 blogs modemcable there is no rednet signal (broadcast). But these code seems to crash the server after a few hours. If I remove the "repeater" the server works fine.
My Code:
Thanks for helping ;)/>
I tried to open a new topic with my question, but the forum said: "You cannot start a new topic"!
My Question:
I wrote a script that repead a wired modem signal, because after 250 - 300 blogs modemcable there is no rednet signal (broadcast). But these code seems to crash the server after a few hours. If I remove the "repeater" the server works fine.
My Code:
--#####################
--# Network-Repeater #
--#####################
--##########
--# Config #
--##########
-- Modem side (left, right, front, back, top, bottom)
local modemSide1 = 'left'
-- Modem side (left, right, front, back, top, bottom)
local modemSide2 = 'right'
------------------------------------
local compID = 0
function load()
compID = getID()
rednet.open(modemSide1)
rednet.open(modemSide2)
router()
end
function getID()
return os.getComputerID()
end
function _route(msg)
rednet.broadcast(msg)
end
function router()
print('route')
while true do
local sEvent, sSide, sChannel, sReplyChannel, sMessage, nDistance = os.pullEventRaw("modem_message")
rednet.close(sSide)
_route(sMessage)
rednet.open(sSide)
end
end
load()
Thanks for helping ;)/>