Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Username = "guest"
- local AccountID = "0"
- local function Clear()
- term.clear()
- term.getCursorPos(1,1)
- end
- local function GetStatus(line)
- local id = rednet.lookup("TrainNet_M")
- rednet.send(id,line)
- local a, b, c = rednet.receive()
- return(b)
- end
- local function WirelessLogin()
- local AccountDetails = AccountID
- rednet.host("1000",Username)
- local id, message = rednet.receive()
- rednet.send(id, AccountDetails,"1000")
- end
- function CUI(m) --declare function
- n=1
- local l = #m
- while true do
- term.setCursorPos(1,5)
- for i=1, #m, 1 do --traverse the table of options
- if i==n then term.clearLine() print(i, ">",m[i]) else term.clearLine() print(i, "-", m[i]) end --print them
- end
- a, b= os.pullEvent("key") --wait for keypress
- if b==keys.w and n>1 then n=n-1 end
- if b==keys.s and n<l then n=n+1 end
- if b==keys.enter then break end
- end
- return n --return the value
- end
- function Login()
- local file = fs.open("os/System/Client/Files/.UserFile","r")
- Username = file.readLine()
- file.close()
- end
- function LinesScreen()
- Clear()
- print("Operating Lines")
- local options = {"exit"}
- local n = CUI(options)
- if options[n] == "exit" then
- Menu()
- else
- LineDisplay(n)
- end
- end
- function AccountScreen()
- Clear()
- print("hello ",Username)
- print("=Account Details=")
- print("WIP")
- print("press enter to exit")
- repeat
- local event, key = os.pullEvent("key")
- until key == keys.enter
- Menu()
- end
- function PassScreen()
- print("coming soon!")
- print("press enter to exit")
- repeat
- local event, key = os.pullEvent("key")
- until key == keys.enter
- Menu()
- end
- function Menu()
- Clear()
- local options = {"Find_Line","Check_Account","Passes","exit"}
- local n = CUI(options)
- if options[n] == "Find_Line" then
- LinesScreen()
- elseif options[n] == "Check_Account" then
- AccountScreen()
- elseif options[n] == "Passes" then
- PassScreen()
- elseif options[n] == "exit" then
- end
- end
- Login()
- Menu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement