Advertisement
Guest User

blackboard

a guest
Dec 15th, 2012
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.63 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.    currx, curry = mon.getCursorPos()
  24.    mon.setCursorPos(1, curry + 1)
  25.    mon.write(input)
  26.   end
  27.  end
  28. end
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement