Guest User

blackboard

a guest
Dec 15th, 2012
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.05 KB | None | 0 0
  1. do
  2. mon = peripheral.wrap("right")
  3. mon.setCursorPos(1,0)
  4. mon.clear()
  5. print("Welcome to BlackBoard!")
  6. print("Type in anything and it will display on the monitor.")
  7. print("Have fun!")
  8. while true do
  9.  local input = read()
  10.  if input == "(:clearscreen" then
  11.   print("Clearing screen...")
  12.   sleep(1)
  13.   mon.clear()
  14.   mon.setCursorPos(1,0)
  15.  else
  16.   if input == "(:clearline" then
  17.    print("Clearing line...")
  18.    sleep(1)
  19.    mon.clearLine()
  20.    currx, curry = mon.getCursorPos()
  21.    mon.setCursorPos(1, curry - 1)
  22.   else
  23.    if input == "help" then
  24.     print("Tip: Type '(:' before a command for it to work.")
  25.     print("COMMANDS:")
  26.     print("clearline - clears the line you just typed.")
  27.     print("clearscreen - clears the whole screen.")
  28.     print("exit - exits BlackBoard.")
  29.    else
  30.     if input == "(:exit" then
  31.      print("Thank you for using BlackBoard!")
  32.      sleep(0.5)
  33.      mon.clear()
  34.      error()
  35.     else
  36.      currx, curry = mon.getCursorPos()
  37.      mon.setCursorPos(1, curry + 1)
  38.      mon.write(input)
  39.     end
  40.    end
  41.   end
  42.  end
  43. end
  44. end
Advertisement
Add Comment
Please, Sign In to add comment