Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- function checkKey(sKey)
- rednet.send(nServerID, tostring(sKey))
- sender, message = rednet.receive(1)
- if sender == nServerID then
- if message ~= "authentic" then bAuthentic = false; return false
- else bAuthentic = true; return true end
- end
- end
- --]]
- rednet.open("top")
- rednet.open("bottom")
- rednet.open("back")
- rednet.open("front")
- rednet.open("right")
- rednet.open("left")
- while true do
- sender, message = rednet.receive()
- if message == "CHECKMYKEY" then
- print("Checking KEY")
- confirmSender, message = rednet.receive(0.8)
- if confirmSender == sender then
- file = fs.open("keyList", "r")
- for i=1, 10000 do
- local fileContents = file.readLine()
- if fileContents == message then rednet.send(confirmSender, "authentic"); print("Key confirmed"); break end
- end
- file.close()
- else print("Lost connection...") end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment