Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --global vars
- server = 48
- --function
- function clear()
- term.clear()
- term.setCursorPos(1,1)
- print("Connected to: "..server)
- end
- function UID()
- clear()
- print("Input UID:")
- local num = read()
- rednet.send(server, num, "UID")
- local server,message,protocol = rednet.receive("response",10)
- if message == "confirm" then
- print("confirmed")
- sleep(1)
- Username()
- end
- if message == "denied" then
- clear("Rejected")
- sleep(1)
- start()
- end
- end
- function Username()
- clear()
- print("Input Username: ")
- local input = read("*")
- rednet.send(server,input,"username")
- local id,message,prot = rednet.receive("response",10)
- if message == "confirm" then
- clear()
- print("username confirmed!")
- sleep(1)
- Password()
- end
- if message == "denied" then
- clear()
- print("denied")
- sleep(1)
- Start()
- end
- end
- function Password()
- clear()
- term.write("Iput Password: ")
- local input = read("*")
- rednet.send(server, input, "password")
- local id,message,prot = rednet.receive("response",10)
- if message == "confirm" then
- clear()
- print("Password Confirmed!")
- sleep(1)
- Task()
- end
- if message == "denied" then
- clear()
- print("Message Denied")
- sleep(1)
- Start()
- end
- end
- function Start()
- rednet.open("back")
- UID()
- end
- function Task()
- while true do
- term.write("SERVER SSH: ")
- local cmd = read()
- rednet.send(server, cmd,"ssh")
- clear()
- end
- end
- Start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement