Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local cosUtils = require("apis/cosUtils.lua")
- local monitor = cosUtils.isMonitorHere()
- local function takeInput(device)
- while true do
- device.write("> ")
- local input = read()
- if input == "back" then
- device.clear()
- shell.run("/2/.menu")
- break
- end
- shell.run(input)
- end
- end
- local function cmdPrompt(device)
- device.settextcolor(colors.white)
- device.clear()
- device.setCursorPos(1, 1)
- if device.setTextScale then
- device.setTextScale(0.5)
- end
- device.write("Welcome to COS CMD Prompt")
- device.setCursorPos(1, 2)
- device.write("To return to the main menu, type 'back'")
- device.setCursorPos(1, 3)
- device.write("===================================================")
- device.setCursorPos(1, 4)
- takeInput(device)
- end
- cmdPrompt(monitor and monitor or term)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement