Posted 27 January 2013 - 09:58 AM
Hello,
I'm trying to add some security to my Quarry frame Computer.
so I wrote this scrip for the Quarry computer:
and this is the code for the terminals trying to control the thing.
I still haven't implemented a lot. but right now. One of the security things is that it will send a messages what has the same ID as the computer.
Then the quarry computer will check if the Message(ComputerID) = SenderID.
But for some reason it will always return false.
Could anyone help me?
regards jurre
I'm trying to add some security to my Quarry frame Computer.
so I wrote this scrip for the Quarry computer:
rednet.close("top")
rednet.open("top")
print("Rednet Opened")
print("Waiting for joiner")
senderID, message, dis = rednet.receive()
rednet.send(senderID, "Welcome my name is GLADOS")
print("Announced myself to computer: "..senderID)
print("Starting Authorisation")
rednet.send(senderID, "1")
senderID, message, dis = rednet.receive(10)
print("SenderID="..senderID.." ,SenderCode="..message)
if senderID==message then
print("login Script accepted"
rednet.send(senderID, "Password Please:")
rednet.receive(10)
else
rednet.send(senderID, "Login Script Failed, Unkown Computer!")
print("DEBUG: Expected: "..senderID.."got: "..message..".")
end
sleep(10)
shell.run("monitor right clear")
shell.run("online")
and this is the code for the terminals trying to control the thing.
rednet.close("top")
rednet.open("top")
print("Looking for computers...")
sleep(2)
rednet.announce()
computerID = os.computerID()
print("I told the network that I'm "..computerID..".")
senderID, message, dis = rednet.receive()
print("Connected with: "..senderID..".")
print(message)
senderID, message, dis = rednet.receive(10)
if message == "1" then
rednet.send(senderID,"computerID")
print("Starting Authorisation")
end
senderID, message,dis = rednet.receive(10)
print(message)
I still haven't implemented a lot. but right now. One of the security things is that it will send a messages what has the same ID as the computer.
Then the quarry computer will check if the Message(ComputerID) = SenderID.
But for some reason it will always return false.
Could anyone help me?
regards jurre