Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local URL = -1
- local User = "guest"
- local Connections = {}
- local Modem = peripheral.find("modem")
- local NetVersion = "1.0.0"
- function Clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- function DisplayFiles()
- Clear()
- print("URL: "..URL)
- end
- function Menu()
- Clear()
- print("NetVersion: "..NetVersion)
- print("==Connections==")
- local n = 1
- while true do
- for i = 1, #Connections do
- if n == i then print(">"..Connections[i]) else print(Connections[i]) end
- end
- if n == #Connections + 1 then print("> Logout") else print("Logout") end
- local event, key = os.pullEvent("key")
- if key == keys.s then
- if n == #Connections + 1 then n = 1 else n = n + 1 end
- elseif key == keys.w then
- if n == 1 then n = #Connections + 1 else n = n - 1 end
- elseif key == keys.enter then
- break
- end
- end
- if n == #Connections + 1 then
- Login()
- else
- URL = Connections[n]
- DisplayFiles()
- end
- end
- function Login()
- Clear()
- print("NetVersion: "..NetVersion)
- print("Username:")
- local input
- repeat
- local event, a = os.pullEvent("key")
- input = read()
- until key == keys.enter
- User = input
- Menu()
- end
- function GetConnections()
- Connections = Modem.getNamesRemote()
- end
- GetConnections()
- Login()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement