Posted 29 October 2012 - 05:25 PM
Hello,
I have made a program that monitor rednet.
Sorry for my bad english. I am dutch.
Client code
Edit rule 43 to if senderId == your server id then
Server code
Edit rule 9 to if senderId == id of person that must have acces then
Edit rule 19 to rednet.send(id of person that must have acces," ")
If you want to add more people add add this code on rule 12
I have made a program that monitor rednet.
Sorry for my bad english. I am dutch.
Client code
AutoBroadcaster = true
ClearScreen = true
SetCursorPos = true
OpenRednet = true
timeOut = 10
if ClearScreen == true then
term.clear()
end
if SetCursorPos == true then
term.setCursorPos(1,1)
end
if OpenRednet == true then
print("Opening rednet...")
local function connect()
print("Starting location system...")
print("Connecting to rednet...")
for _,s in ipairs(rs.getSides()) do
if peripheral.isPresent(s) and peripheral.getType(s) == "modem" then
rednet.open(s)
return true
end
end
print("No modem found")
print("Aborting")
sleep(3)
os.shutdown()
return false
end
connect()
print("Rednet open...")
end
if AutoBroadcaster == true then
print("Obtaining computerid...")
local compID = os.computerID()
print("Computerid obtained...")
rednet.broadcast(compID .." Is monitoring.")
end
if ShowExitKey == true then
print("CTRL+T to close this program")
end
rednet.send(50," ")
senderId, message, distance = rednet.receive(timeOut)
if senderId == 50 then
while true do
print("Waiting for messages...")
id, message = rednet.receive()
redstone.setOutput("back", true)
local nTime = os.time()write(textutils.formatTime( nTime, false))
print (" - "..message)
print ()
sleep(1)
redstone.setOutput("back", false)
end
end
Edit rule 41 to rednet.send(your server id," ")Edit rule 43 to if senderId == your server id then
Server code
print("Opening rednet...")
rednet.open("back")
print("rednet is open...")
while true do
print("Waiting for messages...")
senderId, message, distance = rednet.receive()
print("Message received...")
if senderId == 23 then
rednet.send(23," ")
end
print("Done")
term.clear()
end
Edit rule 2 to rednet.open("modem side")Edit rule 9 to if senderId == id of person that must have acces then
Edit rule 19 to rednet.send(id of person that must have acces," ")
If you want to add more people add add this code on rule 12
if senderId == id of person that must have acces then
rednet.send(id of person that must have acces," ")