Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1, 1)
- if not rednet.isOpen() then
- term.setTextColor(colors.red)
- print("No modem found...")
- term.setTextColor(colors.blue)
- print("Valid sides: ")
- print("front/back/top/bottom/left/right")
- print()
- term.setTextColor(colors.purple)
- print("Please enter a side:")
- term.setCursorPos(22, 5)
- term.setTextColor(colors.green)
- rednet.open(read())
- end
- term.clear()
- term.setCursorPos(1, 1)
- term.setTextColor(colors.purple)
- print("Username:")
- term.setTextColor(colors.green)
- term.setCursorPos(11, 1)
- local user = read()
- term.setTextColor(colors.purple)
- print("Password:")
- term.setTextColor(colors.green)
- term.setCursorPos(11, 2)
- local pass = read("#")
- ----------------------------------
- local server = rednet.lookup("TP", "TPSERV")
- term.setTextColor(colors.orange)
- print("Contacting server...")
- rednet.send(server, "GET", "TP")
- id, message = rednet.receive("TP", 5)
- rednet.send(server, user, "TP")
- rednet.send(server, pass, "TP")
- id, message = rednet.receive("TP", 5)
- if message == "AUTH OK" then
- term.setTextColor(colors.green)
- print("Authentication for "..user.." successful")
- else
- term.setTextColor(colors.red)
- print("Authentication failure for "..user)
- return
- end
- ----------------------------------
- loc = {}
- term.setTextColor(colors.orange)
- print("Retreiving locations...")
- while(true) do
- id, message = rednet.receive("TP", 5)
- if message == "END" then
- break
- end
- loc[#loc+1] = message
- end
- term.clear()
- term.setCursorPos(1, 1)
- term.setTextColor(colors.purple)
- print("#|Name")
- term.setTextColor(colors.lime)
- for i = 1 , #loc do
- print(loc[i])
- end
- print()
- ----------------------------------
- term.setTextColor(colors.purple)
- print("Enter destination ID(#):")
- term.setCursorPos(26, #loc+3)
- term.setTextColor(colors.green)
- local dest = read()
- rednet.send(server, "GOTO", "TP")
- id, message = rednet.receive("TP", 5)
- rednet.send(server, user, "TP")
- rednet.send(server, pass, "TP")
- rednet.send(server, dest, "TP")
- shell.run("/frontend")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement