Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- CLIENT-INSIDE
- -- Put a modem on this client and set it's side below.
- -- Enter the ID of the server computer, type 'id' to find.
- -- Server deals with password and door opening mechanics.
- -----------------------------------------------------------
- local serverId = CHANGE_THIS
- local modemSide = "back"
- -----------------------------------------------------------
- local welcome = [[
- **************************************************
- * *
- * Goodbye from Nuke Corp Facility *
- * *
- * DRIVE SAFE *
- * *
- * Press RETURN to leave *
- * *
- **************************************************
- ]]
- function clearTerm()
- term.clear()
- term.setCursorPos(1, 1)
- end
- rednet.open(modemSide)
- while true do
- clearTerm()
- print(welcome)
- local pass = read("*")
- clearTerm()
- textutils.slowPrint("Waiting for response from server.")
- local id, access
- repeat
- rednet.send(serverId, pass)
- id, access, doorTime, alarmTime = rednet.receive()
- until id == serverId
- if access == "granted" then
- clearTerm()
- textutils.slowPrint("Doors open for ".. doorTime .." seconds.")
- sleep(doorTime)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement