Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local file = fs.open("computers", "r")
- local selectedId
- term.setTextColor(colors.blue)
- textutils.slowPrint("===Control Panel System===")
- textutils.slowPrint("=====By DiscworldZA=======")
- term.setTextColor(colors.red)
- textutils.slowPrint("Reading IDs..")
- local ids = {}
- local names = {}
- local line
- i = 1
- repeat
- line = file.readLine()
- ids[i] = line
- line = file.readLine()
- names[i] = line
- i = i + 1
- until line == "" or line == nil
- for j = 1,#ids, 1 do
- print(ids[j] .. " " .. names[j])
- end
- term.setTextColor(colors.white)
- write("Select Computer: ")
- selectedId = read()
- while true do
- term.clear()
- term.setCursorPos(1, 1)
- print("===Menu===")
- print("1. Start")
- print("2. Stop")
- print("3. Command")
- command = read()
- if command == "Start" or command == "1" then
- write("Enter Program to Start:")
- program = read()
- shell.run("send " .. selectedId .. " fg " .. program)
- end
- if command == "Stop" or command == "2" then
- write("Enter Program to Stop:")
- program = read()
- shell.run("send " .. selectedId .. " exit " .. program)
- end
- if command == "Command" or command == "3" then
- write("Enter Command:")
- program = read()
- shell.run("send " .. selectedId .. " " .. program)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement