Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- do
- mon = peripheral.wrap("right")
- mon.setCursorPos(1,0)
- mon.clear()
- print("Welcome to BlackBoard!")
- print("Type in anything and it will display on the monitor.")
- print("Have fun!")
- while true do
- local input = read()
- if input == "(:clearscreen" then
- print("Clearing screen...")
- sleep(1)
- mon.clear()
- mon.setCursorPos(1,0)
- else
- if input == "(:clearline" then
- print("Clearing line...")
- sleep(1)
- mon.clearLine()
- currx, curry = mon.getCursorPos()
- mon.setCursorPos(1, curry - 1)
- else
- if input == "help" then
- print("Tip: Type '(:' before a command for it to work.")
- print("COMMANDS:")
- print("clearline - clears the line you just typed.")
- print("clearscreen - clears the whole screen.")
- print("exit - exits BlackBoard.")
- else
- if input == "(:exit" then
- print("Thank you for using BlackBoard!")
- sleep(0.5)
- mon.clear()
- error()
- else
- currx, curry = mon.getCursorPos()
- mon.setCursorPos(1, curry + 1)
- mon.write(input)
- end
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment